diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0e99ee71f92..d3e11461d6f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -24,6 +24,7 @@ "packages/google-cloud-deploy": "2.2.2", "packages/google-cloud-dialogflow": "5.3.0", "packages/google-cloud-discoveryengine": "0.2.0", + "packages/google-cloud-gaming": "3.1.3", "packages/google-cloud-functions": "2.2.3", "packages/google-cloud-documentai": "6.1.0", "packages/google-cloud-gkeconnect-gateway": "2.0.5", diff --git a/packages/google-cloud-gaming/.OwlBot.yaml b/packages/google-cloud-gaming/.OwlBot.yaml new file mode 100644 index 00000000000..4dfe8e32dd9 --- /dev/null +++ b/packages/google-cloud-gaming/.OwlBot.yaml @@ -0,0 +1,24 @@ +# 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-copy-regex: + - source: /google/cloud/gaming/(v.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-gaming/$1 + +begin-after-commit-hash: fb91803ccef5d7c695139b22788b309e2197856b + diff --git a/packages/google-cloud-gaming/.eslintignore b/packages/google-cloud-gaming/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-gaming/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-gaming/.eslintrc.json b/packages/google-cloud-gaming/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-gaming/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-gaming/.gitattributes b/packages/google-cloud-gaming/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-gaming/.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-gaming/.gitignore b/packages/google-cloud-gaming/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-gaming/.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-gaming/.jsdoc.js b/packages/google-cloud-gaming/.jsdoc.js new file mode 100644 index 00000000000..649bdebb185 --- /dev/null +++ b/packages/google-cloud-gaming/.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/game-servers', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-gaming/.mocharc.js b/packages/google-cloud-gaming/.mocharc.js new file mode 100644 index 00000000000..cdb7b752160 --- /dev/null +++ b/packages/google-cloud-gaming/.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-gaming/.mocharc.json b/packages/google-cloud-gaming/.mocharc.json new file mode 100644 index 00000000000..670c5e2c24b --- /dev/null +++ b/packages/google-cloud-gaming/.mocharc.json @@ -0,0 +1,5 @@ +{ + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} diff --git a/packages/google-cloud-gaming/.nycrc b/packages/google-cloud-gaming/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-gaming/.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-gaming/.prettierignore b/packages/google-cloud-gaming/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-gaming/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-gaming/.prettierrc.js b/packages/google-cloud-gaming/.prettierrc.js new file mode 100644 index 00000000000..d546a4ad546 --- /dev/null +++ b/packages/google-cloud-gaming/.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-gaming/.repo-metadata.json b/packages/google-cloud-gaming/.repo-metadata.json new file mode 100644 index 00000000000..24c6b837c8e --- /dev/null +++ b/packages/google-cloud-gaming/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/game-servers/latest", + "product_documentation": "https://cloud.google.com/game-servers/", + "name": "game-servers", + "requires_billing": true, + "release_level": "stable", + "language": "nodejs", + "api_id": "gameservices.googleapis.com", + "distribution_name": "@google-cloud/game-servers", + "repo": "googleapis/google-cloud-node", + "issue_tracker": "", + "name_pretty": "Google Cloud Game Servers", + "default_version": "v1", + "api_shortname": "gameservices", + "library_type": "GAPIC_AUTO" +} diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md new file mode 100644 index 00000000000..5429a5f7f5a --- /dev/null +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -0,0 +1,199 @@ +# Changelog + +## [3.1.3](https://github.com/googleapis/nodejs-game-servers/compare/v3.1.2...v3.1.3) (2022-11-10) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#349](https://github.com/googleapis/nodejs-game-servers/issues/349)) ([879eea3](https://github.com/googleapis/nodejs-game-servers/commit/879eea37422f58286d3e39e27f5c1b2f6aa4ae9c)) +* Regenerated protos JS and TS definitions ([#353](https://github.com/googleapis/nodejs-game-servers/issues/353)) ([21535e1](https://github.com/googleapis/nodejs-game-servers/commit/21535e16d9dc28888514414117e463271383a971)) + +## [3.1.2](https://github.com/googleapis/nodejs-game-servers/compare/v3.1.1...v3.1.2) (2022-09-22) + + +### Bug Fixes + +* Preserve default values in x-goog-request-params header ([#313](https://github.com/googleapis/nodejs-game-servers/issues/313)) ([8f345d7](https://github.com/googleapis/nodejs-game-servers/commit/8f345d7c91748fbea14862ebb250e0c84e3f8dda)) + +## [3.1.1](https://github.com/googleapis/nodejs-game-servers/compare/v3.1.0...v3.1.1) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#310](https://github.com/googleapis/nodejs-game-servers/issues/310)) ([49f18a8](https://github.com/googleapis/nodejs-game-servers/commit/49f18a8372e8ad2ec6bea1561ade77fc793918ba)) +* Better support for fallback mode ([#305](https://github.com/googleapis/nodejs-game-servers/issues/305)) ([d8a5d01](https://github.com/googleapis/nodejs-game-servers/commit/d8a5d01053a90d8839aafcffa4ed28f7a02050fa)) +* Change import long to require ([#306](https://github.com/googleapis/nodejs-game-servers/issues/306)) ([ecb3015](https://github.com/googleapis/nodejs-game-servers/commit/ecb3015e40ba2c7e7dedc0f48327c55230923f7a)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-game-servers/issues/1553)) ([#309](https://github.com/googleapis/nodejs-game-servers/issues/309)) ([47eb79c](https://github.com/googleapis/nodejs-game-servers/commit/47eb79c061bd658c0a6530f16364bc36993372b8)) +* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-game-servers/issues/1546)) ([#308](https://github.com/googleapis/nodejs-game-servers/issues/308)) ([40cf668](https://github.com/googleapis/nodejs-game-servers/commit/40cf668dd38423b254e889a3fa17fe546b7da66e)) + +## [3.1.0](https://github.com/googleapis/nodejs-game-servers/compare/v3.0.0...v3.1.0) (2022-07-05) + + +### Features + +* support regapic LRO ([7ddd5e7](https://github.com/googleapis/nodejs-game-servers/commit/7ddd5e7b31d99e2f26970b930beef8b317415ada)) + +## [3.0.0](https://github.com/googleapis/nodejs-game-servers/compare/v2.5.0...v3.0.0) (2022-05-17) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#266) + +### Build System + +* update library to use Node 12 ([#266](https://github.com/googleapis/nodejs-game-servers/issues/266)) ([0ad7047](https://github.com/googleapis/nodejs-game-servers/commit/0ad7047cf2f815ed6dc99fe9b15c8f14ecbfdb42)) + +## [2.5.0](https://www.github.com/googleapis/nodejs-game-servers/compare/v2.4.0...v2.5.0) (2021-08-28) + + +### Features + +* support version reporting API ([#213](https://www.github.com/googleapis/nodejs-game-servers/issues/213)) ([478048a](https://www.github.com/googleapis/nodejs-game-servers/commit/478048a0ace56d35afaf637cd1c08dc28e39acc3)) + +## [2.4.0](https://www.github.com/googleapis/nodejs-game-servers/compare/v2.3.8...v2.4.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#209](https://www.github.com/googleapis/nodejs-game-servers/issues/209)) ([014ae7b](https://www.github.com/googleapis/nodejs-game-servers/commit/014ae7b9453372b89fcaffffeabde508650aaec6)) + +### [2.3.8](https://www.github.com/googleapis/nodejs-game-servers/compare/v2.3.7...v2.3.8) (2021-08-17) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#206](https://www.github.com/googleapis/nodejs-game-servers/issues/206)) ([04998bf](https://www.github.com/googleapis/nodejs-game-servers/commit/04998bf4f24613792beb12fff9d1a14da795b74b)) +* **deps:** google-gax v2.24.1 ([#208](https://www.github.com/googleapis/nodejs-game-servers/issues/208)) ([8462da4](https://www.github.com/googleapis/nodejs-game-servers/commit/8462da415e3df130356f70e34f97698628f48b2b)) + +### [2.3.7](https://www.github.com/googleapis/nodejs-game-servers/compare/v2.3.6...v2.3.7) (2021-07-16) + + +### Bug Fixes + +* Updating WORKSPACE files to use the newest version of the Typescript generator. ([#198](https://www.github.com/googleapis/nodejs-game-servers/issues/198)) ([17d6e3f](https://www.github.com/googleapis/nodejs-game-servers/commit/17d6e3f6ff5d7f116572290a9d05cbcd69be0871)) + +### [2.3.6](https://www.github.com/googleapis/nodejs-game-servers/compare/v2.3.5...v2.3.6) (2021-07-12) + + +### Bug Fixes + +* **deps:** google-gax v2.17.1 ([#196](https://www.github.com/googleapis/nodejs-game-servers/issues/196)) ([5a65e3f](https://www.github.com/googleapis/nodejs-game-servers/commit/5a65e3f4398667b2aba2295088c1cc0e2ecf0a8c)) + +### [2.3.5](https://www.github.com/googleapis/nodejs-game-servers/compare/v2.3.4...v2.3.5) (2021-06-29) + + +### Bug Fixes + +* **deps:** google-gax v2.17.0 with mTLS ([#192](https://www.github.com/googleapis/nodejs-game-servers/issues/192)) ([4d37a74](https://www.github.com/googleapis/nodejs-game-servers/commit/4d37a7497ebe77cbfabc5e2bb0ea925e7ac138bb)) + +### [2.3.4](https://www.github.com/googleapis/nodejs-game-servers/compare/v2.3.3...v2.3.4) (2021-06-22) + + +### Bug Fixes + +* make request optional in all cases ([#186](https://www.github.com/googleapis/nodejs-game-servers/issues/186)) ([99424ec](https://www.github.com/googleapis/nodejs-game-servers/commit/99424ecd0f87341bd4814cdbe092d2820c9a78d7)) + +### [2.3.3](https://www.github.com/googleapis/nodejs-game-servers/compare/v2.3.2...v2.3.3) (2021-06-10) + + +### Bug Fixes + +* GoogleAdsError missing using generator version after 1.3.0 ([#175](https://www.github.com/googleapis/nodejs-game-servers/issues/175)) ([a0df035](https://www.github.com/googleapis/nodejs-game-servers/commit/a0df03530d0dc438c8c4318854fbcfa8d7752f8d)) + +### [2.3.2](https://www.github.com/googleapis/nodejs-game-servers/compare/v2.3.1...v2.3.2) (2021-05-24) + + +### Bug Fixes + +* use require() to load JSON protos ([#164](https://www.github.com/googleapis/nodejs-game-servers/issues/164)) ([b77e1e5](https://www.github.com/googleapis/nodejs-game-servers/commit/b77e1e5f7fc9396cdb30d4f1bfac370dd85800b8)) + +### [2.3.1](https://www.github.com/googleapis/nodejs-game-servers/compare/v2.3.0...v2.3.1) (2021-05-20) + + +### Bug Fixes + +* **deps:** require google-gax v2.12.0 ([#162](https://www.github.com/googleapis/nodejs-game-servers/issues/162)) ([546c13d](https://www.github.com/googleapis/nodejs-game-servers/commit/546c13d64abedafd055fad9c118d58750f0f9f25)) + +## [2.3.0](https://www.github.com/googleapis/nodejs-game-servers/compare/v2.2.0...v2.3.0) (2021-03-01) + + +### Features + +* **docs:** update release level to ga ([#147](https://www.github.com/googleapis/nodejs-game-servers/issues/147)) ([0449362](https://www.github.com/googleapis/nodejs-game-servers/commit/0449362aeeead608517e76390813ed7a9c1962c5)) + +## [2.2.0](https://www.github.com/googleapis/nodejs-game-servers/compare/v2.1.2...v2.2.0) (2021-01-09) + + +### Features + +* adds style enumeration ([#142](https://www.github.com/googleapis/nodejs-game-servers/issues/142)) ([59f7332](https://www.github.com/googleapis/nodejs-game-servers/commit/59f7332fee754b11e8a395d19013cc78351e5659)) + +### [2.1.2](https://www.github.com/googleapis/nodejs-game-servers/compare/v2.1.1...v2.1.2) (2020-11-25) + + +### Bug Fixes + +* **browser:** check for fetch on window ([#136](https://www.github.com/googleapis/nodejs-game-servers/issues/136)) ([3c28ff7](https://www.github.com/googleapis/nodejs-game-servers/commit/3c28ff7c610caf58df0dfbd4b3acd2954ae7f019)) + +### [2.1.1](https://www.github.com/googleapis/nodejs-game-servers/compare/v2.1.0...v2.1.1) (2020-11-07) + + +### Bug Fixes + +* do not modify options object, use defaultScopes ([#132](https://www.github.com/googleapis/nodejs-game-servers/issues/132)) ([72124ab](https://www.github.com/googleapis/nodejs-game-servers/commit/72124ab09070efc4555b157bce6cf547dc623bdb)) + +## [2.1.0](https://www.github.com/googleapis/nodejs-game-servers/compare/v2.0.2...v2.1.0) (2020-08-05) + + +### Features + +* v1 API surface ([#109](https://www.github.com/googleapis/nodejs-game-servers/issues/109)) ([f22a3f8](https://www.github.com/googleapis/nodejs-game-servers/commit/f22a3f8e8d19761c9a001f8c521c99449ce88922)) + +### [2.0.2](https://www.github.com/googleapis/nodejs-game-servers/compare/v2.0.1...v2.0.2) (2020-07-09) + + +### Bug Fixes + +* correct return type of delete operations ([#79](https://www.github.com/googleapis/nodejs-game-servers/issues/79)) ([e946632](https://www.github.com/googleapis/nodejs-game-servers/commit/e9466329399c62c0f6f49a713f68ecf8ef96213b)) + +### [2.0.1](https://www.github.com/googleapis/nodejs-game-servers/compare/v2.0.0...v2.0.1) (2020-06-15) + + +### Bug Fixes + +* proper fallback option handling ([#74](https://www.github.com/googleapis/nodejs-game-servers/issues/74)) ([75a2648](https://www.github.com/googleapis/nodejs-game-servers/commit/75a2648469520772a7e8e3c1477176574f537fb0)) + +## [2.0.0](https://www.github.com/googleapis/nodejs-game-servers/compare/v1.1.0...v2.0.0) (2020-06-04) + + +### ⚠ BREAKING CHANGES + +* The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. + +### Features + +* adds CRUD samples, tests for GS clusters ([#24](https://www.github.com/googleapis/nodejs-game-servers/issues/24)) ([943304f](https://www.github.com/googleapis/nodejs-game-servers/commit/943304f1ec235a6b81ee8bf1d33374cd92ef256e)) +* check status of long running operation by its name ([#65](https://www.github.com/googleapis/nodejs-game-servers/issues/65)) ([3900875](https://www.github.com/googleapis/nodejs-game-servers/commit/39008750a6024b0893bee88f39f2a6ad9fc87889)) +* drop node8 support ([#37](https://www.github.com/googleapis/nodejs-game-servers/issues/37)) ([7a9a6d6](https://www.github.com/googleapis/nodejs-game-servers/commit/7a9a6d664c39e11760b86e8adabdad8900292bba)) +* new pagination methods ([#62](https://www.github.com/googleapis/nodejs-game-servers/issues/62)) ([0fcdde7](https://www.github.com/googleapis/nodejs-game-servers/commit/0fcdde74c362abc66118a6df79c4fb4071f3dc14)) + + +### Bug Fixes + +* export explicit version from protos.js ([#43](https://www.github.com/googleapis/nodejs-game-servers/issues/43)) ([d9c09c7](https://www.github.com/googleapis/nodejs-game-servers/commit/d9c09c724ddd9810abfd01143adb4f280546c40c)) +* remove eslint, update gax, fix generated protos, run the generator ([#47](https://www.github.com/googleapis/nodejs-game-servers/issues/47)) ([c75bb2d](https://www.github.com/googleapis/nodejs-game-servers/commit/c75bb2de6ef48c26d5d90892a906b45dcf91755c)) + +## [1.1.0](https://www.github.com/googleapis/nodejs-game-servers/compare/v1.0.0...v1.1.0) (2020-03-03) + + +### Features + +* adds CRUD samples for GS realms ([#21](https://www.github.com/googleapis/nodejs-game-servers/issues/21)) ([b1bf3e4](https://www.github.com/googleapis/nodejs-game-servers/commit/b1bf3e4a846839919e275664eceaba72db3d5eaf)) + +## 1.0.0 (2020-03-01) + + +### Features + +* updates package.json files and quickstart ([d5eb2ff](https://www.github.com/googleapis/nodejs-game-servers/commit/d5eb2ff0ed12cebc268d07a7b0b249049cc9452c)) diff --git a/packages/google-cloud-gaming/CODE_OF_CONDUCT.md b/packages/google-cloud-gaming/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-gaming/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-gaming/CONTRIBUTING.md b/packages/google-cloud-gaming/CONTRIBUTING.md new file mode 100644 index 00000000000..fd7794bb0d7 --- /dev/null +++ b/packages/google-cloud-gaming/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google Cloud Game Servers 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=gameservices.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-gaming/LICENSE b/packages/google-cloud-gaming/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-gaming/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-gaming/README.md b/packages/google-cloud-gaming/README.md new file mode 100644 index 00000000000..bb919327535 --- /dev/null +++ b/packages/google-cloud-gaming/README.md @@ -0,0 +1,228 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google Cloud Game Servers: 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/game-servers.svg)](https://www.npmjs.org/package/@google-cloud/game-servers) + + + + +Game service 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-gaming/CHANGELOG.md). + +* [Google Cloud Game Servers Node.js Client API Reference][client-docs] +* [Google Cloud Game Servers Documentation][product-docs] +* [github.com/googleapis/google-cloud-node/packages/google-cloud-gaming](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-gaming) + +Read more about the client libraries for Cloud APIs, including the older +Google APIs Client Libraries, in [Client Libraries Explained][explained]. + +[explained]: https://cloud.google.com/apis/docs/client-libraries-explained + +**Table of contents:** + + +* [Quickstart](#quickstart) + * [Before you begin](#before-you-begin) + * [Installing the client library](#installing-the-client-library) + * [Using the client library](#using-the-client-library) +* [Samples](#samples) +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Google Cloud Game Servers 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/game-servers +``` + + +### Using the client library + +```javascript +const {RealmsServiceClient} = require('@google-cloud/game-servers'); + +async function quickstart() { + const client = new RealmsServiceClient(); + + // TODO(developer): uncomment the following section, and add values + // const projectId = 'YOUR_PROJECT_ID'; + // const location = 'us-central1; + // const realmId = 'DESIRED_REALM_ID'; + + const request = { + parent: `projects/${projectId}/locations/${location}`, + realmId, + realm: { + // Must use a valid support time zone. + // See https://cloud.google.com/dataprep/docs/html/Supported-Time-Zone-Values_66194188 + timeZone: 'US/Pacific', + description: 'My Game Server realm', + }, + }; + + const [operation] = await client.createRealm(request); + const results = await operation.promise(); + const [realm] = results; + + console.log('Realm created:'); + + console.log(`\tRealm name: ${realm.name}`); + console.log(`\tRealm description: ${realm.description}`); + console.log(`\tRealm time zone: ${realm.timeZone}`); +} +quickstart(); + +``` + + + +## 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 | +| --------------------------- | --------------------------------- | ------ | +| Game_server_clusters_service.create_game_server_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.create_game_server_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.create_game_server_cluster.js,samples/README.md) | +| Game_server_clusters_service.delete_game_server_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.delete_game_server_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.delete_game_server_cluster.js,samples/README.md) | +| Game_server_clusters_service.get_game_server_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.get_game_server_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.get_game_server_cluster.js,samples/README.md) | +| Game_server_clusters_service.list_game_server_clusters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.list_game_server_clusters.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.list_game_server_clusters.js,samples/README.md) | +| Game_server_clusters_service.preview_create_game_server_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_create_game_server_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_create_game_server_cluster.js,samples/README.md) | +| Game_server_clusters_service.preview_delete_game_server_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_delete_game_server_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_delete_game_server_cluster.js,samples/README.md) | +| Game_server_clusters_service.preview_update_game_server_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_update_game_server_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_update_game_server_cluster.js,samples/README.md) | +| Game_server_clusters_service.update_game_server_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.update_game_server_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.update_game_server_cluster.js,samples/README.md) | +| Game_server_configs_service.create_game_server_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.create_game_server_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.create_game_server_config.js,samples/README.md) | +| Game_server_configs_service.delete_game_server_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.delete_game_server_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.delete_game_server_config.js,samples/README.md) | +| Game_server_configs_service.get_game_server_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.get_game_server_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.get_game_server_config.js,samples/README.md) | +| Game_server_configs_service.list_game_server_configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.list_game_server_configs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.list_game_server_configs.js,samples/README.md) | +| Game_server_deployments_service.create_game_server_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.create_game_server_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-gaming/samples/generated/v1/game_server_deployments_service.create_game_server_deployment.js,samples/README.md) | +| Game_server_deployments_service.delete_game_server_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.delete_game_server_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-gaming/samples/generated/v1/game_server_deployments_service.delete_game_server_deployment.js,samples/README.md) | +| Game_server_deployments_service.fetch_deployment_state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.fetch_deployment_state.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.fetch_deployment_state.js,samples/README.md) | +| Game_server_deployments_service.get_game_server_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.get_game_server_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-gaming/samples/generated/v1/game_server_deployments_service.get_game_server_deployment.js,samples/README.md) | +| Game_server_deployments_service.get_game_server_deployment_rollout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.get_game_server_deployment_rollout.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.get_game_server_deployment_rollout.js,samples/README.md) | +| Game_server_deployments_service.list_game_server_deployments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.list_game_server_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-gaming/samples/generated/v1/game_server_deployments_service.list_game_server_deployments.js,samples/README.md) | +| Game_server_deployments_service.preview_game_server_deployment_rollout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.preview_game_server_deployment_rollout.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.preview_game_server_deployment_rollout.js,samples/README.md) | +| Game_server_deployments_service.update_game_server_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.update_game_server_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-gaming/samples/generated/v1/game_server_deployments_service.update_game_server_deployment.js,samples/README.md) | +| Game_server_deployments_service.update_game_server_deployment_rollout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.update_game_server_deployment_rollout.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.update_game_server_deployment_rollout.js,samples/README.md) | +| Realms_service.create_realm | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/realms_service.create_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/realms_service.create_realm.js,samples/README.md) | +| Realms_service.delete_realm | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/realms_service.delete_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/realms_service.delete_realm.js,samples/README.md) | +| Realms_service.get_realm | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/realms_service.get_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/realms_service.get_realm.js,samples/README.md) | +| Realms_service.list_realms | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/realms_service.list_realms.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/realms_service.list_realms.js,samples/README.md) | +| Realms_service.preview_realm_update | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/realms_service.preview_realm_update.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/realms_service.preview_realm_update.js,samples/README.md) | +| Realms_service.update_realm | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/realms_service.update_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/realms_service.update_realm.js,samples/README.md) | +| Game_server_clusters_service.create_game_server_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.create_game_server_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.create_game_server_cluster.js,samples/README.md) | +| Game_server_clusters_service.delete_game_server_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.delete_game_server_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.delete_game_server_cluster.js,samples/README.md) | +| Game_server_clusters_service.get_game_server_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.get_game_server_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.get_game_server_cluster.js,samples/README.md) | +| Game_server_clusters_service.list_game_server_clusters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.list_game_server_clusters.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.list_game_server_clusters.js,samples/README.md) | +| Game_server_clusters_service.preview_create_game_server_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_create_game_server_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_create_game_server_cluster.js,samples/README.md) | +| Game_server_clusters_service.preview_delete_game_server_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_delete_game_server_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_delete_game_server_cluster.js,samples/README.md) | +| Game_server_clusters_service.preview_update_game_server_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_update_game_server_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_update_game_server_cluster.js,samples/README.md) | +| Game_server_clusters_service.update_game_server_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.update_game_server_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.update_game_server_cluster.js,samples/README.md) | +| Game_server_configs_service.create_game_server_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.create_game_server_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.create_game_server_config.js,samples/README.md) | +| Game_server_configs_service.delete_game_server_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.delete_game_server_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.delete_game_server_config.js,samples/README.md) | +| Game_server_configs_service.get_game_server_config | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.get_game_server_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.get_game_server_config.js,samples/README.md) | +| Game_server_configs_service.list_game_server_configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.list_game_server_configs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.list_game_server_configs.js,samples/README.md) | +| Game_server_deployments_service.create_game_server_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.create_game_server_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-gaming/samples/generated/v1beta/game_server_deployments_service.create_game_server_deployment.js,samples/README.md) | +| Game_server_deployments_service.delete_game_server_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.delete_game_server_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-gaming/samples/generated/v1beta/game_server_deployments_service.delete_game_server_deployment.js,samples/README.md) | +| Game_server_deployments_service.fetch_deployment_state | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.fetch_deployment_state.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.fetch_deployment_state.js,samples/README.md) | +| Game_server_deployments_service.get_game_server_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.get_game_server_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-gaming/samples/generated/v1beta/game_server_deployments_service.get_game_server_deployment.js,samples/README.md) | +| Game_server_deployments_service.get_game_server_deployment_rollout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.get_game_server_deployment_rollout.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.get_game_server_deployment_rollout.js,samples/README.md) | +| Game_server_deployments_service.list_game_server_deployments | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.list_game_server_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-gaming/samples/generated/v1beta/game_server_deployments_service.list_game_server_deployments.js,samples/README.md) | +| Game_server_deployments_service.preview_game_server_deployment_rollout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.preview_game_server_deployment_rollout.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.preview_game_server_deployment_rollout.js,samples/README.md) | +| Game_server_deployments_service.update_game_server_deployment | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.update_game_server_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-gaming/samples/generated/v1beta/game_server_deployments_service.update_game_server_deployment.js,samples/README.md) | +| Game_server_deployments_service.update_game_server_deployment_rollout | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.update_game_server_deployment_rollout.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.update_game_server_deployment_rollout.js,samples/README.md) | +| Realms_service.create_realm | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.create_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/realms_service.create_realm.js,samples/README.md) | +| Realms_service.delete_realm | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.delete_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/realms_service.delete_realm.js,samples/README.md) | +| Realms_service.get_realm | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.get_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/realms_service.get_realm.js,samples/README.md) | +| Realms_service.list_realms | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.list_realms.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/realms_service.list_realms.js,samples/README.md) | +| Realms_service.preview_realm_update | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.preview_realm_update.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/realms_service.preview_realm_update.js,samples/README.md) | +| Realms_service.update_realm | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.update_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/realms_service.update_realm.js,samples/README.md) | +| Create Game Server Realm | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/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-gaming/samples/quickstart.js,samples/README.md) | +| Quickstart.test | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/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-gaming/samples/test/quickstart.test.js,samples/README.md) | + + + +The [Google Cloud Game Servers 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/game-servers@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/game-servers/latest +[product-docs]: https://cloud.google.com/game-servers/ +[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=gameservices.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-gaming/linkinator.config.json b/packages/google-cloud-gaming/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-cloud-gaming/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-gaming/owlbot.py b/packages/google-cloud-gaming/owlbot.py new file mode 100644 index 00000000000..da779f13ebf --- /dev/null +++ b/packages/google-cloud-gaming/owlbot.py @@ -0,0 +1,18 @@ +# 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. +"""This script is used to synthesize generated parts of this library.""" +import synthtool.languages.node_mono_repo as node + +node.owlbot_main(relative_dir="packages/google-cloud-gaming",staging_excludes=['package.json', 'README.md'], templates_excludes=['.github/CODEOWNERS']) + diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json new file mode 100644 index 00000000000..43c6d42442a --- /dev/null +++ b/packages/google-cloud-gaming/package.json @@ -0,0 +1,59 @@ +{ + "name": "@google-cloud/game-servers", + "version": "3.1.3", + "description": "Game service client for Node.js", + "repository": { + "type": "git", + "directory": "packages/google-cloud-gaming", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, + "license": "Apache-2.0", + "author": "Google LLC", + "files": [ + "build/src", + "build/protos" + ], + "main": "build/src/index.js", + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "predocs-test": "npm run docs", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "npm run compile && c8 mocha build/system-test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "test": "c8 mocha build/test", + "prelint": "cd samples; npm link ../; npm install", + "precompile": "gts clean" + }, + "dependencies": { + "google-gax": "^3.5.2" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^18.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.0.0", + "gts": "^3.1.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.0", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.0.0", + "typescript": "^4.6.4", + "webpack": "^5.0.0", + "webpack-cli": "^4.0.0" + }, + "engines": { + "node": ">=12.0.0" + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-gaming" +} diff --git a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/common.proto b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/common.proto new file mode 100644 index 00000000000..843042671ff --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/common.proto @@ -0,0 +1,238 @@ +// 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.gaming.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1;gaming"; +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1"; + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of Locations that could not be reached. + repeated string unreachable = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Operation status for Game Services API operations. Operation status is in + // the form of key-value pairs where keys are resource IDs and the values show + // the status of the operation. In case of failures, the value includes an + // error code and error message. + map operation_status = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +message OperationStatus { + enum ErrorCode { + ERROR_CODE_UNSPECIFIED = 0; + + INTERNAL_ERROR = 1; + + PERMISSION_DENIED = 2; + + CLUSTER_CONNECTION = 3; + } + + // Output only. Whether the operation is done or still in progress. + bool done = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The error code in case of failures. + ErrorCode error_code = 2; + + // The human-readable error message. + string error_message = 3; +} + +// The label selector, used to group labels on the resources. +message LabelSelector { + // Resource labels for this selector. + map labels = 1; +} + +// The realm selector, used to match realm resources. +message RealmSelector { + // List of realms to match. + repeated string realms = 1; +} + +// The schedule of a recurring or one time event. The event's time span is +// specified by start_time and end_time. If the scheduled event's timespan is +// larger than the cron_spec + cron_job_duration, the event will be recurring. +// If only cron_spec + cron_job_duration are specified, the event is effective +// starting at the local time specified by cron_spec, and is recurring. +// +// ``` +// start_time|-------[cron job]-------[cron job]-------[cron job]---|end_time +// cron job: cron spec start time + duration +// ``` +message Schedule { + // The start time of the event. + google.protobuf.Timestamp start_time = 1; + + // The end time of the event. + google.protobuf.Timestamp end_time = 2; + + // The duration for the cron job event. The duration of the event is effective + // after the cron job's start time. + google.protobuf.Duration cron_job_duration = 3; + + // The cron definition of the scheduled event. See + // https://en.wikipedia.org/wiki/Cron. Cron spec specifies the local time as + // defined by the realm. + string cron_spec = 4; +} + +// Encapsulates Agones fleet spec and Agones autoscaler spec sources. +message SpecSource { + // The game server config resource. Uses the form: + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment_id}/configs/{config_id}`. + string game_server_config_name = 1; + + // The name of the Agones leet config or Agones scaling config used to derive + // the Agones fleet or Agones autoscaler spec. + string name = 2; +} + +// Details about the Agones resources. +message TargetDetails { + // Details of the target Agones fleet. + message TargetFleetDetails { + // Target Agones fleet specification. + message TargetFleet { + // The name of the Agones fleet. + string name = 1; + + // Encapsulates the source of the Agones fleet spec. + // The Agones fleet spec source. + SpecSource spec_source = 2; + } + + // Target Agones autoscaler policy reference. + message TargetFleetAutoscaler { + // The name of the Agones autoscaler. + string name = 1; + + // Encapsulates the source of the Agones fleet spec. + // Details about the Agones autoscaler spec. + SpecSource spec_source = 2; + } + + // Reference to target Agones fleet. + TargetFleet fleet = 1; + + // Reference to target Agones fleet autoscaling policy. + TargetFleetAutoscaler autoscaler = 2; + } + + // The game server cluster name. Uses the form: + // `projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}`. + string game_server_cluster_name = 1; + + // The game server deployment name. Uses the form: + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment_id}`. + string game_server_deployment_name = 2; + + // Agones fleet details for game server clusters and game server deployments. + repeated TargetFleetDetails fleet_details = 3; +} + +// Encapsulates the Target state. +message TargetState { + // Details about Agones fleets. + repeated TargetDetails details = 1; +} + +// Details of the deployed Agones fleet. +message DeployedFleetDetails { + // Agones fleet specification and details. + message DeployedFleet { + // DeployedFleetStatus has details about the Agones fleets such as how many + // are running, how many allocated, and so on. + message DeployedFleetStatus { + // The number of GameServer replicas in the READY state in this fleet. + int64 ready_replicas = 1; + + // The number of GameServer replicas in the ALLOCATED state in this fleet. + int64 allocated_replicas = 2; + + // The number of GameServer replicas in the RESERVED state in this fleet. + // Reserved instances won't be deleted on scale down, but won't cause + // an autoscaler to scale up. + int64 reserved_replicas = 3; + + // The total number of current GameServer replicas in this fleet. + int64 replicas = 4; + } + + // The name of the Agones fleet. + string fleet = 1; + + // The fleet spec retrieved from the Agones fleet. + string fleet_spec = 2; + + // The source spec that is used to create the Agones fleet. + // The GameServerConfig resource may no longer exist in the system. + SpecSource spec_source = 3; + + // The current status of the Agones fleet. + // Includes count of game servers in various states. + DeployedFleetStatus status = 5; + } + + // Details about the Agones autoscaler. + message DeployedFleetAutoscaler { + // The name of the Agones autoscaler. + string autoscaler = 1; + + // The source spec that is used to create the autoscaler. + // The GameServerConfig resource may no longer exist in the system. + SpecSource spec_source = 4; + + // The autoscaler spec retrieved from Agones. + string fleet_autoscaler_spec = 3; + } + + // Information about the Agones fleet. + DeployedFleet deployed_fleet = 1; + + // Information about the Agones autoscaler for that fleet. + DeployedFleetAutoscaler deployed_autoscaler = 2; +} diff --git a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_clusters.proto b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_clusters.proto new file mode 100644 index 00000000000..02fbc0f890b --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_clusters.proto @@ -0,0 +1,371 @@ +// 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.gaming.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/gaming/v1/common.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1;gaming"; +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1"; + +// A view for GameServerCluster objects. +enum GameServerClusterView { + // The default / unset value. + // The API will default to the BASIC view. + GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED = 0; + + // Include basic information of a GameServerCluster resource and omit + // `cluster_state`. This is the default value (for ListGameServerClusters, + // GetGameServerCluster and PreviewCreateGameServerCluster). + BASIC = 1; + + // Include everything. + FULL = 2; +} + +// Request message for GameServerClustersService.ListGameServerClusters. +message ListGameServerClustersRequest { + // Required. The parent resource name, in the following form: + // "projects/{project}/locations/{location}/realms/{realm}". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "gameservices.googleapis.com/GameServerCluster" + } + ]; + + // Optional. The maximum number of items to return. If unspecified, the server + // will pick an appropriate default. The server may return fewer items than + // requested. A caller should only rely on response's + // [next_page_token][google.cloud.gaming.v1.ListGameServerClustersResponse.next_page_token] to + // determine if there are more GameServerClusters left to be queried. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous List request, if any. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The filter to apply to list results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the ordering of results following syntax at + // https://cloud.google.com/apis/design/design_patterns#sorting_order. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. View for the returned GameServerCluster objects. When `FULL` is + // specified, the `cluster_state` field is also returned in the + // GameServerCluster object, which includes the state of the referenced + // Kubernetes cluster such as versions and provider info. The default/unset + // value is GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED, same as BASIC, which does + // not return the `cluster_state` field. + GameServerClusterView view = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for GameServerClustersService.ListGameServerClusters. +message ListGameServerClustersResponse { + // The list of game server clusters. + repeated GameServerCluster game_server_clusters = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // List of locations that could not be reached. + repeated string unreachable = 4; +} + +// Request message for GameServerClustersService.GetGameServerCluster. +message GetGameServerClusterRequest { + // Required. The name of the game server cluster to retrieve, in the following form: + // `projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gameservices.googleapis.com/GameServerCluster" + } + ]; + + // Optional. View for the returned GameServerCluster objects. When `FULL` is + // specified, the `cluster_state` field is also returned in the + // GameServerCluster object, which includes the state of the referenced + // Kubernetes cluster such as versions and provider info. The default/unset + // value is GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED, same as BASIC, which does + // not return the `cluster_state` field. + GameServerClusterView view = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for GameServerClustersService.CreateGameServerCluster. +message CreateGameServerClusterRequest { + // Required. The parent resource name, in the following form: + // `projects/{project}/locations/{location}/realms/{realm-id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "gameservices.googleapis.com/GameServerCluster" + } + ]; + + // Required. The ID of the game server cluster resource to be created. + string game_server_cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The game server cluster resource to be created. + GameServerCluster game_server_cluster = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for GameServerClustersService.PreviewCreateGameServerCluster. +message PreviewCreateGameServerClusterRequest { + // Required. The parent resource name, in the following form: + // `projects/{project}/locations/{location}/realms/{realm}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "gameservices.googleapis.com/GameServerCluster" + } + ]; + + // Required. The ID of the game server cluster resource to be created. + string game_server_cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The game server cluster resource to be created. + GameServerCluster game_server_cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The target timestamp to compute the preview. + google.protobuf.Timestamp preview_time = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This field is deprecated, preview will always return + // KubernetesClusterState. + GameServerClusterView view = 6 [ + deprecated = true, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Response message for +// GameServerClustersService.PreviewCreateGameServerCluster. +message PreviewCreateGameServerClusterResponse { + // The ETag of the game server cluster. + string etag = 2; + + // The target state. + TargetState target_state = 3; + + // Output only. The state of the Kubernetes cluster in preview, this will be available if + // 'view' is set to `FULL` in the relevant List/Get/Preview request. + KubernetesClusterState cluster_state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for GameServerClustersService.DeleteGameServerCluster. +message DeleteGameServerClusterRequest { + // Required. The name of the game server cluster to delete, in the following form: + // `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gameservices.googleapis.com/GameServerCluster" + } + ]; +} + +// Request message for GameServerClustersService.PreviewDeleteGameServerCluster. +message PreviewDeleteGameServerClusterRequest { + // Required. The name of the game server cluster to delete, in the following form: + // `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gameservices.googleapis.com/GameServerCluster" + } + ]; + + // Optional. The target timestamp to compute the preview. + google.protobuf.Timestamp preview_time = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// GameServerClustersService.PreviewDeleteGameServerCluster. +message PreviewDeleteGameServerClusterResponse { + // The ETag of the game server cluster. + string etag = 2; + + // The target state. + TargetState target_state = 3; +} + +// Request message for GameServerClustersService.UpdateGameServerCluster. +message UpdateGameServerClusterRequest { + // Required. The game server cluster to be updated. + // Only fields specified in update_mask are updated. + GameServerCluster game_server_cluster = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask of fields to update. At least one path must be supplied in + // this field. For the `FieldMask` definition, see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for GameServerClustersService.UpdateGameServerCluster. +message PreviewUpdateGameServerClusterRequest { + // Required. The game server cluster to be updated. + // Only fields specified in update_mask are updated. + GameServerCluster game_server_cluster = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask of fields to update. At least one path must be supplied in + // this field. For the `FieldMask` definition, see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The target timestamp to compute the preview. + google.protobuf.Timestamp preview_time = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for GameServerClustersService.PreviewUpdateGameServerCluster +message PreviewUpdateGameServerClusterResponse { + // The ETag of the game server cluster. + string etag = 2; + + // The target state. + TargetState target_state = 3; +} + +// The game server cluster connection information. +message GameServerClusterConnectionInfo { + // The location of the Kubernetes cluster. + oneof cluster_reference { + // Reference to the GKE cluster where the game servers are installed. + GkeClusterReference gke_cluster_reference = 7; + } + + // Namespace designated on the game server cluster where the Agones game + // server instances will be created. Existence of the namespace will be + // validated during creation. + string namespace = 5; +} + +// A reference to a GKE cluster. +message GkeClusterReference { + // The full or partial name of a GKE cluster, using one of the following + // forms: + // * `projects/{project}/locations/{location}/clusters/{cluster}` + // * `locations/{location}/clusters/{cluster}` + // * `{cluster}` + // If project and location are not specified, the project and location of the + // GameServerCluster resource are used to generate the full name of the + // GKE cluster. + string cluster = 1; +} + +// A game server cluster resource. +message GameServerCluster { + option (google.api.resource) = { + type: "gameservices.googleapis.com/GameServerCluster" + pattern: "projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}" + }; + + // Required. The resource name of the game server cluster, in the following form: + // `projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}`. + // For example, + // `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels associated with this game server cluster. Each label is a + // key-value pair. + map labels = 4; + + // The game server cluster connection information. This information is used to + // manage game server clusters. + GameServerClusterConnectionInfo connection_info = 5; + + // ETag of the resource. + string etag = 6; + + // Human readable description of the cluster. + string description = 7; + + // Output only. The state of the Kubernetes cluster, this will be available if + // 'view' is set to `FULL` in the relevant List/Get/Preview request. + KubernetesClusterState cluster_state = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The state of the Kubernetes cluster. +message KubernetesClusterState { + // The state of the installed versions of Agones/Kubernetes. See also + // https://cloud.google.com/game-servers/docs/versions-and-upgrades. + enum InstallationState { + // The default value. This value is used if the state is omitted. + INSTALLATION_STATE_UNSPECIFIED = 0; + + // The combination of Agones and Kubernetes versions is supported by Google + // Cloud Game Servers. + AGONES_KUBERNETES_VERSION_SUPPORTED = 1; + + // The installed version of Agones is not supported by Google Cloud Game + // Servers. + AGONES_VERSION_UNSUPPORTED = 2; + + // The installed version of Agones is supported by Google Cloud Game + // Servers, but the installed version of Kubernetes is not recommended or + // supported by the version of Agones. + AGONES_KUBERNETES_VERSION_UNSUPPORTED = 3; + + // The installed version of Agones is not recognized because the Agones + // controller's image name does not have a version string reported as + // {major}.{minor}(.{patch}). + AGONES_VERSION_UNRECOGNIZED = 4; + + // The server version of Kubernetes cluster is not recognized because the + // API server didn't return parsable version info on path/version. + KUBERNETES_VERSION_UNRECOGNIZED = 5; + + // Failed to read or verify the version of Agones or Kubernetes. See + // version_installed_error_message for details. + VERSION_VERIFICATION_FAILED = 6; + + // Agones is not installed. + AGONES_NOT_INSTALLED = 7; + } + + // Output only. The version of Agones currently installed in the registered Kubernetes + // cluster. + string agones_version_installed = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The version of Kubernetes that is currently used in the registered + // Kubernetes cluster (as detected by the Cloud Game Servers service). + string kubernetes_version_installed = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state for the installed versions of Agones/Kubernetes. + InstallationState installation_state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The detailed error message for the installed versions of Agones/Kubernetes. + string version_installed_error_message = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The cloud provider type reported by the first node's providerID in the list + // of nodes on the Kubernetes endpoint. On Kubernetes platforms that support + // zero-node clusters (like GKE-on-GCP), the provider type will be empty. + string provider = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The version of Agones that is targeted to be installed in the cluster. + string agones_version_targeted = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_clusters_service.proto b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_clusters_service.proto new file mode 100644 index 00000000000..db7a0f28f08 --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_clusters_service.proto @@ -0,0 +1,111 @@ +// 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.gaming.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/gaming/v1/game_server_clusters.proto"; +import "google/longrunning/operations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1;gaming"; +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1"; + +// The game server cluster maps to Kubernetes clusters running Agones and is +// used to manage fleets within clusters. +service GameServerClustersService { + option (google.api.default_host) = "gameservices.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists game server clusters in a given project and location. + rpc ListGameServerClusters(ListGameServerClustersRequest) returns (ListGameServerClustersResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/realms/*}/gameServerClusters" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single game server cluster. + rpc GetGameServerCluster(GetGameServerClusterRequest) returns (GameServerCluster) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/realms/*/gameServerClusters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new game server cluster in a given project and location. + rpc CreateGameServerCluster(CreateGameServerClusterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/realms/*}/gameServerClusters" + body: "game_server_cluster" + }; + option (google.api.method_signature) = "parent,game_server_cluster,game_server_cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "GameServerCluster" + metadata_type: "OperationMetadata" + }; + } + + // Previews creation of a new game server cluster in a given project and + // location. + rpc PreviewCreateGameServerCluster(PreviewCreateGameServerClusterRequest) returns (PreviewCreateGameServerClusterResponse) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/realms/*}/gameServerClusters:previewCreate" + body: "game_server_cluster" + }; + } + + // Deletes a single game server cluster. + rpc DeleteGameServerCluster(DeleteGameServerClusterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/realms/*/gameServerClusters/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Previews deletion of a single game server cluster. + rpc PreviewDeleteGameServerCluster(PreviewDeleteGameServerClusterRequest) returns (PreviewDeleteGameServerClusterResponse) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/realms/*/gameServerClusters/*}:previewDelete" + }; + } + + // Patches a single game server cluster. + rpc UpdateGameServerCluster(UpdateGameServerClusterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{game_server_cluster.name=projects/*/locations/*/realms/*/gameServerClusters/*}" + body: "game_server_cluster" + }; + option (google.api.method_signature) = "game_server_cluster,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "GameServerCluster" + metadata_type: "OperationMetadata" + }; + } + + // Previews updating a GameServerCluster. + rpc PreviewUpdateGameServerCluster(PreviewUpdateGameServerClusterRequest) returns (PreviewUpdateGameServerClusterResponse) { + option (google.api.http) = { + patch: "/v1/{game_server_cluster.name=projects/*/locations/*/realms/*/gameServerClusters/*}:previewUpdate" + body: "game_server_cluster" + }; + } +} diff --git a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_configs.proto b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_configs.proto new file mode 100644 index 00000000000..c9848654e85 --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_configs.proto @@ -0,0 +1,172 @@ +// 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.gaming.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/gaming/v1/common.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1;gaming"; +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1"; + +// Request message for GameServerConfigsService.ListGameServerConfigs. +message ListGameServerConfigsRequest { + // Required. The parent resource name, in the following form: + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "gameservices.googleapis.com/GameServerConfig" + } + ]; + + // Optional. The maximum number of items to return. If unspecified, server + // will pick an appropriate default. Server may return fewer items than + // requested. A caller should only rely on response's + // [next_page_token][google.cloud.gaming.v1.ListGameServerConfigsResponse.next_page_token] to + // determine if there are more GameServerConfigs left to be queried. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous list request, if any. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The filter to apply to list results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the ordering of results following syntax at + // https://cloud.google.com/apis/design/design_patterns#sorting_order. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for GameServerConfigsService.ListGameServerConfigs. +message ListGameServerConfigsResponse { + // The list of game server configs. + repeated GameServerConfig game_server_configs = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // List of locations that could not be reached. + repeated string unreachable = 4; +} + +// Request message for GameServerConfigsService.GetGameServerConfig. +message GetGameServerConfigRequest { + // Required. The name of the game server config to retrieve, in the following form: + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gameservices.googleapis.com/GameServerConfig" + } + ]; +} + +// Request message for GameServerConfigsService.CreateGameServerConfig. +message CreateGameServerConfigRequest { + // Required. The parent resource name, in the following form: + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "gameservices.googleapis.com/GameServerConfig" + } + ]; + + // Required. The ID of the game server config resource to be created. + string config_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The game server config resource to be created. + GameServerConfig game_server_config = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for GameServerConfigsService.DeleteGameServerConfig. +message DeleteGameServerConfigRequest { + // Required. The name of the game server config to delete, in the following form: + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gameservices.googleapis.com/GameServerConfig" + } + ]; +} + +// Autoscaling config for an Agones fleet. +message ScalingConfig { + // Required. The name of the Scaling Config + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Agones fleet autoscaler spec. Example spec: + // https://agones.dev/site/docs/reference/fleetautoscaler/ + string fleet_autoscaler_spec = 2 [(google.api.field_behavior) = REQUIRED]; + + // Labels used to identify the game server clusters to which this Agones + // scaling config applies. A game server cluster is subject to this Agones + // scaling config if its labels match any of the selector entries. + repeated LabelSelector selectors = 4; + + // The schedules to which this Scaling Config applies. + repeated Schedule schedules = 5; +} + +// Fleet configs for Agones. +message FleetConfig { + // Agones fleet spec. Example spec: + // `https://agones.dev/site/docs/reference/fleet/`. + string fleet_spec = 1; + + // The name of the FleetConfig. + string name = 2; +} + +// A game server config resource. +message GameServerConfig { + option (google.api.resource) = { + type: "gameservices.googleapis.com/GameServerConfig" + pattern: "projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}" + }; + + // The resource name of the game server config, in the following form: + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. + // For example, + // `projects/my-project/locations/global/gameServerDeployments/my-game/configs/my-config`. + string name = 1; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels associated with this game server config. Each label is a + // key-value pair. + map labels = 4; + + // FleetConfig contains a list of Agones fleet specs. Only one FleetConfig + // is allowed. + repeated FleetConfig fleet_configs = 5; + + // The autoscaling settings. + repeated ScalingConfig scaling_configs = 6; + + // The description of the game server config. + string description = 7; +} diff --git a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_configs_service.proto b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_configs_service.proto new file mode 100644 index 00000000000..c151d6032fa --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_configs_service.proto @@ -0,0 +1,77 @@ +// 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.gaming.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/gaming/v1/game_server_configs.proto"; +import "google/longrunning/operations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1;gaming"; +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1"; + +// The game server config configures the game servers in an Agones fleet. +service GameServerConfigsService { + option (google.api.default_host) = "gameservices.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists game server configs in a given project, location, and game server + // deployment. + rpc ListGameServerConfigs(ListGameServerConfigsRequest) returns (ListGameServerConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/gameServerDeployments/*}/configs" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single game server config. + rpc GetGameServerConfig(GetGameServerConfigRequest) returns (GameServerConfig) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/gameServerDeployments/*/configs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new game server config in a given project, location, and game + // server deployment. Game server configs are immutable, and are not applied + // until referenced in the game server deployment rollout resource. + rpc CreateGameServerConfig(CreateGameServerConfigRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/gameServerDeployments/*}/configs" + body: "game_server_config" + }; + option (google.api.method_signature) = "parent,game_server_config"; + option (google.longrunning.operation_info) = { + response_type: "GameServerConfig" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single game server config. The deletion will fail if the game + // server config is referenced in a game server deployment rollout. + rpc DeleteGameServerConfig(DeleteGameServerConfigRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/gameServerDeployments/*/configs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } +} diff --git a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_deployments.proto b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_deployments.proto new file mode 100644 index 00000000000..3c01717dd9b --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_deployments.proto @@ -0,0 +1,286 @@ +// 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.gaming.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/gaming/v1/common.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1;gaming"; +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1"; + +// Request message for GameServerDeploymentsService.ListGameServerDeployments. +message ListGameServerDeploymentsRequest { + // Required. The parent resource name, in the following form: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "gameservices.googleapis.com/GameServerDeployment" + } + ]; + + // Optional. The maximum number of items to return. If unspecified, the server + // will pick an appropriate default. The server may return fewer items than + // requested. A caller should only rely on response's + // [next_page_token][google.cloud.gaming.v1.ListGameServerDeploymentsResponse.next_page_token] to + // determine if there are more GameServerDeployments left to be queried. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous List request, + // if any. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The filter to apply to list results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the ordering of results following syntax at + // https://cloud.google.com/apis/design/design_patterns#sorting_order. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for GameServerDeploymentsService.ListGameServerDeployments. +message ListGameServerDeploymentsResponse { + // The list of game server deployments. + repeated GameServerDeployment game_server_deployments = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // List of locations that could not be reached. + repeated string unreachable = 4; +} + +// Request message for GameServerDeploymentsService.GetGameServerDeployment. +message GetGameServerDeploymentRequest { + // Required. The name of the game server delpoyment to retrieve, in the following form: + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gameservices.googleapis.com/GameServerDeployment" + } + ]; +} + +// Request message for +// GameServerDeploymentsService.GetGameServerDeploymentRollout. +message GetGameServerDeploymentRolloutRequest { + // Required. The name of the game server delpoyment to retrieve, in the following form: + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gameservices.googleapis.com/GameServerDeployment" + } + ]; +} + +// Request message for GameServerDeploymentsService.CreateGameServerDeployment. +message CreateGameServerDeploymentRequest { + // Required. The parent resource name, in the following form: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "gameservices.googleapis.com/GameServerDeployment" + } + ]; + + // Required. The ID of the game server delpoyment resource to be created. + string deployment_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The game server delpoyment resource to be created. + GameServerDeployment game_server_deployment = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for GameServerDeploymentsService.DeleteGameServerDeployment. +message DeleteGameServerDeploymentRequest { + // Required. The name of the game server delpoyment to delete, in the following form: + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gameservices.googleapis.com/GameServerDeployment" + } + ]; +} + +// Request message for GameServerDeploymentsService.UpdateGameServerDeployment. +// Only allows updates for labels. +message UpdateGameServerDeploymentRequest { + // Required. The game server delpoyment to be updated. + // Only fields specified in update_mask are updated. + GameServerDeployment game_server_deployment = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask of fields to update. At least one path must be supplied in + // this field. For the `FieldMask` definition, see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// GameServerDeploymentsService.UpdateGameServerRolloutDeployment. +message UpdateGameServerDeploymentRolloutRequest { + // Required. The game server delpoyment rollout to be updated. + // Only fields specified in update_mask are updated. + GameServerDeploymentRollout rollout = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask of fields to update. At least one path must be supplied in + // this field. For the `FieldMask` definition, see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for GameServerDeploymentsService.FetchDeploymentState. +message FetchDeploymentStateRequest { + // Required. The name of the game server delpoyment, in the following form: + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for GameServerDeploymentsService.FetchDeploymentState. +message FetchDeploymentStateResponse { + // The game server cluster changes made by the game server deployment. + message DeployedClusterState { + // The name of the cluster. + string cluster = 1; + + // The details about the Agones fleets and autoscalers created in the + // game server cluster. + repeated DeployedFleetDetails fleet_details = 2; + } + + // The state of the game server deployment in each game server cluster. + repeated DeployedClusterState cluster_state = 1; + + // List of locations that could not be reached. + repeated string unavailable = 2; +} + +// A game server deployment resource. +message GameServerDeployment { + option (google.api.resource) = { + type: "gameservices.googleapis.com/GameServerDeployment" + pattern: "projects/{project}/locations/{location}/gameServerDeployments/{deployment}" + }; + + // The resource name of the game server deployment, in the following form: + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + // For example, + // `projects/my-project/locations/global/gameServerDeployments/my-deployment`. + string name = 1; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels associated with this game server deployment. Each label is a + // key-value pair. + map labels = 4; + + // ETag of the resource. + string etag = 7; + + // Human readable description of the game server delpoyment. + string description = 8; +} + +// A game server config override. +message GameServerConfigOverride { + // Selector chooses the game server config targets. + oneof selector { + // Selector for choosing applicable realms. + RealmSelector realms_selector = 1; + } + + // Selects the game server config and how it should be applied. + oneof change { + // The game server config for this override. + string config_version = 100; + } +} + +// The game server deployment rollout which represents the desired rollout +// state. +message GameServerDeploymentRollout { + option (google.api.resource) = { + type: "gameservices.googleapis.com/GameServerDeploymentRollout" + pattern: "projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout" + }; + + // The resource name of the game server deployment rollout, in the following + // form: + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. + // For example, + // `projects/my-project/locations/global/gameServerDeployments/my-deployment/rollout`. + string name = 1; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The default game server config is applied to all realms unless overridden + // in the rollout. For example, + // `projects/my-project/locations/global/gameServerDeployments/my-game/configs/my-config`. + string default_game_server_config = 4; + + // Contains the game server config rollout overrides. Overrides are processed + // in the order they are listed. Once a match is found for a realm, the rest + // of the list is not processed. + repeated GameServerConfigOverride game_server_config_overrides = 5; + + // ETag of the resource. + string etag = 6; +} + +// Request message for PreviewGameServerDeploymentRollout. +message PreviewGameServerDeploymentRolloutRequest { + // Required. The game server deployment rollout to be updated. + // Only fields specified in update_mask are updated. + GameServerDeploymentRollout rollout = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Mask of fields to update. At least one path must be supplied in + // this field. For the `FieldMask` definition, see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The target timestamp to compute the preview. Defaults to the immediately + // after the proposed rollout completes. + google.protobuf.Timestamp preview_time = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for PreviewGameServerDeploymentRollout. +// This has details about the Agones fleet and autoscaler to be actuated. +message PreviewGameServerDeploymentRolloutResponse { + // Locations that could not be reached on this request. + repeated string unavailable = 2; + + // ETag of the game server deployment. + string etag = 3; + + // The target state. + TargetState target_state = 4; +} diff --git a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_deployments_service.proto b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_deployments_service.proto new file mode 100644 index 00000000000..a82d259e83f --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_deployments_service.proto @@ -0,0 +1,132 @@ +// 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.gaming.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/gaming/v1/game_server_deployments.proto"; +import "google/longrunning/operations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1;gaming"; +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1"; + +// The game server deployment is used to control the deployment of Agones +// fleets. +service GameServerDeploymentsService { + option (google.api.default_host) = "gameservices.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists game server deployments in a given project and location. + rpc ListGameServerDeployments(ListGameServerDeploymentsRequest) returns (ListGameServerDeploymentsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/gameServerDeployments" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single game server deployment. + rpc GetGameServerDeployment(GetGameServerDeploymentRequest) returns (GameServerDeployment) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/gameServerDeployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new game server deployment in a given project and location. + rpc CreateGameServerDeployment(CreateGameServerDeploymentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/gameServerDeployments" + body: "game_server_deployment" + }; + option (google.api.method_signature) = "parent,game_server_deployment"; + option (google.longrunning.operation_info) = { + response_type: "GameServerDeployment" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single game server deployment. + rpc DeleteGameServerDeployment(DeleteGameServerDeploymentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/gameServerDeployments/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Patches a game server deployment. + rpc UpdateGameServerDeployment(UpdateGameServerDeploymentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{game_server_deployment.name=projects/*/locations/*/gameServerDeployments/*}" + body: "game_server_deployment" + }; + option (google.api.method_signature) = "game_server_deployment,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "GameServerDeployment" + metadata_type: "OperationMetadata" + }; + } + + // Gets details a single game server deployment rollout. + rpc GetGameServerDeploymentRollout(GetGameServerDeploymentRolloutRequest) returns (GameServerDeploymentRollout) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/gameServerDeployments/*}/rollout" + }; + option (google.api.method_signature) = "name"; + } + + // Patches a single game server deployment rollout. + // The method will not return an error if the update does not affect any + // existing realms. For example - if the default_game_server_config is changed + // but all existing realms use the override, that is valid. Similarly, if a + // non existing realm is explicitly called out in game_server_config_overrides + // field, that will also not result in an error. + rpc UpdateGameServerDeploymentRollout(UpdateGameServerDeploymentRolloutRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{rollout.name=projects/*/locations/*/gameServerDeployments/*}/rollout" + body: "rollout" + }; + option (google.api.method_signature) = "rollout,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "GameServerDeployment" + metadata_type: "OperationMetadata" + }; + } + + // Previews the game server deployment rollout. This API does not mutate the + // rollout resource. + rpc PreviewGameServerDeploymentRollout(PreviewGameServerDeploymentRolloutRequest) returns (PreviewGameServerDeploymentRolloutResponse) { + option (google.api.http) = { + patch: "/v1/{rollout.name=projects/*/locations/*/gameServerDeployments/*}/rollout:preview" + body: "rollout" + }; + } + + // Retrieves information about the current state of the game server + // deployment. Gathers all the Agones fleets and Agones autoscalers, + // including fleets running an older version of the game server deployment. + rpc FetchDeploymentState(FetchDeploymentStateRequest) returns (FetchDeploymentStateResponse) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/gameServerDeployments/*}:fetchDeploymentState" + body: "*" + }; + } +} diff --git a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/realms.proto b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/realms.proto new file mode 100644 index 00000000000..007071a9063 --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/realms.proto @@ -0,0 +1,181 @@ +// 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.gaming.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/gaming/v1/common.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1;gaming"; +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1"; + +// Request message for RealmsService.ListRealms. +message ListRealmsRequest { + // Required. The parent resource name, in the following form: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "gameservices.googleapis.com/Realm" + } + ]; + + // Optional. The maximum number of items to return. If unspecified, server + // will pick an appropriate default. Server may return fewer items than + // requested. A caller should only rely on response's + // [next_page_token][google.cloud.gaming.v1.ListRealmsResponse.next_page_token] to + // determine if there are more realms left to be queried. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous List request, + // if any. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The filter to apply to list results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the ordering of results following syntax at + // https://cloud.google.com/apis/design/design_patterns#sorting_order. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for RealmsService.ListRealms. +message ListRealmsResponse { + // The list of realms. + repeated Realm realms = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // List of locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for RealmsService.GetRealm. +message GetRealmRequest { + // Required. The name of the realm to retrieve, in the following form: + // `projects/{project}/locations/{location}/realms/{realm}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gameservices.googleapis.com/Realm" + } + ]; +} + +// Request message for RealmsService.CreateRealm. +message CreateRealmRequest { + // Required. The parent resource name, in the following form: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "gameservices.googleapis.com/Realm" + } + ]; + + // Required. The ID of the realm resource to be created. + string realm_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The realm resource to be created. + Realm realm = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for RealmsService.DeleteRealm. +message DeleteRealmRequest { + // Required. The name of the realm to delete, in the following form: + // `projects/{project}/locations/{location}/realms/{realm}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gameservices.googleapis.com/Realm" + } + ]; +} + +// Request message for RealmsService.UpdateRealm. +message UpdateRealmRequest { + // Required. The realm to be updated. + // Only fields specified in update_mask are updated. + Realm realm = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. For the `FieldMask` + // definition, see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for RealmsService.PreviewRealmUpdate. +message PreviewRealmUpdateRequest { + // Required. The realm to be updated. + // Only fields specified in update_mask are updated. + Realm realm = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. For the `FieldMask` + // definition, see + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The target timestamp to compute the preview. + google.protobuf.Timestamp preview_time = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for RealmsService.PreviewRealmUpdate. +message PreviewRealmUpdateResponse { + // ETag of the realm. + string etag = 2; + + // The target state. + TargetState target_state = 3; +} + +// A realm resource. +message Realm { + option (google.api.resource) = { + type: "gameservices.googleapis.com/Realm" + pattern: "projects/{project}/locations/{location}/realms/{realm}" + }; + + // The resource name of the realm, in the following form: + // `projects/{project}/locations/{location}/realms/{realm}`. For + // example, `projects/my-project/locations/{location}/realms/my-realm`. + string name = 1; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels associated with this realm. Each label is a key-value pair. + map labels = 4; + + // Required. Time zone where all policies targeting this realm are evaluated. The value + // of this field must be from the IANA time zone database: + // https://www.iana.org/time-zones. + string time_zone = 6 [(google.api.field_behavior) = REQUIRED]; + + // ETag of the resource. + string etag = 7; + + // Human readable description of the realm. + string description = 8; +} diff --git a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/realms_service.proto b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/realms_service.proto new file mode 100644 index 00000000000..018850d71d5 --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/realms_service.proto @@ -0,0 +1,95 @@ +// 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.gaming.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/gaming/v1/realms.proto"; +import "google/longrunning/operations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1;gaming"; +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1"; + +// A realm is a grouping of game server clusters that are considered +// interchangeable. +service RealmsService { + option (google.api.default_host) = "gameservices.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists realms in a given project and location. + rpc ListRealms(ListRealmsRequest) returns (ListRealmsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/realms" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single realm. + rpc GetRealm(GetRealmRequest) returns (Realm) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/realms/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new realm in a given project and location. + rpc CreateRealm(CreateRealmRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/realms" + body: "realm" + }; + option (google.api.method_signature) = "parent,realm,realm_id"; + option (google.longrunning.operation_info) = { + response_type: "Realm" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single realm. + rpc DeleteRealm(DeleteRealmRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/realms/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Patches a single realm. + rpc UpdateRealm(UpdateRealmRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{realm.name=projects/*/locations/*/realms/*}" + body: "realm" + }; + option (google.api.method_signature) = "realm,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Realm" + metadata_type: "OperationMetadata" + }; + } + + // Previews patches to a single realm. + rpc PreviewRealmUpdate(PreviewRealmUpdateRequest) returns (PreviewRealmUpdateResponse) { + option (google.api.http) = { + patch: "/v1/{realm.name=projects/*/locations/*/realms/*}:previewUpdate" + body: "realm" + }; + } +} diff --git a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto new file mode 100644 index 00000000000..4059404fcc2 --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto @@ -0,0 +1,242 @@ +// 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.gaming.v1beta; + +import "google/api/field_behavior.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming"; + +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1beta"; + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of Locations that could not be reached. + repeated string unreachable = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Operation status for Game Services API operations. Operation status is in + // the form of key-value pairs where keys are resource IDs and the values show + // the status of the operation. In case of failures, the value includes an + // error code and error message. + map operation_status = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +message OperationStatus { + enum ErrorCode { + ERROR_CODE_UNSPECIFIED = 0; + + INTERNAL_ERROR = 1; + + PERMISSION_DENIED = 2; + + CLUSTER_CONNECTION = 3; + } + + // Output only. Whether the operation is done or still in progress. + bool done = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The error code in case of failures. + ErrorCode error_code = 2; + + // The human-readable error message. + string error_message = 3; +} + +// The label selector, used to group labels on the resources. +message LabelSelector { + // Resource labels for this selector. + map labels = 1; +} + +// The realm selector, used to match realm resources. +message RealmSelector { + // List of realms to match. + repeated string realms = 1; +} + +// The schedule of a recurring or one time event. The event's time span is +// specified by start_time and end_time. If the scheduled event's timespan is +// larger than the cron_spec + cron_job_duration, the event will be recurring. +// If only cron_spec + cron_job_duration are specified, the event is effective +// starting at the local time specified by cron_spec, and is recurring. +// +// ``` +// start_time|-------[cron job]-------[cron job]-------[cron job]---|end_time +// cron job: cron spec start time + duration +// ``` +message Schedule { + // The start time of the event. + google.protobuf.Timestamp start_time = 1; + + // The end time of the event. + google.protobuf.Timestamp end_time = 2; + + // The duration for the cron job event. The duration of the event is effective + // after the cron job's start time. + google.protobuf.Duration cron_job_duration = 3; + + // The cron definition of the scheduled event. See + // https://en.wikipedia.org/wiki/Cron. Cron spec specifies the local time as + // defined by the realm. + string cron_spec = 4; +} + +// Encapsulates Agones fleet spec and Agones autoscaler spec sources. +message SpecSource { + // The game server config resource. Uses the form: + // + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment_id}/configs/{config_id}`. + string game_server_config_name = 1; + + // The name of the Agones leet config or Agones scaling config used to derive + // the Agones fleet or Agones autoscaler spec. + string name = 2; +} + +// Details about the Agones resources. +message TargetDetails { + // Details of the target Agones fleet. + message TargetFleetDetails { + // Target Agones fleet specification. + message TargetFleet { + // The name of the Agones fleet. + string name = 1; + + // Encapsulates the source of the Agones fleet spec. + // The Agones fleet spec source. + SpecSource spec_source = 2; + } + + // Target Agones autoscaler policy reference. + message TargetFleetAutoscaler { + // The name of the Agones autoscaler. + string name = 1; + + // Encapsulates the source of the Agones fleet spec. + // Details about the Agones autoscaler spec. + SpecSource spec_source = 2; + } + + // Reference to target Agones fleet. + TargetFleet fleet = 1; + + // Reference to target Agones fleet autoscaling policy. + TargetFleetAutoscaler autoscaler = 2; + } + + // The game server cluster name. Uses the form: + // + // `projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}`. + string game_server_cluster_name = 1; + + // The game server deployment name. Uses the form: + // + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment_id}`. + string game_server_deployment_name = 2; + + // Agones fleet details for game server clusters and game server deployments. + repeated TargetFleetDetails fleet_details = 3; +} + +// Encapsulates the Target state. +message TargetState { + // Details about Agones fleets. + repeated TargetDetails details = 1; +} + +// Details of the deployed Agones fleet. +message DeployedFleetDetails { + // Agones fleet specification and details. + message DeployedFleet { + // DeployedFleetStatus has details about the Agones fleets such as how many + // are running, how many allocated, and so on. + message DeployedFleetStatus { + // The number of GameServer replicas in the READY state in this fleet. + int64 ready_replicas = 1; + + // The number of GameServer replicas in the ALLOCATED state in this fleet. + int64 allocated_replicas = 2; + + // The number of GameServer replicas in the RESERVED state in this fleet. + // Reserved instances won't be deleted on scale down, but won't cause + // an autoscaler to scale up. + int64 reserved_replicas = 3; + + // The total number of current GameServer replicas in this fleet. + int64 replicas = 4; + } + + // The name of the Agones fleet. + string fleet = 1; + + // The fleet spec retrieved from the Agones fleet. + string fleet_spec = 2; + + // The source spec that is used to create the Agones fleet. + // The GameServerConfig resource may no longer exist in the system. + SpecSource spec_source = 3; + + // The current status of the Agones fleet. + // Includes count of game servers in various states. + DeployedFleetStatus status = 5; + } + + // Details about the Agones autoscaler. + message DeployedFleetAutoscaler { + // The name of the Agones autoscaler. + string autoscaler = 1; + + // The source spec that is used to create the autoscaler. + // The GameServerConfig resource may no longer exist in the system. + SpecSource spec_source = 4; + + // The autoscaler spec retrieved from Agones. + string fleet_autoscaler_spec = 3; + } + + // Information about the Agones fleet. + DeployedFleet deployed_fleet = 1; + + // Information about the Agones autoscaler for that fleet. + DeployedFleetAutoscaler deployed_autoscaler = 2; +} diff --git a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_clusters.proto b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_clusters.proto new file mode 100644 index 00000000000..0a91a635d80 --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_clusters.proto @@ -0,0 +1,287 @@ +// 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.gaming.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/gaming/v1beta/common.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming"; + +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1beta"; +option php_namespace = "Google\\Cloud\\Gaming\\V1beta"; + +// Request message for GameServerClustersService.ListGameServerClusters. +message ListGameServerClustersRequest { + // Required. The parent resource name. Uses the form: + // "projects/{project}/locations/{location}/realms/{realm}". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "gameservices.googleapis.com/GameServerCluster" + } + ]; + + // Optional. The maximum number of items to return. If unspecified, the + // server will pick an appropriate default. The server may return fewer items + // than requested. A caller should only rely on response's + // [next_page_token][google.cloud.gaming.v1beta.ListGameServerClustersResponse.next_page_token] + // to determine if there are more GameServerClusters left to be queried. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous List request, + // if any. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The filter to apply to list results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the ordering of results following syntax at + // https://cloud.google.com/apis/design/design_patterns#sorting_order. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for GameServerClustersService.ListGameServerClusters. +message ListGameServerClustersResponse { + // The list of game server clusters. + repeated GameServerCluster game_server_clusters = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // List of locations that could not be reached. + repeated string unreachable = 4; +} + +// Request message for GameServerClustersService.GetGameServerCluster. +message GetGameServerClusterRequest { + // Required. The name of the game server cluster to retrieve. Uses the form: + // + // `projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gameservices.googleapis.com/GameServerCluster" + } + ]; +} + +// Request message for GameServerClustersService.CreateGameServerCluster. +message CreateGameServerClusterRequest { + // Required. The parent resource name. Uses the form: + // `projects/{project}/locations/{location}/realms/{realm-id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "gameservices.googleapis.com/GameServerCluster" + } + ]; + + // Required. The ID of the game server cluster resource to be created. + string game_server_cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The game server cluster resource to be created. + GameServerCluster game_server_cluster = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for GameServerClustersService.PreviewCreateGameServerCluster. +message PreviewCreateGameServerClusterRequest { + // Required. The parent resource name. Uses the form: + // `projects/{project}/locations/{location}/realms/{realm}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "gameservices.googleapis.com/GameServerCluster" + } + ]; + + // Required. The ID of the game server cluster resource to be created. + string game_server_cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The game server cluster resource to be created. + GameServerCluster game_server_cluster = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The target timestamp to compute the preview. + google.protobuf.Timestamp preview_time = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// GameServerClustersService.PreviewCreateGameServerCluster. +message PreviewCreateGameServerClusterResponse { + // The ETag of the game server cluster. + string etag = 2; + + // The target state. + TargetState target_state = 3; +} + +// Request message for GameServerClustersService.DeleteGameServerCluster. +message DeleteGameServerClusterRequest { + // Required. The name of the game server cluster to delete. Uses the form: + // `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gameservices.googleapis.com/GameServerCluster" + } + ]; +} + +// Request message for GameServerClustersService.PreviewDeleteGameServerCluster. +message PreviewDeleteGameServerClusterRequest { + // Required. The name of the game server cluster to delete. Uses the form: + // `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gameservices.googleapis.com/GameServerCluster" + } + ]; + + // Optional. The target timestamp to compute the preview. + google.protobuf.Timestamp preview_time = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for +// GameServerClustersService.PreviewDeleteGameServerCluster. +message PreviewDeleteGameServerClusterResponse { + // The ETag of the game server cluster. + string etag = 2; + + // The target state. + TargetState target_state = 3; +} + +// Request message for GameServerClustersService.UpdateGameServerCluster. +message UpdateGameServerClusterRequest { + // Required. The game server cluster to be updated. + // Only fields specified in update_mask are updated. + GameServerCluster game_server_cluster = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask of fields to update. At least one path must be supplied in + // this field. For the `FieldMask` definition, see + // + // https: + // //developers.google.com/protocol-buffers + // // /docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for GameServerClustersService.UpdateGameServerCluster. +message PreviewUpdateGameServerClusterRequest { + // Required. The game server cluster to be updated. + // Only fields specified in update_mask are updated. + GameServerCluster game_server_cluster = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask of fields to update. At least one path must be supplied in + // this field. For the `FieldMask` definition, see + // + // https: + // //developers.google.com/protocol-buffers + // // /docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The target timestamp to compute the preview. + google.protobuf.Timestamp preview_time = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for GameServerClustersService.PreviewUpdateGameServerCluster +message PreviewUpdateGameServerClusterResponse { + // The ETag of the game server cluster. + string etag = 2; + + // The target state. + TargetState target_state = 3; +} + +// The game server cluster connection information. +message GameServerClusterConnectionInfo { + // The location of the Kubernetes cluster. + oneof cluster_reference { + // Reference to the GKE cluster where the game servers are installed. + GkeClusterReference gke_cluster_reference = 7; + } + + // Namespace designated on the game server cluster where the Agones game + // server instances will be created. Existence of the namespace will be + // validated during creation. + string namespace = 5; +} + +// A reference to a GKE cluster. +message GkeClusterReference { + // The full or partial name of a GKE cluster, using one of the following + // forms: + // * `projects/{project}/locations/{location}/clusters/{cluster}` + // * `locations/{location}/clusters/{cluster}` + // * `{cluster}` + // If project and location are not specified, the project and location of the + // GameServerCluster resource are used to generate the full name of the + // GKE cluster. + string cluster = 1; +} + +// A game server cluster resource. +message GameServerCluster { + option (google.api.resource) = { + type: "gameservices.googleapis.com/GameServerCluster" + pattern: "projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}" + }; + + // Required. The resource name of the game server cluster. Uses the form: + // + // `projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}`. + // For example, + // + // `projects/my-project/locations/{location}/realms/zanzibar/gameServerClusters/my-onprem-cluster`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels associated with this game server cluster. Each label is a + // key-value pair. + map labels = 4; + + // The game server cluster connection information. This information is used to + // manage game server clusters. + GameServerClusterConnectionInfo connection_info = 5; + + // ETag of the resource. + string etag = 6; + + // Human readable description of the cluster. + string description = 7; +} diff --git a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_clusters_service.proto b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_clusters_service.proto new file mode 100644 index 00000000000..18b374b694d --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_clusters_service.proto @@ -0,0 +1,123 @@ +// 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.gaming.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/gaming/v1beta/game_server_clusters.proto"; +import "google/longrunning/operations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming"; + +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1beta"; +option php_namespace = "Google\\Cloud\\Gaming\\V1beta"; + +// The game server cluster maps to Kubernetes clusters running Agones and is +// used to manage fleets within clusters. +service GameServerClustersService { + option (google.api.default_host) = "gameservices.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists game server clusters in a given project and location. + rpc ListGameServerClusters(ListGameServerClustersRequest) + returns (ListGameServerClustersResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/realms/*}/gameServerClusters" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single game server cluster. + rpc GetGameServerCluster(GetGameServerClusterRequest) + returns (GameServerCluster) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/realms/*/gameServerClusters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new game server cluster in a given project and location. + rpc CreateGameServerCluster(CreateGameServerClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/realms/*}/gameServerClusters" + body: "game_server_cluster" + }; + option (google.api.method_signature) = + "parent,game_server_cluster,game_server_cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "GameServerCluster" + metadata_type: "OperationMetadata" + }; + } + + // Previews creation of a new game server cluster in a given project and + // location. + rpc PreviewCreateGameServerCluster(PreviewCreateGameServerClusterRequest) + returns (PreviewCreateGameServerClusterResponse) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/realms/*}/gameServerClusters:previewCreate" + body: "game_server_cluster" + }; + } + + // Deletes a single game server cluster. + rpc DeleteGameServerCluster(DeleteGameServerClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/realms/*/gameServerClusters/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Previews deletion of a single game server cluster. + rpc PreviewDeleteGameServerCluster(PreviewDeleteGameServerClusterRequest) + returns (PreviewDeleteGameServerClusterResponse) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/realms/*/gameServerClusters/*}:previewDelete" + }; + } + + // Patches a single game server cluster. + rpc UpdateGameServerCluster(UpdateGameServerClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta/{game_server_cluster.name=projects/*/locations/*/realms/*/gameServerClusters/*}" + body: "game_server_cluster" + }; + option (google.api.method_signature) = "game_server_cluster,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "GameServerCluster" + metadata_type: "OperationMetadata" + }; + } + + // Previews updating a GameServerCluster. + rpc PreviewUpdateGameServerCluster(PreviewUpdateGameServerClusterRequest) + returns (PreviewUpdateGameServerClusterResponse) { + option (google.api.http) = { + patch: "/v1beta/{game_server_cluster.name=projects/*/locations/*/realms/*/gameServerClusters/*}:previewUpdate" + body: "game_server_cluster" + }; + } +} diff --git a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_configs.proto b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_configs.proto new file mode 100644 index 00000000000..1ffc0c816ef --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_configs.proto @@ -0,0 +1,184 @@ +// 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.gaming.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/gaming/v1beta/common.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming"; + +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1beta"; +option php_namespace = "Google\\Cloud\\Gaming\\V1beta"; + +// Request message for GameServerConfigsService.ListGameServerConfigs. +message ListGameServerConfigsRequest { + // Required. The parent resource name. Uses the form: + // + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/*`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "gameservices.googleapis.com/GameServerConfig" + } + ]; + + // Optional. The maximum number of items to return. If unspecified, server + // will pick an appropriate default. Server may return fewer items than + // requested. A caller should only rely on response's + // [next_page_token][google.cloud.gaming.v1beta.ListGameServerConfigsResponse.next_page_token] + // to determine if there are more GameServerConfigs left to be queried. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous list request, + // if any. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The filter to apply to list results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the ordering of results following syntax at + // https://cloud.google.com/apis/design/design_patterns#sorting_order. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for GameServerConfigsService.ListGameServerConfigs. +message ListGameServerConfigsResponse { + // The list of game server configs. + repeated GameServerConfig game_server_configs = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // List of locations that could not be reached. + repeated string unreachable = 4; +} + +// Request message for GameServerConfigsService.GetGameServerConfig. +message GetGameServerConfigRequest { + // Required. The name of the game server config to retrieve. Uses the form: + // + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gameservices.googleapis.com/GameServerConfig" + } + ]; +} + +// Request message for GameServerConfigsService.CreateGameServerConfig. +message CreateGameServerConfigRequest { + // Required. The parent resource name. Uses the form: + // + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "gameservices.googleapis.com/GameServerConfig" + } + ]; + + // Required. The ID of the game server config resource to be created. + string config_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The game server config resource to be created. + GameServerConfig game_server_config = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for GameServerConfigsService.DeleteGameServerConfig. +message DeleteGameServerConfigRequest { + // Required. The name of the game server config to delete. Uses the form: + // + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gameservices.googleapis.com/GameServerConfig" + } + ]; +} + +// Autoscaling config for an Agones fleet. +message ScalingConfig { + // Required. The name of the Scaling Config + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Agones fleet autoscaler spec. Example spec: + // https://agones.dev/site/docs/reference/fleetautoscaler/ + string fleet_autoscaler_spec = 2 [(google.api.field_behavior) = REQUIRED]; + + // Labels used to identify the game server clusters to which this Agones + // scaling config applies. A game server cluster is subject to this Agones + // scaling config if its labels match any of the selector entries. + repeated LabelSelector selectors = 4; + + // The schedules to which this Scaling Config applies. + repeated Schedule schedules = 5; +} + +// Fleet configs for Agones. +message FleetConfig { + // Agones fleet spec. Example spec: + // `https://agones.dev/site/docs/reference/fleet/`. + string fleet_spec = 1; + + // The name of the FleetConfig. + string name = 2; +} + +// A game server config resource. +message GameServerConfig { + option (google.api.resource) = { + type: "gameservices.googleapis.com/GameServerConfig" + pattern: "projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}" + }; + + // The resource name of the game server config. Uses the form: + // + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. + // For example, + // + // `projects/my-project/locations/global/gameServerDeployments/my-game/configs/my-config`. + string name = 1; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels associated with this game server config. Each label is a + // key-value pair. + map labels = 4; + + // FleetConfig contains a list of Agones fleet specs. Only one FleetConfig + // is allowed. + repeated FleetConfig fleet_configs = 5; + + // The autoscaling settings. + repeated ScalingConfig scaling_configs = 6; + + // The description of the game server config. + string description = 7; +} diff --git a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_configs_service.proto b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_configs_service.proto new file mode 100644 index 00000000000..20a2c888eec --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_configs_service.proto @@ -0,0 +1,84 @@ +// 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.gaming.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/gaming/v1beta/game_server_configs.proto"; +import "google/longrunning/operations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming"; + +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1beta"; +option php_namespace = "Google\\Cloud\\Gaming\\V1beta"; + +// The game server config configures the game servers in an Agones fleet. +service GameServerConfigsService { + option (google.api.default_host) = "gameservices.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists game server configs in a given project, location, and game server + // deployment. + rpc ListGameServerConfigs(ListGameServerConfigsRequest) + returns (ListGameServerConfigsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*/gameServerDeployments/*}/configs" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single game server config. + rpc GetGameServerConfig(GetGameServerConfigRequest) + returns (GameServerConfig) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*/configs/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new game server config in a given project, location, and game + // server deployment. Game server configs are immutable, and are not applied + // until referenced in the game server deployment rollout resource. + rpc CreateGameServerConfig(CreateGameServerConfigRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*/gameServerDeployments/*}/configs" + body: "game_server_config" + }; + option (google.api.method_signature) = "parent,game_server_config"; + option (google.longrunning.operation_info) = { + response_type: "GameServerConfig" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single game server config. The deletion will fail if the game + // server config is referenced in a game server deployment rollout. + rpc DeleteGameServerConfig(DeleteGameServerConfigRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*/configs/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } +} diff --git a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_deployments.proto b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_deployments.proto new file mode 100644 index 00000000000..01e8fef934a --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_deployments.proto @@ -0,0 +1,319 @@ +// 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.gaming.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/gaming/v1beta/common.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming"; + +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1beta"; +option php_namespace = "Google\\Cloud\\Gaming\\V1beta"; + +// Request message for GameServerDeploymentsService.ListGameServerDeployments. +message ListGameServerDeploymentsRequest { + // Required. The parent resource name. Uses the form: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "gameservices.googleapis.com/GameServerDeployment" + } + ]; + + // Optional. The maximum number of items to return. If unspecified, the + // server will pick an appropriate default. The server may return fewer items + // than requested. A caller should only rely on response's + // [next_page_token][google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse.next_page_token] + // to determine if there are more GameServerDeployments left to be queried. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous List request, + // if any. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The filter to apply to list results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the ordering of results following syntax at + // https://cloud.google.com/apis/design/design_patterns#sorting_order. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for GameServerDeploymentsService.ListGameServerDeployments. +message ListGameServerDeploymentsResponse { + // The list of game server deployments. + repeated GameServerDeployment game_server_deployments = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // List of locations that could not be reached. + repeated string unreachable = 4; +} + +// Request message for GameServerDeploymentsService.GetGameServerDeployment. +message GetGameServerDeploymentRequest { + // Required. The name of the game server delpoyment to retrieve. Uses the + // form: + // + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gameservices.googleapis.com/GameServerDeployment" + } + ]; +} + +// Request message for +// GameServerDeploymentsService.GetGameServerDeploymentRollout. +message GetGameServerDeploymentRolloutRequest { + // Required. The name of the game server delpoyment to retrieve. Uses the + // form: + // + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gameservices.googleapis.com/GameServerDeployment" + } + ]; +} + +// Request message for GameServerDeploymentsService.CreateGameServerDeployment. +message CreateGameServerDeploymentRequest { + // Required. The parent resource name. Uses the form: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "gameservices.googleapis.com/GameServerDeployment" + } + ]; + + // Required. The ID of the game server delpoyment resource to be created. + string deployment_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The game server delpoyment resource to be created. + GameServerDeployment game_server_deployment = 3 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for GameServerDeploymentsService.DeleteGameServerDeployment. +message DeleteGameServerDeploymentRequest { + // Required. The name of the game server delpoyment to delete. Uses the form: + // + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gameservices.googleapis.com/GameServerDeployment" + } + ]; +} + +// Request message for GameServerDeploymentsService.UpdateGameServerDeployment. +// Only allows updates for labels. +message UpdateGameServerDeploymentRequest { + // Required. The game server delpoyment to be updated. + // Only fields specified in update_mask are updated. + GameServerDeployment game_server_deployment = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask of fields to update. At least one path must be supplied in + // this field. For the `FieldMask` definition, see + // + // https: + // //developers.google.com/protocol-buffers + // // /docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for +// GameServerDeploymentsService.UpdateGameServerRolloutDeployment. +message UpdateGameServerDeploymentRolloutRequest { + // Required. The game server delpoyment rollout to be updated. + // Only fields specified in update_mask are updated. + GameServerDeploymentRollout rollout = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask of fields to update. At least one path must be supplied in + // this field. For the `FieldMask` definition, see + // + // https: + // //developers.google.com/protocol-buffers + // // /docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for GameServerDeploymentsService.FetchDeploymentState. +message FetchDeploymentStateRequest { + // Required. The name of the game server delpoyment. Uses the form: + // + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for GameServerDeploymentsService.FetchDeploymentState. +message FetchDeploymentStateResponse { + // The game server cluster changes made by the game server deployment. + message DeployedClusterState { + // The name of the cluster. + string cluster = 1; + + // The details about the Agones fleets and autoscalers created in the + // game server cluster. + repeated DeployedFleetDetails fleet_details = 2; + } + + // The state of the game server deployment in each game server cluster. + repeated DeployedClusterState cluster_state = 1; + + // List of locations that could not be reached. + repeated string unavailable = 2; +} + +// A game server deployment resource. +message GameServerDeployment { + option (google.api.resource) = { + type: "gameservices.googleapis.com/GameServerDeployment" + pattern: "projects/{project}/locations/{location}/gameServerDeployments/{deployment}" + }; + + // The resource name of the game server deployment. Uses the form: + // + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + // For example, + // + // `projects/my-project/locations/{location}/gameServerDeployments/my-deployment`. + string name = 1; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels associated with this game server deployment. Each label is a + // key-value pair. + map labels = 4; + + // ETag of the resource. + string etag = 7; + + // Human readable description of the game server delpoyment. + string description = 8; +} + +// A game server config override. +message GameServerConfigOverride { + // Selector chooses the game server config targets. + oneof selector { + // Selector for choosing applicable realms. + RealmSelector realms_selector = 1; + } + + // Selects the game server config and how it should be applied. + oneof change { + // The game server config for this override. + string config_version = 100; + } +} + +// The game server deployment rollout which represents the desired rollout +// state. +message GameServerDeploymentRollout { + option (google.api.resource) = { + type: "gameservices.googleapis.com/GameServerDeploymentRollout" + pattern: "projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout" + }; + + // The resource name of the game server deployment rollout. Uses the form: + // + // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. + // For example, + // + // `projects/my-project/locations/{location}/gameServerDeployments/my-deployment/rollout`. + string name = 1; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The default game server config is applied to all realms unless overridden + // in the rollout. For example, + // + // `projects/my-project/locations/global/gameServerDeployments/my-game/configs/my-config`. + string default_game_server_config = 4; + + // Contains the game server config rollout overrides. Overrides are processed + // in the order they are listed. Once a match is found for a realm, the rest + // of the list is not processed. + repeated GameServerConfigOverride game_server_config_overrides = 5; + + // ETag of the resource. + string etag = 6; +} + +// Request message for PreviewGameServerDeploymentRollout. +message PreviewGameServerDeploymentRolloutRequest { + // Required. The game server deployment rollout to be updated. + // Only fields specified in update_mask are updated. + GameServerDeploymentRollout rollout = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. Mask of fields to update. At least one path must be supplied in + // this field. For the `FieldMask` definition, see + // + // https: + // //developers.google.com/protocol-buffers + // // /docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The target timestamp to compute the preview. Defaults to the + // immediately after the proposed rollout completes. + google.protobuf.Timestamp preview_time = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for PreviewGameServerDeploymentRollout. +// This has details about the Agones fleet and autoscaler to be actuated. +message PreviewGameServerDeploymentRolloutResponse { + // Locations that could not be reached on this request. + repeated string unavailable = 2; + + // ETag of the game server deployment. + string etag = 3; + + // The target state. + TargetState target_state = 4; +} diff --git a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_deployments_service.proto b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_deployments_service.proto new file mode 100644 index 00000000000..0b3503f46ca --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_deployments_service.proto @@ -0,0 +1,146 @@ +// 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.gaming.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/gaming/v1beta/game_server_deployments.proto"; +import "google/longrunning/operations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming"; + +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1beta"; +option php_namespace = "Google\\Cloud\\Gaming\\V1beta"; + +// The game server deployment is used to control the deployment of Agones +// fleets. +service GameServerDeploymentsService { + option (google.api.default_host) = "gameservices.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists game server deployments in a given project and location. + rpc ListGameServerDeployments(ListGameServerDeploymentsRequest) + returns (ListGameServerDeploymentsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*}/gameServerDeployments" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single game server deployment. + rpc GetGameServerDeployment(GetGameServerDeploymentRequest) + returns (GameServerDeployment) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new game server deployment in a given project and location. + rpc CreateGameServerDeployment(CreateGameServerDeploymentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*}/gameServerDeployments" + body: "game_server_deployment" + }; + option (google.api.method_signature) = "parent,game_server_deployment"; + option (google.longrunning.operation_info) = { + response_type: "GameServerDeployment" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single game server deployment. + rpc DeleteGameServerDeployment(DeleteGameServerDeploymentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Patches a game server deployment. + rpc UpdateGameServerDeployment(UpdateGameServerDeploymentRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta/{game_server_deployment.name=projects/*/locations/*/gameServerDeployments/*}" + body: "game_server_deployment" + }; + option (google.api.method_signature) = "game_server_deployment,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "GameServerDeployment" + metadata_type: "OperationMetadata" + }; + } + + // Gets details a single game server deployment rollout. + rpc GetGameServerDeploymentRollout(GetGameServerDeploymentRolloutRequest) + returns (GameServerDeploymentRollout) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*}/rollout" + }; + option (google.api.method_signature) = "name"; + } + + // Patches a single game server deployment rollout. + // The method will not return an error if the update does not affect any + // existing realms. For example - if the default_game_server_config is changed + // but all existing realms use the override, that is valid. Similarly, if a + // non existing realm is explicitly called out in game_server_config_overrides + // field, that will also not result in an error. + rpc UpdateGameServerDeploymentRollout( + UpdateGameServerDeploymentRolloutRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta/{rollout.name=projects/*/locations/*/gameServerDeployments/*}/rollout" + body: "rollout" + }; + option (google.api.method_signature) = "rollout,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "GameServerDeployment" + metadata_type: "OperationMetadata" + }; + } + + // Previews the game server deployment rollout. This API does not mutate the + // rollout resource. + rpc PreviewGameServerDeploymentRollout( + PreviewGameServerDeploymentRolloutRequest) + returns (PreviewGameServerDeploymentRolloutResponse) { + option (google.api.http) = { + patch: "/v1beta/{rollout.name=projects/*/locations/*/gameServerDeployments/*}/rollout:preview" + body: "rollout" + }; + } + + // Retrieves information about the current state of the game server + // deployment. Gathers all the Agones fleets and Agones autoscalers, + // including fleets running an older version of the game server deployment. + rpc FetchDeploymentState(FetchDeploymentStateRequest) + returns (FetchDeploymentStateResponse) { + option (google.api.http) = { + post: "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*}:fetchDeploymentState" + body: "*" + }; + } +} diff --git a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto new file mode 100644 index 00000000000..e80bae0a9f4 --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto @@ -0,0 +1,194 @@ +// 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.gaming.v1beta; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/gaming/v1beta/common.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming"; + +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1beta"; +option php_namespace = "Google\\Cloud\\Gaming\\V1beta"; + +// Request message for RealmsService.ListRealms. +message ListRealmsRequest { + // Required. The parent resource name. Uses the form: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "gameservices.googleapis.com/Realm" + } + ]; + + // Optional. The maximum number of items to return. If unspecified, server + // will pick an appropriate default. Server may return fewer items than + // requested. A caller should only rely on response's + // [next_page_token][google.cloud.gaming.v1beta.ListRealmsResponse.next_page_token] + // to determine if there are more realms left to be queried. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous List request, + // if any. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The filter to apply to list results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the ordering of results following syntax at + // https://cloud.google.com/apis/design/design_patterns#sorting_order. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for RealmsService.ListRealms. +message ListRealmsResponse { + // The list of realms. + repeated Realm realms = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // List of locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for RealmsService.GetRealm. +message GetRealmRequest { + // Required. The name of the realm to retrieve. Uses the form: + // `projects/{project}/locations/{location}/realms/{realm}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gameservices.googleapis.com/Realm" + } + ]; +} + +// Request message for RealmsService.CreateRealm. +message CreateRealmRequest { + // Required. The parent resource name. Uses the form: + // `projects/{project}/locations/{location}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "gameservices.googleapis.com/Realm" + } + ]; + + // Required. The ID of the realm resource to be created. + string realm_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The realm resource to be created. + Realm realm = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for RealmsService.DeleteRealm. +message DeleteRealmRequest { + // Required. The name of the realm to delete. Uses the form: + // `projects/{project}/locations/{location}/realms/{realm}`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "gameservices.googleapis.com/Realm" + } + ]; +} + +// Request message for RealmsService.UpdateRealm. +message UpdateRealmRequest { + // Required. The realm to be updated. + // Only fields specified in update_mask are updated. + Realm realm = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. For the `FieldMask` + // definition, see + // + // https: + // //developers.google.com/protocol-buffers + // // /docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for RealmsService.PreviewRealmUpdate. +message PreviewRealmUpdateRequest { + // Required. The realm to be updated. + // Only fields specified in update_mask are updated. + Realm realm = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The update mask applies to the resource. For the `FieldMask` + // definition, see + // + // https: + // //developers.google.com/protocol-buffers + // // /docs/reference/google.protobuf#fieldmask + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. The target timestamp to compute the preview. + google.protobuf.Timestamp preview_time = 3 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for RealmsService.PreviewRealmUpdate. +message PreviewRealmUpdateResponse { + // ETag of the realm. + string etag = 2; + + // The target state. + TargetState target_state = 3; +} + +// A realm resource. +message Realm { + option (google.api.resource) = { + type: "gameservices.googleapis.com/Realm" + pattern: "projects/{project}/locations/{location}/realms/{realm}" + }; + + // The resource name of the realm. Uses the form: + // `projects/{project}/locations/{location}/realms/{realm}`. For + // example, `projects/my-project/locations/{location}/realms/my-realm`. + string name = 1; + + // Output only. The creation time. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last-modified time. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The labels associated with this realm. Each label is a key-value pair. + map labels = 4; + + // Required. Time zone where all policies targeting this realm are evaluated. + // The value of this field must be from the IANA time zone database: + // https://www.iana.org/time-zones. + string time_zone = 6 [(google.api.field_behavior) = REQUIRED]; + + // ETag of the resource. + string etag = 7; + + // Human readable description of the realm. + string description = 8; +} diff --git a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms_service.proto b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms_service.proto new file mode 100644 index 00000000000..eb6cca9312f --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms_service.proto @@ -0,0 +1,99 @@ +// 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.gaming.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/cloud/gaming/v1beta/realms.proto"; +import "google/longrunning/operations.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming"; + +option java_multiple_files = true; +option java_package = "com.google.cloud.gaming.v1beta"; +option php_namespace = "Google\\Cloud\\Gaming\\V1beta"; + +// A realm is a grouping of game server clusters that are considered +// interchangeable. +service RealmsService { + option (google.api.default_host) = "gameservices.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists realms in a given project and location. + rpc ListRealms(ListRealmsRequest) returns (ListRealmsResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*}/realms" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single realm. + rpc GetRealm(GetRealmRequest) returns (Realm) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/realms/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new realm in a given project and location. + rpc CreateRealm(CreateRealmRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*}/realms" + body: "realm" + }; + option (google.api.method_signature) = "parent,realm,realm_id"; + option (google.longrunning.operation_info) = { + response_type: "Realm" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single realm. + rpc DeleteRealm(DeleteRealmRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/realms/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Patches a single realm. + rpc UpdateRealm(UpdateRealmRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta/{realm.name=projects/*/locations/*/realms/*}" + body: "realm" + }; + option (google.api.method_signature) = "realm,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Realm" + metadata_type: "OperationMetadata" + }; + } + + // Previews patches to a single realm. + rpc PreviewRealmUpdate(PreviewRealmUpdateRequest) + returns (PreviewRealmUpdateResponse) { + option (google.api.http) = { + patch: "/v1beta/{realm.name=projects/*/locations/*/realms/*}:previewUpdate" + body: "realm" + }; + } +} diff --git a/packages/google-cloud-gaming/protos/protos.d.ts b/packages/google-cloud-gaming/protos/protos.d.ts new file mode 100644 index 00000000000..33c855a872c --- /dev/null +++ b/packages/google-cloud-gaming/protos/protos.d.ts @@ -0,0 +1,20784 @@ +// 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 gaming. */ + namespace gaming { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + + /** OperationMetadata unreachable */ + unreachable?: (string[]|null); + + /** OperationMetadata operationStatus */ + operationStatus?: ({ [k: string]: google.cloud.gaming.v1.IOperationStatus }|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** OperationMetadata unreachable. */ + public unreachable: string[]; + + /** OperationMetadata operationStatus. */ + public operationStatus: { [k: string]: google.cloud.gaming.v1.IOperationStatus }; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.gaming.v1.IOperationMetadata): google.cloud.gaming.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.gaming.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationStatus. */ + interface IOperationStatus { + + /** OperationStatus done */ + done?: (boolean|null); + + /** OperationStatus errorCode */ + errorCode?: (google.cloud.gaming.v1.OperationStatus.ErrorCode|keyof typeof google.cloud.gaming.v1.OperationStatus.ErrorCode|null); + + /** OperationStatus errorMessage */ + errorMessage?: (string|null); + } + + /** Represents an OperationStatus. */ + class OperationStatus implements IOperationStatus { + + /** + * Constructs a new OperationStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IOperationStatus); + + /** OperationStatus done. */ + public done: boolean; + + /** OperationStatus errorCode. */ + public errorCode: (google.cloud.gaming.v1.OperationStatus.ErrorCode|keyof typeof google.cloud.gaming.v1.OperationStatus.ErrorCode); + + /** OperationStatus errorMessage. */ + public errorMessage: string; + + /** + * Creates a new OperationStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationStatus instance + */ + public static create(properties?: google.cloud.gaming.v1.IOperationStatus): google.cloud.gaming.v1.OperationStatus; + + /** + * Encodes the specified OperationStatus message. Does not implicitly {@link google.cloud.gaming.v1.OperationStatus.verify|verify} messages. + * @param message OperationStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IOperationStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationStatus message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.OperationStatus.verify|verify} messages. + * @param message OperationStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IOperationStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.OperationStatus; + + /** + * Decodes an OperationStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.OperationStatus; + + /** + * Verifies an OperationStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.OperationStatus; + + /** + * Creates a plain object from an OperationStatus message. Also converts values to other types if specified. + * @param message OperationStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.OperationStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OperationStatus { + + /** ErrorCode enum. */ + enum ErrorCode { + ERROR_CODE_UNSPECIFIED = 0, + INTERNAL_ERROR = 1, + PERMISSION_DENIED = 2, + CLUSTER_CONNECTION = 3 + } + } + + /** Properties of a LabelSelector. */ + interface ILabelSelector { + + /** LabelSelector labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a LabelSelector. */ + class LabelSelector implements ILabelSelector { + + /** + * Constructs a new LabelSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.ILabelSelector); + + /** LabelSelector labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new LabelSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelSelector instance + */ + public static create(properties?: google.cloud.gaming.v1.ILabelSelector): google.cloud.gaming.v1.LabelSelector; + + /** + * Encodes the specified LabelSelector message. Does not implicitly {@link google.cloud.gaming.v1.LabelSelector.verify|verify} messages. + * @param message LabelSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.ILabelSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelSelector message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.LabelSelector.verify|verify} messages. + * @param message LabelSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.ILabelSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.LabelSelector; + + /** + * Decodes a LabelSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.LabelSelector; + + /** + * Verifies a LabelSelector message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelSelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.LabelSelector; + + /** + * Creates a plain object from a LabelSelector message. Also converts values to other types if specified. + * @param message LabelSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.LabelSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmSelector. */ + interface IRealmSelector { + + /** RealmSelector realms */ + realms?: (string[]|null); + } + + /** Represents a RealmSelector. */ + class RealmSelector implements IRealmSelector { + + /** + * Constructs a new RealmSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IRealmSelector); + + /** RealmSelector realms. */ + public realms: string[]; + + /** + * Creates a new RealmSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmSelector instance + */ + public static create(properties?: google.cloud.gaming.v1.IRealmSelector): google.cloud.gaming.v1.RealmSelector; + + /** + * Encodes the specified RealmSelector message. Does not implicitly {@link google.cloud.gaming.v1.RealmSelector.verify|verify} messages. + * @param message RealmSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IRealmSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RealmSelector message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.RealmSelector.verify|verify} messages. + * @param message RealmSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IRealmSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RealmSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.RealmSelector; + + /** + * Decodes a RealmSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RealmSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.RealmSelector; + + /** + * Verifies a RealmSelector message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RealmSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RealmSelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.RealmSelector; + + /** + * Creates a plain object from a RealmSelector message. Also converts values to other types if specified. + * @param message RealmSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.RealmSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RealmSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RealmSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Schedule. */ + interface ISchedule { + + /** Schedule startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Schedule endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** Schedule cronJobDuration */ + cronJobDuration?: (google.protobuf.IDuration|null); + + /** Schedule cronSpec */ + cronSpec?: (string|null); + } + + /** Represents a Schedule. */ + class Schedule implements ISchedule { + + /** + * Constructs a new Schedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.ISchedule); + + /** Schedule startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Schedule endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Schedule cronJobDuration. */ + public cronJobDuration?: (google.protobuf.IDuration|null); + + /** Schedule cronSpec. */ + public cronSpec: string; + + /** + * Creates a new Schedule instance using the specified properties. + * @param [properties] Properties to set + * @returns Schedule instance + */ + public static create(properties?: google.cloud.gaming.v1.ISchedule): google.cloud.gaming.v1.Schedule; + + /** + * Encodes the specified Schedule message. Does not implicitly {@link google.cloud.gaming.v1.Schedule.verify|verify} messages. + * @param message Schedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.ISchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Schedule message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.Schedule.verify|verify} messages. + * @param message Schedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.ISchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Schedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.Schedule; + + /** + * Decodes a Schedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.Schedule; + + /** + * Verifies a Schedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Schedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Schedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.Schedule; + + /** + * Creates a plain object from a Schedule message. Also converts values to other types if specified. + * @param message Schedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.Schedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Schedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Schedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpecSource. */ + interface ISpecSource { + + /** SpecSource gameServerConfigName */ + gameServerConfigName?: (string|null); + + /** SpecSource name */ + name?: (string|null); + } + + /** Represents a SpecSource. */ + class SpecSource implements ISpecSource { + + /** + * Constructs a new SpecSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.ISpecSource); + + /** SpecSource gameServerConfigName. */ + public gameServerConfigName: string; + + /** SpecSource name. */ + public name: string; + + /** + * Creates a new SpecSource instance using the specified properties. + * @param [properties] Properties to set + * @returns SpecSource instance + */ + public static create(properties?: google.cloud.gaming.v1.ISpecSource): google.cloud.gaming.v1.SpecSource; + + /** + * Encodes the specified SpecSource message. Does not implicitly {@link google.cloud.gaming.v1.SpecSource.verify|verify} messages. + * @param message SpecSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.ISpecSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpecSource message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.SpecSource.verify|verify} messages. + * @param message SpecSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.ISpecSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpecSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpecSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.SpecSource; + + /** + * Decodes a SpecSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpecSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.SpecSource; + + /** + * Verifies a SpecSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpecSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpecSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.SpecSource; + + /** + * Creates a plain object from a SpecSource message. Also converts values to other types if specified. + * @param message SpecSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.SpecSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpecSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpecSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TargetDetails. */ + interface ITargetDetails { + + /** TargetDetails gameServerClusterName */ + gameServerClusterName?: (string|null); + + /** TargetDetails gameServerDeploymentName */ + gameServerDeploymentName?: (string|null); + + /** TargetDetails fleetDetails */ + fleetDetails?: (google.cloud.gaming.v1.TargetDetails.ITargetFleetDetails[]|null); + } + + /** Represents a TargetDetails. */ + class TargetDetails implements ITargetDetails { + + /** + * Constructs a new TargetDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.ITargetDetails); + + /** TargetDetails gameServerClusterName. */ + public gameServerClusterName: string; + + /** TargetDetails gameServerDeploymentName. */ + public gameServerDeploymentName: string; + + /** TargetDetails fleetDetails. */ + public fleetDetails: google.cloud.gaming.v1.TargetDetails.ITargetFleetDetails[]; + + /** + * Creates a new TargetDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetDetails instance + */ + public static create(properties?: google.cloud.gaming.v1.ITargetDetails): google.cloud.gaming.v1.TargetDetails; + + /** + * Encodes the specified TargetDetails message. Does not implicitly {@link google.cloud.gaming.v1.TargetDetails.verify|verify} messages. + * @param message TargetDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.ITargetDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetDetails message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.TargetDetails.verify|verify} messages. + * @param message TargetDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.ITargetDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.TargetDetails; + + /** + * Decodes a TargetDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.TargetDetails; + + /** + * Verifies a TargetDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.TargetDetails; + + /** + * Creates a plain object from a TargetDetails message. Also converts values to other types if specified. + * @param message TargetDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.TargetDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TargetDetails { + + /** Properties of a TargetFleetDetails. */ + interface ITargetFleetDetails { + + /** TargetFleetDetails fleet */ + fleet?: (google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleet|null); + + /** TargetFleetDetails autoscaler */ + autoscaler?: (google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler|null); + } + + /** Represents a TargetFleetDetails. */ + class TargetFleetDetails implements ITargetFleetDetails { + + /** + * Constructs a new TargetFleetDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.TargetDetails.ITargetFleetDetails); + + /** TargetFleetDetails fleet. */ + public fleet?: (google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleet|null); + + /** TargetFleetDetails autoscaler. */ + public autoscaler?: (google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler|null); + + /** + * Creates a new TargetFleetDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetFleetDetails instance + */ + public static create(properties?: google.cloud.gaming.v1.TargetDetails.ITargetFleetDetails): google.cloud.gaming.v1.TargetDetails.TargetFleetDetails; + + /** + * Encodes the specified TargetFleetDetails message. Does not implicitly {@link google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.verify|verify} messages. + * @param message TargetFleetDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.TargetDetails.ITargetFleetDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetFleetDetails message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.verify|verify} messages. + * @param message TargetFleetDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.TargetDetails.ITargetFleetDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetFleetDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetFleetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.TargetDetails.TargetFleetDetails; + + /** + * Decodes a TargetFleetDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetFleetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.TargetDetails.TargetFleetDetails; + + /** + * Verifies a TargetFleetDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetFleetDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetFleetDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.TargetDetails.TargetFleetDetails; + + /** + * Creates a plain object from a TargetFleetDetails message. Also converts values to other types if specified. + * @param message TargetFleetDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.TargetDetails.TargetFleetDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetFleetDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetFleetDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TargetFleetDetails { + + /** Properties of a TargetFleet. */ + interface ITargetFleet { + + /** TargetFleet name */ + name?: (string|null); + + /** TargetFleet specSource */ + specSource?: (google.cloud.gaming.v1.ISpecSource|null); + } + + /** Represents a TargetFleet. */ + class TargetFleet implements ITargetFleet { + + /** + * Constructs a new TargetFleet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleet); + + /** TargetFleet name. */ + public name: string; + + /** TargetFleet specSource. */ + public specSource?: (google.cloud.gaming.v1.ISpecSource|null); + + /** + * Creates a new TargetFleet instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetFleet instance + */ + public static create(properties?: google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleet): google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet; + + /** + * Encodes the specified TargetFleet message. Does not implicitly {@link google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet.verify|verify} messages. + * @param message TargetFleet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetFleet message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet.verify|verify} messages. + * @param message TargetFleet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetFleet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetFleet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet; + + /** + * Decodes a TargetFleet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetFleet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet; + + /** + * Verifies a TargetFleet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetFleet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetFleet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet; + + /** + * Creates a plain object from a TargetFleet message. Also converts values to other types if specified. + * @param message TargetFleet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetFleet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetFleet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TargetFleetAutoscaler. */ + interface ITargetFleetAutoscaler { + + /** TargetFleetAutoscaler name */ + name?: (string|null); + + /** TargetFleetAutoscaler specSource */ + specSource?: (google.cloud.gaming.v1.ISpecSource|null); + } + + /** Represents a TargetFleetAutoscaler. */ + class TargetFleetAutoscaler implements ITargetFleetAutoscaler { + + /** + * Constructs a new TargetFleetAutoscaler. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler); + + /** TargetFleetAutoscaler name. */ + public name: string; + + /** TargetFleetAutoscaler specSource. */ + public specSource?: (google.cloud.gaming.v1.ISpecSource|null); + + /** + * Creates a new TargetFleetAutoscaler instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetFleetAutoscaler instance + */ + public static create(properties?: google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler): google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler; + + /** + * Encodes the specified TargetFleetAutoscaler message. Does not implicitly {@link google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler.verify|verify} messages. + * @param message TargetFleetAutoscaler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetFleetAutoscaler message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler.verify|verify} messages. + * @param message TargetFleetAutoscaler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetFleetAutoscaler message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetFleetAutoscaler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler; + + /** + * Decodes a TargetFleetAutoscaler message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetFleetAutoscaler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler; + + /** + * Verifies a TargetFleetAutoscaler message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetFleetAutoscaler message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetFleetAutoscaler + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler; + + /** + * Creates a plain object from a TargetFleetAutoscaler message. Also converts values to other types if specified. + * @param message TargetFleetAutoscaler + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetFleetAutoscaler to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetFleetAutoscaler + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a TargetState. */ + interface ITargetState { + + /** TargetState details */ + details?: (google.cloud.gaming.v1.ITargetDetails[]|null); + } + + /** Represents a TargetState. */ + class TargetState implements ITargetState { + + /** + * Constructs a new TargetState. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.ITargetState); + + /** TargetState details. */ + public details: google.cloud.gaming.v1.ITargetDetails[]; + + /** + * Creates a new TargetState instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetState instance + */ + public static create(properties?: google.cloud.gaming.v1.ITargetState): google.cloud.gaming.v1.TargetState; + + /** + * Encodes the specified TargetState message. Does not implicitly {@link google.cloud.gaming.v1.TargetState.verify|verify} messages. + * @param message TargetState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.ITargetState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetState message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.TargetState.verify|verify} messages. + * @param message TargetState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.ITargetState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.TargetState; + + /** + * Decodes a TargetState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.TargetState; + + /** + * Verifies a TargetState message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetState + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.TargetState; + + /** + * Creates a plain object from a TargetState message. Also converts values to other types if specified. + * @param message TargetState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.TargetState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetState + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployedFleetDetails. */ + interface IDeployedFleetDetails { + + /** DeployedFleetDetails deployedFleet */ + deployedFleet?: (google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleet|null); + + /** DeployedFleetDetails deployedAutoscaler */ + deployedAutoscaler?: (google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleetAutoscaler|null); + } + + /** Represents a DeployedFleetDetails. */ + class DeployedFleetDetails implements IDeployedFleetDetails { + + /** + * Constructs a new DeployedFleetDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IDeployedFleetDetails); + + /** DeployedFleetDetails deployedFleet. */ + public deployedFleet?: (google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleet|null); + + /** DeployedFleetDetails deployedAutoscaler. */ + public deployedAutoscaler?: (google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleetAutoscaler|null); + + /** + * Creates a new DeployedFleetDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployedFleetDetails instance + */ + public static create(properties?: google.cloud.gaming.v1.IDeployedFleetDetails): google.cloud.gaming.v1.DeployedFleetDetails; + + /** + * Encodes the specified DeployedFleetDetails message. Does not implicitly {@link google.cloud.gaming.v1.DeployedFleetDetails.verify|verify} messages. + * @param message DeployedFleetDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IDeployedFleetDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployedFleetDetails message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.DeployedFleetDetails.verify|verify} messages. + * @param message DeployedFleetDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IDeployedFleetDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployedFleetDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployedFleetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.DeployedFleetDetails; + + /** + * Decodes a DeployedFleetDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployedFleetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.DeployedFleetDetails; + + /** + * Verifies a DeployedFleetDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployedFleetDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployedFleetDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.DeployedFleetDetails; + + /** + * Creates a plain object from a DeployedFleetDetails message. Also converts values to other types if specified. + * @param message DeployedFleetDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.DeployedFleetDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployedFleetDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployedFleetDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DeployedFleetDetails { + + /** Properties of a DeployedFleet. */ + interface IDeployedFleet { + + /** DeployedFleet fleet */ + fleet?: (string|null); + + /** DeployedFleet fleetSpec */ + fleetSpec?: (string|null); + + /** DeployedFleet specSource */ + specSource?: (google.cloud.gaming.v1.ISpecSource|null); + + /** DeployedFleet status */ + status?: (google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus|null); + } + + /** Represents a DeployedFleet. */ + class DeployedFleet implements IDeployedFleet { + + /** + * Constructs a new DeployedFleet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleet); + + /** DeployedFleet fleet. */ + public fleet: string; + + /** DeployedFleet fleetSpec. */ + public fleetSpec: string; + + /** DeployedFleet specSource. */ + public specSource?: (google.cloud.gaming.v1.ISpecSource|null); + + /** DeployedFleet status. */ + public status?: (google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus|null); + + /** + * Creates a new DeployedFleet instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployedFleet instance + */ + public static create(properties?: google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleet): google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet; + + /** + * Encodes the specified DeployedFleet message. Does not implicitly {@link google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.verify|verify} messages. + * @param message DeployedFleet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployedFleet message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.verify|verify} messages. + * @param message DeployedFleet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployedFleet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployedFleet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet; + + /** + * Decodes a DeployedFleet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployedFleet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet; + + /** + * Verifies a DeployedFleet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployedFleet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployedFleet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet; + + /** + * Creates a plain object from a DeployedFleet message. Also converts values to other types if specified. + * @param message DeployedFleet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployedFleet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployedFleet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DeployedFleet { + + /** Properties of a DeployedFleetStatus. */ + interface IDeployedFleetStatus { + + /** DeployedFleetStatus readyReplicas */ + readyReplicas?: (number|Long|string|null); + + /** DeployedFleetStatus allocatedReplicas */ + allocatedReplicas?: (number|Long|string|null); + + /** DeployedFleetStatus reservedReplicas */ + reservedReplicas?: (number|Long|string|null); + + /** DeployedFleetStatus replicas */ + replicas?: (number|Long|string|null); + } + + /** Represents a DeployedFleetStatus. */ + class DeployedFleetStatus implements IDeployedFleetStatus { + + /** + * Constructs a new DeployedFleetStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus); + + /** DeployedFleetStatus readyReplicas. */ + public readyReplicas: (number|Long|string); + + /** DeployedFleetStatus allocatedReplicas. */ + public allocatedReplicas: (number|Long|string); + + /** DeployedFleetStatus reservedReplicas. */ + public reservedReplicas: (number|Long|string); + + /** DeployedFleetStatus replicas. */ + public replicas: (number|Long|string); + + /** + * Creates a new DeployedFleetStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployedFleetStatus instance + */ + public static create(properties?: google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus): google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus; + + /** + * Encodes the specified DeployedFleetStatus message. Does not implicitly {@link google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus.verify|verify} messages. + * @param message DeployedFleetStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployedFleetStatus message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus.verify|verify} messages. + * @param message DeployedFleetStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployedFleetStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployedFleetStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus; + + /** + * Decodes a DeployedFleetStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployedFleetStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus; + + /** + * Verifies a DeployedFleetStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployedFleetStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployedFleetStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus; + + /** + * Creates a plain object from a DeployedFleetStatus message. Also converts values to other types if specified. + * @param message DeployedFleetStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployedFleetStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployedFleetStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a DeployedFleetAutoscaler. */ + interface IDeployedFleetAutoscaler { + + /** DeployedFleetAutoscaler autoscaler */ + autoscaler?: (string|null); + + /** DeployedFleetAutoscaler specSource */ + specSource?: (google.cloud.gaming.v1.ISpecSource|null); + + /** DeployedFleetAutoscaler fleetAutoscalerSpec */ + fleetAutoscalerSpec?: (string|null); + } + + /** Represents a DeployedFleetAutoscaler. */ + class DeployedFleetAutoscaler implements IDeployedFleetAutoscaler { + + /** + * Constructs a new DeployedFleetAutoscaler. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleetAutoscaler); + + /** DeployedFleetAutoscaler autoscaler. */ + public autoscaler: string; + + /** DeployedFleetAutoscaler specSource. */ + public specSource?: (google.cloud.gaming.v1.ISpecSource|null); + + /** DeployedFleetAutoscaler fleetAutoscalerSpec. */ + public fleetAutoscalerSpec: string; + + /** + * Creates a new DeployedFleetAutoscaler instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployedFleetAutoscaler instance + */ + public static create(properties?: google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleetAutoscaler): google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler; + + /** + * Encodes the specified DeployedFleetAutoscaler message. Does not implicitly {@link google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler.verify|verify} messages. + * @param message DeployedFleetAutoscaler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleetAutoscaler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployedFleetAutoscaler message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler.verify|verify} messages. + * @param message DeployedFleetAutoscaler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleetAutoscaler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployedFleetAutoscaler message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployedFleetAutoscaler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler; + + /** + * Decodes a DeployedFleetAutoscaler message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployedFleetAutoscaler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler; + + /** + * Verifies a DeployedFleetAutoscaler message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployedFleetAutoscaler message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployedFleetAutoscaler + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler; + + /** + * Creates a plain object from a DeployedFleetAutoscaler message. Also converts values to other types if specified. + * @param message DeployedFleetAutoscaler + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployedFleetAutoscaler to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployedFleetAutoscaler + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** GameServerClusterView enum. */ + enum GameServerClusterView { + GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED = 0, + BASIC = 1, + FULL = 2 + } + + /** Properties of a ListGameServerClustersRequest. */ + interface IListGameServerClustersRequest { + + /** ListGameServerClustersRequest parent */ + parent?: (string|null); + + /** ListGameServerClustersRequest pageSize */ + pageSize?: (number|null); + + /** ListGameServerClustersRequest pageToken */ + pageToken?: (string|null); + + /** ListGameServerClustersRequest filter */ + filter?: (string|null); + + /** ListGameServerClustersRequest orderBy */ + orderBy?: (string|null); + + /** ListGameServerClustersRequest view */ + view?: (google.cloud.gaming.v1.GameServerClusterView|keyof typeof google.cloud.gaming.v1.GameServerClusterView|null); + } + + /** Represents a ListGameServerClustersRequest. */ + class ListGameServerClustersRequest implements IListGameServerClustersRequest { + + /** + * Constructs a new ListGameServerClustersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IListGameServerClustersRequest); + + /** ListGameServerClustersRequest parent. */ + public parent: string; + + /** ListGameServerClustersRequest pageSize. */ + public pageSize: number; + + /** ListGameServerClustersRequest pageToken. */ + public pageToken: string; + + /** ListGameServerClustersRequest filter. */ + public filter: string; + + /** ListGameServerClustersRequest orderBy. */ + public orderBy: string; + + /** ListGameServerClustersRequest view. */ + public view: (google.cloud.gaming.v1.GameServerClusterView|keyof typeof google.cloud.gaming.v1.GameServerClusterView); + + /** + * Creates a new ListGameServerClustersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGameServerClustersRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IListGameServerClustersRequest): google.cloud.gaming.v1.ListGameServerClustersRequest; + + /** + * Encodes the specified ListGameServerClustersRequest message. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerClustersRequest.verify|verify} messages. + * @param message ListGameServerClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IListGameServerClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGameServerClustersRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerClustersRequest.verify|verify} messages. + * @param message ListGameServerClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IListGameServerClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGameServerClustersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGameServerClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.ListGameServerClustersRequest; + + /** + * Decodes a ListGameServerClustersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGameServerClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.ListGameServerClustersRequest; + + /** + * Verifies a ListGameServerClustersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGameServerClustersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGameServerClustersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.ListGameServerClustersRequest; + + /** + * Creates a plain object from a ListGameServerClustersRequest message. Also converts values to other types if specified. + * @param message ListGameServerClustersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.ListGameServerClustersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGameServerClustersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGameServerClustersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGameServerClustersResponse. */ + interface IListGameServerClustersResponse { + + /** ListGameServerClustersResponse gameServerClusters */ + gameServerClusters?: (google.cloud.gaming.v1.IGameServerCluster[]|null); + + /** ListGameServerClustersResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListGameServerClustersResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListGameServerClustersResponse. */ + class ListGameServerClustersResponse implements IListGameServerClustersResponse { + + /** + * Constructs a new ListGameServerClustersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IListGameServerClustersResponse); + + /** ListGameServerClustersResponse gameServerClusters. */ + public gameServerClusters: google.cloud.gaming.v1.IGameServerCluster[]; + + /** ListGameServerClustersResponse nextPageToken. */ + public nextPageToken: string; + + /** ListGameServerClustersResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListGameServerClustersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGameServerClustersResponse instance + */ + public static create(properties?: google.cloud.gaming.v1.IListGameServerClustersResponse): google.cloud.gaming.v1.ListGameServerClustersResponse; + + /** + * Encodes the specified ListGameServerClustersResponse message. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerClustersResponse.verify|verify} messages. + * @param message ListGameServerClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IListGameServerClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGameServerClustersResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerClustersResponse.verify|verify} messages. + * @param message ListGameServerClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IListGameServerClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGameServerClustersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGameServerClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.ListGameServerClustersResponse; + + /** + * Decodes a ListGameServerClustersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGameServerClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.ListGameServerClustersResponse; + + /** + * Verifies a ListGameServerClustersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGameServerClustersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGameServerClustersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.ListGameServerClustersResponse; + + /** + * Creates a plain object from a ListGameServerClustersResponse message. Also converts values to other types if specified. + * @param message ListGameServerClustersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.ListGameServerClustersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGameServerClustersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGameServerClustersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetGameServerClusterRequest. */ + interface IGetGameServerClusterRequest { + + /** GetGameServerClusterRequest name */ + name?: (string|null); + + /** GetGameServerClusterRequest view */ + view?: (google.cloud.gaming.v1.GameServerClusterView|keyof typeof google.cloud.gaming.v1.GameServerClusterView|null); + } + + /** Represents a GetGameServerClusterRequest. */ + class GetGameServerClusterRequest implements IGetGameServerClusterRequest { + + /** + * Constructs a new GetGameServerClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IGetGameServerClusterRequest); + + /** GetGameServerClusterRequest name. */ + public name: string; + + /** GetGameServerClusterRequest view. */ + public view: (google.cloud.gaming.v1.GameServerClusterView|keyof typeof google.cloud.gaming.v1.GameServerClusterView); + + /** + * Creates a new GetGameServerClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGameServerClusterRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IGetGameServerClusterRequest): google.cloud.gaming.v1.GetGameServerClusterRequest; + + /** + * Encodes the specified GetGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1.GetGameServerClusterRequest.verify|verify} messages. + * @param message GetGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IGetGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GetGameServerClusterRequest.verify|verify} messages. + * @param message GetGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IGetGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGameServerClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.GetGameServerClusterRequest; + + /** + * Decodes a GetGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.GetGameServerClusterRequest; + + /** + * Verifies a GetGameServerClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGameServerClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.GetGameServerClusterRequest; + + /** + * Creates a plain object from a GetGameServerClusterRequest message. Also converts values to other types if specified. + * @param message GetGameServerClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.GetGameServerClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGameServerClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGameServerClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateGameServerClusterRequest. */ + interface ICreateGameServerClusterRequest { + + /** CreateGameServerClusterRequest parent */ + parent?: (string|null); + + /** CreateGameServerClusterRequest gameServerClusterId */ + gameServerClusterId?: (string|null); + + /** CreateGameServerClusterRequest gameServerCluster */ + gameServerCluster?: (google.cloud.gaming.v1.IGameServerCluster|null); + } + + /** Represents a CreateGameServerClusterRequest. */ + class CreateGameServerClusterRequest implements ICreateGameServerClusterRequest { + + /** + * Constructs a new CreateGameServerClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.ICreateGameServerClusterRequest); + + /** CreateGameServerClusterRequest parent. */ + public parent: string; + + /** CreateGameServerClusterRequest gameServerClusterId. */ + public gameServerClusterId: string; + + /** CreateGameServerClusterRequest gameServerCluster. */ + public gameServerCluster?: (google.cloud.gaming.v1.IGameServerCluster|null); + + /** + * Creates a new CreateGameServerClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGameServerClusterRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.ICreateGameServerClusterRequest): google.cloud.gaming.v1.CreateGameServerClusterRequest; + + /** + * Encodes the specified CreateGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1.CreateGameServerClusterRequest.verify|verify} messages. + * @param message CreateGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.ICreateGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.CreateGameServerClusterRequest.verify|verify} messages. + * @param message CreateGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.ICreateGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateGameServerClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.CreateGameServerClusterRequest; + + /** + * Decodes a CreateGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.CreateGameServerClusterRequest; + + /** + * Verifies a CreateGameServerClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateGameServerClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.CreateGameServerClusterRequest; + + /** + * Creates a plain object from a CreateGameServerClusterRequest message. Also converts values to other types if specified. + * @param message CreateGameServerClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.CreateGameServerClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateGameServerClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateGameServerClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PreviewCreateGameServerClusterRequest. */ + interface IPreviewCreateGameServerClusterRequest { + + /** PreviewCreateGameServerClusterRequest parent */ + parent?: (string|null); + + /** PreviewCreateGameServerClusterRequest gameServerClusterId */ + gameServerClusterId?: (string|null); + + /** PreviewCreateGameServerClusterRequest gameServerCluster */ + gameServerCluster?: (google.cloud.gaming.v1.IGameServerCluster|null); + + /** PreviewCreateGameServerClusterRequest previewTime */ + previewTime?: (google.protobuf.ITimestamp|null); + + /** PreviewCreateGameServerClusterRequest view */ + view?: (google.cloud.gaming.v1.GameServerClusterView|keyof typeof google.cloud.gaming.v1.GameServerClusterView|null); + } + + /** Represents a PreviewCreateGameServerClusterRequest. */ + class PreviewCreateGameServerClusterRequest implements IPreviewCreateGameServerClusterRequest { + + /** + * Constructs a new PreviewCreateGameServerClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest); + + /** PreviewCreateGameServerClusterRequest parent. */ + public parent: string; + + /** PreviewCreateGameServerClusterRequest gameServerClusterId. */ + public gameServerClusterId: string; + + /** PreviewCreateGameServerClusterRequest gameServerCluster. */ + public gameServerCluster?: (google.cloud.gaming.v1.IGameServerCluster|null); + + /** PreviewCreateGameServerClusterRequest previewTime. */ + public previewTime?: (google.protobuf.ITimestamp|null); + + /** PreviewCreateGameServerClusterRequest view. */ + public view: (google.cloud.gaming.v1.GameServerClusterView|keyof typeof google.cloud.gaming.v1.GameServerClusterView); + + /** + * Creates a new PreviewCreateGameServerClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PreviewCreateGameServerClusterRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest): google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest; + + /** + * Encodes the specified PreviewCreateGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest.verify|verify} messages. + * @param message PreviewCreateGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreviewCreateGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest.verify|verify} messages. + * @param message PreviewCreateGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreviewCreateGameServerClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreviewCreateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest; + + /** + * Decodes a PreviewCreateGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreviewCreateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest; + + /** + * Verifies a PreviewCreateGameServerClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreviewCreateGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreviewCreateGameServerClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest; + + /** + * Creates a plain object from a PreviewCreateGameServerClusterRequest message. Also converts values to other types if specified. + * @param message PreviewCreateGameServerClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreviewCreateGameServerClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PreviewCreateGameServerClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PreviewCreateGameServerClusterResponse. */ + interface IPreviewCreateGameServerClusterResponse { + + /** PreviewCreateGameServerClusterResponse etag */ + etag?: (string|null); + + /** PreviewCreateGameServerClusterResponse targetState */ + targetState?: (google.cloud.gaming.v1.ITargetState|null); + + /** PreviewCreateGameServerClusterResponse clusterState */ + clusterState?: (google.cloud.gaming.v1.IKubernetesClusterState|null); + } + + /** Represents a PreviewCreateGameServerClusterResponse. */ + class PreviewCreateGameServerClusterResponse implements IPreviewCreateGameServerClusterResponse { + + /** + * Constructs a new PreviewCreateGameServerClusterResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse); + + /** PreviewCreateGameServerClusterResponse etag. */ + public etag: string; + + /** PreviewCreateGameServerClusterResponse targetState. */ + public targetState?: (google.cloud.gaming.v1.ITargetState|null); + + /** PreviewCreateGameServerClusterResponse clusterState. */ + public clusterState?: (google.cloud.gaming.v1.IKubernetesClusterState|null); + + /** + * Creates a new PreviewCreateGameServerClusterResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PreviewCreateGameServerClusterResponse instance + */ + public static create(properties?: google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse): google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse; + + /** + * Encodes the specified PreviewCreateGameServerClusterResponse message. Does not implicitly {@link google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse.verify|verify} messages. + * @param message PreviewCreateGameServerClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreviewCreateGameServerClusterResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse.verify|verify} messages. + * @param message PreviewCreateGameServerClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreviewCreateGameServerClusterResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreviewCreateGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse; + + /** + * Decodes a PreviewCreateGameServerClusterResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreviewCreateGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse; + + /** + * Verifies a PreviewCreateGameServerClusterResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreviewCreateGameServerClusterResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreviewCreateGameServerClusterResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse; + + /** + * Creates a plain object from a PreviewCreateGameServerClusterResponse message. Also converts values to other types if specified. + * @param message PreviewCreateGameServerClusterResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreviewCreateGameServerClusterResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PreviewCreateGameServerClusterResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteGameServerClusterRequest. */ + interface IDeleteGameServerClusterRequest { + + /** DeleteGameServerClusterRequest name */ + name?: (string|null); + } + + /** Represents a DeleteGameServerClusterRequest. */ + class DeleteGameServerClusterRequest implements IDeleteGameServerClusterRequest { + + /** + * Constructs a new DeleteGameServerClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IDeleteGameServerClusterRequest); + + /** DeleteGameServerClusterRequest name. */ + public name: string; + + /** + * Creates a new DeleteGameServerClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGameServerClusterRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IDeleteGameServerClusterRequest): google.cloud.gaming.v1.DeleteGameServerClusterRequest; + + /** + * Encodes the specified DeleteGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1.DeleteGameServerClusterRequest.verify|verify} messages. + * @param message DeleteGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IDeleteGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.DeleteGameServerClusterRequest.verify|verify} messages. + * @param message DeleteGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IDeleteGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGameServerClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.DeleteGameServerClusterRequest; + + /** + * Decodes a DeleteGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.DeleteGameServerClusterRequest; + + /** + * Verifies a DeleteGameServerClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGameServerClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.DeleteGameServerClusterRequest; + + /** + * Creates a plain object from a DeleteGameServerClusterRequest message. Also converts values to other types if specified. + * @param message DeleteGameServerClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.DeleteGameServerClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGameServerClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteGameServerClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PreviewDeleteGameServerClusterRequest. */ + interface IPreviewDeleteGameServerClusterRequest { + + /** PreviewDeleteGameServerClusterRequest name */ + name?: (string|null); + + /** PreviewDeleteGameServerClusterRequest previewTime */ + previewTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a PreviewDeleteGameServerClusterRequest. */ + class PreviewDeleteGameServerClusterRequest implements IPreviewDeleteGameServerClusterRequest { + + /** + * Constructs a new PreviewDeleteGameServerClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest); + + /** PreviewDeleteGameServerClusterRequest name. */ + public name: string; + + /** PreviewDeleteGameServerClusterRequest previewTime. */ + public previewTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new PreviewDeleteGameServerClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PreviewDeleteGameServerClusterRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest): google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest; + + /** + * Encodes the specified PreviewDeleteGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest.verify|verify} messages. + * @param message PreviewDeleteGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreviewDeleteGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest.verify|verify} messages. + * @param message PreviewDeleteGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreviewDeleteGameServerClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreviewDeleteGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest; + + /** + * Decodes a PreviewDeleteGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreviewDeleteGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest; + + /** + * Verifies a PreviewDeleteGameServerClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreviewDeleteGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreviewDeleteGameServerClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest; + + /** + * Creates a plain object from a PreviewDeleteGameServerClusterRequest message. Also converts values to other types if specified. + * @param message PreviewDeleteGameServerClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreviewDeleteGameServerClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PreviewDeleteGameServerClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PreviewDeleteGameServerClusterResponse. */ + interface IPreviewDeleteGameServerClusterResponse { + + /** PreviewDeleteGameServerClusterResponse etag */ + etag?: (string|null); + + /** PreviewDeleteGameServerClusterResponse targetState */ + targetState?: (google.cloud.gaming.v1.ITargetState|null); + } + + /** Represents a PreviewDeleteGameServerClusterResponse. */ + class PreviewDeleteGameServerClusterResponse implements IPreviewDeleteGameServerClusterResponse { + + /** + * Constructs a new PreviewDeleteGameServerClusterResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse); + + /** PreviewDeleteGameServerClusterResponse etag. */ + public etag: string; + + /** PreviewDeleteGameServerClusterResponse targetState. */ + public targetState?: (google.cloud.gaming.v1.ITargetState|null); + + /** + * Creates a new PreviewDeleteGameServerClusterResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PreviewDeleteGameServerClusterResponse instance + */ + public static create(properties?: google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse): google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse; + + /** + * Encodes the specified PreviewDeleteGameServerClusterResponse message. Does not implicitly {@link google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse.verify|verify} messages. + * @param message PreviewDeleteGameServerClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreviewDeleteGameServerClusterResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse.verify|verify} messages. + * @param message PreviewDeleteGameServerClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreviewDeleteGameServerClusterResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreviewDeleteGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse; + + /** + * Decodes a PreviewDeleteGameServerClusterResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreviewDeleteGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse; + + /** + * Verifies a PreviewDeleteGameServerClusterResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreviewDeleteGameServerClusterResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreviewDeleteGameServerClusterResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse; + + /** + * Creates a plain object from a PreviewDeleteGameServerClusterResponse message. Also converts values to other types if specified. + * @param message PreviewDeleteGameServerClusterResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreviewDeleteGameServerClusterResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PreviewDeleteGameServerClusterResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateGameServerClusterRequest. */ + interface IUpdateGameServerClusterRequest { + + /** UpdateGameServerClusterRequest gameServerCluster */ + gameServerCluster?: (google.cloud.gaming.v1.IGameServerCluster|null); + + /** UpdateGameServerClusterRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateGameServerClusterRequest. */ + class UpdateGameServerClusterRequest implements IUpdateGameServerClusterRequest { + + /** + * Constructs a new UpdateGameServerClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IUpdateGameServerClusterRequest); + + /** UpdateGameServerClusterRequest gameServerCluster. */ + public gameServerCluster?: (google.cloud.gaming.v1.IGameServerCluster|null); + + /** UpdateGameServerClusterRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateGameServerClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateGameServerClusterRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IUpdateGameServerClusterRequest): google.cloud.gaming.v1.UpdateGameServerClusterRequest; + + /** + * Encodes the specified UpdateGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1.UpdateGameServerClusterRequest.verify|verify} messages. + * @param message UpdateGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IUpdateGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.UpdateGameServerClusterRequest.verify|verify} messages. + * @param message UpdateGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IUpdateGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateGameServerClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.UpdateGameServerClusterRequest; + + /** + * Decodes an UpdateGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.UpdateGameServerClusterRequest; + + /** + * Verifies an UpdateGameServerClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateGameServerClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.UpdateGameServerClusterRequest; + + /** + * Creates a plain object from an UpdateGameServerClusterRequest message. Also converts values to other types if specified. + * @param message UpdateGameServerClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.UpdateGameServerClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateGameServerClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateGameServerClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PreviewUpdateGameServerClusterRequest. */ + interface IPreviewUpdateGameServerClusterRequest { + + /** PreviewUpdateGameServerClusterRequest gameServerCluster */ + gameServerCluster?: (google.cloud.gaming.v1.IGameServerCluster|null); + + /** PreviewUpdateGameServerClusterRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** PreviewUpdateGameServerClusterRequest previewTime */ + previewTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a PreviewUpdateGameServerClusterRequest. */ + class PreviewUpdateGameServerClusterRequest implements IPreviewUpdateGameServerClusterRequest { + + /** + * Constructs a new PreviewUpdateGameServerClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest); + + /** PreviewUpdateGameServerClusterRequest gameServerCluster. */ + public gameServerCluster?: (google.cloud.gaming.v1.IGameServerCluster|null); + + /** PreviewUpdateGameServerClusterRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** PreviewUpdateGameServerClusterRequest previewTime. */ + public previewTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new PreviewUpdateGameServerClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PreviewUpdateGameServerClusterRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest): google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest; + + /** + * Encodes the specified PreviewUpdateGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest.verify|verify} messages. + * @param message PreviewUpdateGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreviewUpdateGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest.verify|verify} messages. + * @param message PreviewUpdateGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreviewUpdateGameServerClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreviewUpdateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest; + + /** + * Decodes a PreviewUpdateGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreviewUpdateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest; + + /** + * Verifies a PreviewUpdateGameServerClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreviewUpdateGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreviewUpdateGameServerClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest; + + /** + * Creates a plain object from a PreviewUpdateGameServerClusterRequest message. Also converts values to other types if specified. + * @param message PreviewUpdateGameServerClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreviewUpdateGameServerClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PreviewUpdateGameServerClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PreviewUpdateGameServerClusterResponse. */ + interface IPreviewUpdateGameServerClusterResponse { + + /** PreviewUpdateGameServerClusterResponse etag */ + etag?: (string|null); + + /** PreviewUpdateGameServerClusterResponse targetState */ + targetState?: (google.cloud.gaming.v1.ITargetState|null); + } + + /** Represents a PreviewUpdateGameServerClusterResponse. */ + class PreviewUpdateGameServerClusterResponse implements IPreviewUpdateGameServerClusterResponse { + + /** + * Constructs a new PreviewUpdateGameServerClusterResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse); + + /** PreviewUpdateGameServerClusterResponse etag. */ + public etag: string; + + /** PreviewUpdateGameServerClusterResponse targetState. */ + public targetState?: (google.cloud.gaming.v1.ITargetState|null); + + /** + * Creates a new PreviewUpdateGameServerClusterResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PreviewUpdateGameServerClusterResponse instance + */ + public static create(properties?: google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse): google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse; + + /** + * Encodes the specified PreviewUpdateGameServerClusterResponse message. Does not implicitly {@link google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse.verify|verify} messages. + * @param message PreviewUpdateGameServerClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreviewUpdateGameServerClusterResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse.verify|verify} messages. + * @param message PreviewUpdateGameServerClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreviewUpdateGameServerClusterResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreviewUpdateGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse; + + /** + * Decodes a PreviewUpdateGameServerClusterResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreviewUpdateGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse; + + /** + * Verifies a PreviewUpdateGameServerClusterResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreviewUpdateGameServerClusterResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreviewUpdateGameServerClusterResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse; + + /** + * Creates a plain object from a PreviewUpdateGameServerClusterResponse message. Also converts values to other types if specified. + * @param message PreviewUpdateGameServerClusterResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreviewUpdateGameServerClusterResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PreviewUpdateGameServerClusterResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GameServerClusterConnectionInfo. */ + interface IGameServerClusterConnectionInfo { + + /** GameServerClusterConnectionInfo gkeClusterReference */ + gkeClusterReference?: (google.cloud.gaming.v1.IGkeClusterReference|null); + + /** GameServerClusterConnectionInfo namespace */ + namespace?: (string|null); + } + + /** Represents a GameServerClusterConnectionInfo. */ + class GameServerClusterConnectionInfo implements IGameServerClusterConnectionInfo { + + /** + * Constructs a new GameServerClusterConnectionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IGameServerClusterConnectionInfo); + + /** GameServerClusterConnectionInfo gkeClusterReference. */ + public gkeClusterReference?: (google.cloud.gaming.v1.IGkeClusterReference|null); + + /** GameServerClusterConnectionInfo namespace. */ + public namespace: string; + + /** GameServerClusterConnectionInfo clusterReference. */ + public clusterReference?: "gkeClusterReference"; + + /** + * Creates a new GameServerClusterConnectionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GameServerClusterConnectionInfo instance + */ + public static create(properties?: google.cloud.gaming.v1.IGameServerClusterConnectionInfo): google.cloud.gaming.v1.GameServerClusterConnectionInfo; + + /** + * Encodes the specified GameServerClusterConnectionInfo message. Does not implicitly {@link google.cloud.gaming.v1.GameServerClusterConnectionInfo.verify|verify} messages. + * @param message GameServerClusterConnectionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IGameServerClusterConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GameServerClusterConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GameServerClusterConnectionInfo.verify|verify} messages. + * @param message GameServerClusterConnectionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IGameServerClusterConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GameServerClusterConnectionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GameServerClusterConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.GameServerClusterConnectionInfo; + + /** + * Decodes a GameServerClusterConnectionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GameServerClusterConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.GameServerClusterConnectionInfo; + + /** + * Verifies a GameServerClusterConnectionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GameServerClusterConnectionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GameServerClusterConnectionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.GameServerClusterConnectionInfo; + + /** + * Creates a plain object from a GameServerClusterConnectionInfo message. Also converts values to other types if specified. + * @param message GameServerClusterConnectionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.GameServerClusterConnectionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GameServerClusterConnectionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GameServerClusterConnectionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GkeClusterReference. */ + interface IGkeClusterReference { + + /** GkeClusterReference cluster */ + cluster?: (string|null); + } + + /** Represents a GkeClusterReference. */ + class GkeClusterReference implements IGkeClusterReference { + + /** + * Constructs a new GkeClusterReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IGkeClusterReference); + + /** GkeClusterReference cluster. */ + public cluster: string; + + /** + * Creates a new GkeClusterReference instance using the specified properties. + * @param [properties] Properties to set + * @returns GkeClusterReference instance + */ + public static create(properties?: google.cloud.gaming.v1.IGkeClusterReference): google.cloud.gaming.v1.GkeClusterReference; + + /** + * Encodes the specified GkeClusterReference message. Does not implicitly {@link google.cloud.gaming.v1.GkeClusterReference.verify|verify} messages. + * @param message GkeClusterReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IGkeClusterReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GkeClusterReference message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GkeClusterReference.verify|verify} messages. + * @param message GkeClusterReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IGkeClusterReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GkeClusterReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GkeClusterReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.GkeClusterReference; + + /** + * Decodes a GkeClusterReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GkeClusterReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.GkeClusterReference; + + /** + * Verifies a GkeClusterReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GkeClusterReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GkeClusterReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.GkeClusterReference; + + /** + * Creates a plain object from a GkeClusterReference message. Also converts values to other types if specified. + * @param message GkeClusterReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.GkeClusterReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GkeClusterReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GkeClusterReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GameServerCluster. */ + interface IGameServerCluster { + + /** GameServerCluster name */ + name?: (string|null); + + /** GameServerCluster createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** GameServerCluster updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** GameServerCluster labels */ + labels?: ({ [k: string]: string }|null); + + /** GameServerCluster connectionInfo */ + connectionInfo?: (google.cloud.gaming.v1.IGameServerClusterConnectionInfo|null); + + /** GameServerCluster etag */ + etag?: (string|null); + + /** GameServerCluster description */ + description?: (string|null); + + /** GameServerCluster clusterState */ + clusterState?: (google.cloud.gaming.v1.IKubernetesClusterState|null); + } + + /** Represents a GameServerCluster. */ + class GameServerCluster implements IGameServerCluster { + + /** + * Constructs a new GameServerCluster. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IGameServerCluster); + + /** GameServerCluster name. */ + public name: string; + + /** GameServerCluster createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** GameServerCluster updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** GameServerCluster labels. */ + public labels: { [k: string]: string }; + + /** GameServerCluster connectionInfo. */ + public connectionInfo?: (google.cloud.gaming.v1.IGameServerClusterConnectionInfo|null); + + /** GameServerCluster etag. */ + public etag: string; + + /** GameServerCluster description. */ + public description: string; + + /** GameServerCluster clusterState. */ + public clusterState?: (google.cloud.gaming.v1.IKubernetesClusterState|null); + + /** + * Creates a new GameServerCluster instance using the specified properties. + * @param [properties] Properties to set + * @returns GameServerCluster instance + */ + public static create(properties?: google.cloud.gaming.v1.IGameServerCluster): google.cloud.gaming.v1.GameServerCluster; + + /** + * Encodes the specified GameServerCluster message. Does not implicitly {@link google.cloud.gaming.v1.GameServerCluster.verify|verify} messages. + * @param message GameServerCluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IGameServerCluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GameServerCluster message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GameServerCluster.verify|verify} messages. + * @param message GameServerCluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IGameServerCluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GameServerCluster message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GameServerCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.GameServerCluster; + + /** + * Decodes a GameServerCluster message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GameServerCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.GameServerCluster; + + /** + * Verifies a GameServerCluster message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GameServerCluster message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GameServerCluster + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.GameServerCluster; + + /** + * Creates a plain object from a GameServerCluster message. Also converts values to other types if specified. + * @param message GameServerCluster + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.GameServerCluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GameServerCluster to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GameServerCluster + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a KubernetesClusterState. */ + interface IKubernetesClusterState { + + /** KubernetesClusterState agonesVersionInstalled */ + agonesVersionInstalled?: (string|null); + + /** KubernetesClusterState kubernetesVersionInstalled */ + kubernetesVersionInstalled?: (string|null); + + /** KubernetesClusterState installationState */ + installationState?: (google.cloud.gaming.v1.KubernetesClusterState.InstallationState|keyof typeof google.cloud.gaming.v1.KubernetesClusterState.InstallationState|null); + + /** KubernetesClusterState versionInstalledErrorMessage */ + versionInstalledErrorMessage?: (string|null); + + /** KubernetesClusterState provider */ + provider?: (string|null); + + /** KubernetesClusterState agonesVersionTargeted */ + agonesVersionTargeted?: (string|null); + } + + /** Represents a KubernetesClusterState. */ + class KubernetesClusterState implements IKubernetesClusterState { + + /** + * Constructs a new KubernetesClusterState. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IKubernetesClusterState); + + /** KubernetesClusterState agonesVersionInstalled. */ + public agonesVersionInstalled: string; + + /** KubernetesClusterState kubernetesVersionInstalled. */ + public kubernetesVersionInstalled: string; + + /** KubernetesClusterState installationState. */ + public installationState: (google.cloud.gaming.v1.KubernetesClusterState.InstallationState|keyof typeof google.cloud.gaming.v1.KubernetesClusterState.InstallationState); + + /** KubernetesClusterState versionInstalledErrorMessage. */ + public versionInstalledErrorMessage: string; + + /** KubernetesClusterState provider. */ + public provider: string; + + /** KubernetesClusterState agonesVersionTargeted. */ + public agonesVersionTargeted: string; + + /** + * Creates a new KubernetesClusterState instance using the specified properties. + * @param [properties] Properties to set + * @returns KubernetesClusterState instance + */ + public static create(properties?: google.cloud.gaming.v1.IKubernetesClusterState): google.cloud.gaming.v1.KubernetesClusterState; + + /** + * Encodes the specified KubernetesClusterState message. Does not implicitly {@link google.cloud.gaming.v1.KubernetesClusterState.verify|verify} messages. + * @param message KubernetesClusterState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IKubernetesClusterState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KubernetesClusterState message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.KubernetesClusterState.verify|verify} messages. + * @param message KubernetesClusterState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IKubernetesClusterState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KubernetesClusterState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KubernetesClusterState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.KubernetesClusterState; + + /** + * Decodes a KubernetesClusterState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KubernetesClusterState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.KubernetesClusterState; + + /** + * Verifies a KubernetesClusterState message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KubernetesClusterState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KubernetesClusterState + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.KubernetesClusterState; + + /** + * Creates a plain object from a KubernetesClusterState message. Also converts values to other types if specified. + * @param message KubernetesClusterState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.KubernetesClusterState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KubernetesClusterState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for KubernetesClusterState + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace KubernetesClusterState { + + /** InstallationState enum. */ + enum InstallationState { + INSTALLATION_STATE_UNSPECIFIED = 0, + AGONES_KUBERNETES_VERSION_SUPPORTED = 1, + AGONES_VERSION_UNSUPPORTED = 2, + AGONES_KUBERNETES_VERSION_UNSUPPORTED = 3, + AGONES_VERSION_UNRECOGNIZED = 4, + KUBERNETES_VERSION_UNRECOGNIZED = 5, + VERSION_VERIFICATION_FAILED = 6, + AGONES_NOT_INSTALLED = 7 + } + } + + /** Represents a GameServerClustersService */ + class GameServerClustersService extends $protobuf.rpc.Service { + + /** + * Constructs a new GameServerClustersService 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 GameServerClustersService 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): GameServerClustersService; + + /** + * Calls ListGameServerClusters. + * @param request ListGameServerClustersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListGameServerClustersResponse + */ + public listGameServerClusters(request: google.cloud.gaming.v1.IListGameServerClustersRequest, callback: google.cloud.gaming.v1.GameServerClustersService.ListGameServerClustersCallback): void; + + /** + * Calls ListGameServerClusters. + * @param request ListGameServerClustersRequest message or plain object + * @returns Promise + */ + public listGameServerClusters(request: google.cloud.gaming.v1.IListGameServerClustersRequest): Promise; + + /** + * Calls GetGameServerCluster. + * @param request GetGameServerClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GameServerCluster + */ + public getGameServerCluster(request: google.cloud.gaming.v1.IGetGameServerClusterRequest, callback: google.cloud.gaming.v1.GameServerClustersService.GetGameServerClusterCallback): void; + + /** + * Calls GetGameServerCluster. + * @param request GetGameServerClusterRequest message or plain object + * @returns Promise + */ + public getGameServerCluster(request: google.cloud.gaming.v1.IGetGameServerClusterRequest): Promise; + + /** + * Calls CreateGameServerCluster. + * @param request CreateGameServerClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createGameServerCluster(request: google.cloud.gaming.v1.ICreateGameServerClusterRequest, callback: google.cloud.gaming.v1.GameServerClustersService.CreateGameServerClusterCallback): void; + + /** + * Calls CreateGameServerCluster. + * @param request CreateGameServerClusterRequest message or plain object + * @returns Promise + */ + public createGameServerCluster(request: google.cloud.gaming.v1.ICreateGameServerClusterRequest): Promise; + + /** + * Calls PreviewCreateGameServerCluster. + * @param request PreviewCreateGameServerClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PreviewCreateGameServerClusterResponse + */ + public previewCreateGameServerCluster(request: google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest, callback: google.cloud.gaming.v1.GameServerClustersService.PreviewCreateGameServerClusterCallback): void; + + /** + * Calls PreviewCreateGameServerCluster. + * @param request PreviewCreateGameServerClusterRequest message or plain object + * @returns Promise + */ + public previewCreateGameServerCluster(request: google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest): Promise; + + /** + * Calls DeleteGameServerCluster. + * @param request DeleteGameServerClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteGameServerCluster(request: google.cloud.gaming.v1.IDeleteGameServerClusterRequest, callback: google.cloud.gaming.v1.GameServerClustersService.DeleteGameServerClusterCallback): void; + + /** + * Calls DeleteGameServerCluster. + * @param request DeleteGameServerClusterRequest message or plain object + * @returns Promise + */ + public deleteGameServerCluster(request: google.cloud.gaming.v1.IDeleteGameServerClusterRequest): Promise; + + /** + * Calls PreviewDeleteGameServerCluster. + * @param request PreviewDeleteGameServerClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PreviewDeleteGameServerClusterResponse + */ + public previewDeleteGameServerCluster(request: google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest, callback: google.cloud.gaming.v1.GameServerClustersService.PreviewDeleteGameServerClusterCallback): void; + + /** + * Calls PreviewDeleteGameServerCluster. + * @param request PreviewDeleteGameServerClusterRequest message or plain object + * @returns Promise + */ + public previewDeleteGameServerCluster(request: google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest): Promise; + + /** + * Calls UpdateGameServerCluster. + * @param request UpdateGameServerClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateGameServerCluster(request: google.cloud.gaming.v1.IUpdateGameServerClusterRequest, callback: google.cloud.gaming.v1.GameServerClustersService.UpdateGameServerClusterCallback): void; + + /** + * Calls UpdateGameServerCluster. + * @param request UpdateGameServerClusterRequest message or plain object + * @returns Promise + */ + public updateGameServerCluster(request: google.cloud.gaming.v1.IUpdateGameServerClusterRequest): Promise; + + /** + * Calls PreviewUpdateGameServerCluster. + * @param request PreviewUpdateGameServerClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PreviewUpdateGameServerClusterResponse + */ + public previewUpdateGameServerCluster(request: google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest, callback: google.cloud.gaming.v1.GameServerClustersService.PreviewUpdateGameServerClusterCallback): void; + + /** + * Calls PreviewUpdateGameServerCluster. + * @param request PreviewUpdateGameServerClusterRequest message or plain object + * @returns Promise + */ + public previewUpdateGameServerCluster(request: google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest): Promise; + } + + namespace GameServerClustersService { + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|listGameServerClusters}. + * @param error Error, if any + * @param [response] ListGameServerClustersResponse + */ + type ListGameServerClustersCallback = (error: (Error|null), response?: google.cloud.gaming.v1.ListGameServerClustersResponse) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|getGameServerCluster}. + * @param error Error, if any + * @param [response] GameServerCluster + */ + type GetGameServerClusterCallback = (error: (Error|null), response?: google.cloud.gaming.v1.GameServerCluster) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|createGameServerCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateGameServerClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|previewCreateGameServerCluster}. + * @param error Error, if any + * @param [response] PreviewCreateGameServerClusterResponse + */ + type PreviewCreateGameServerClusterCallback = (error: (Error|null), response?: google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|deleteGameServerCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteGameServerClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|previewDeleteGameServerCluster}. + * @param error Error, if any + * @param [response] PreviewDeleteGameServerClusterResponse + */ + type PreviewDeleteGameServerClusterCallback = (error: (Error|null), response?: google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|updateGameServerCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateGameServerClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|previewUpdateGameServerCluster}. + * @param error Error, if any + * @param [response] PreviewUpdateGameServerClusterResponse + */ + type PreviewUpdateGameServerClusterCallback = (error: (Error|null), response?: google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse) => void; + } + + /** Properties of a ListGameServerConfigsRequest. */ + interface IListGameServerConfigsRequest { + + /** ListGameServerConfigsRequest parent */ + parent?: (string|null); + + /** ListGameServerConfigsRequest pageSize */ + pageSize?: (number|null); + + /** ListGameServerConfigsRequest pageToken */ + pageToken?: (string|null); + + /** ListGameServerConfigsRequest filter */ + filter?: (string|null); + + /** ListGameServerConfigsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListGameServerConfigsRequest. */ + class ListGameServerConfigsRequest implements IListGameServerConfigsRequest { + + /** + * Constructs a new ListGameServerConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IListGameServerConfigsRequest); + + /** ListGameServerConfigsRequest parent. */ + public parent: string; + + /** ListGameServerConfigsRequest pageSize. */ + public pageSize: number; + + /** ListGameServerConfigsRequest pageToken. */ + public pageToken: string; + + /** ListGameServerConfigsRequest filter. */ + public filter: string; + + /** ListGameServerConfigsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListGameServerConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGameServerConfigsRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IListGameServerConfigsRequest): google.cloud.gaming.v1.ListGameServerConfigsRequest; + + /** + * Encodes the specified ListGameServerConfigsRequest message. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerConfigsRequest.verify|verify} messages. + * @param message ListGameServerConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IListGameServerConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGameServerConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerConfigsRequest.verify|verify} messages. + * @param message ListGameServerConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IListGameServerConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGameServerConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGameServerConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.ListGameServerConfigsRequest; + + /** + * Decodes a ListGameServerConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGameServerConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.ListGameServerConfigsRequest; + + /** + * Verifies a ListGameServerConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGameServerConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGameServerConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.ListGameServerConfigsRequest; + + /** + * Creates a plain object from a ListGameServerConfigsRequest message. Also converts values to other types if specified. + * @param message ListGameServerConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.ListGameServerConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGameServerConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGameServerConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGameServerConfigsResponse. */ + interface IListGameServerConfigsResponse { + + /** ListGameServerConfigsResponse gameServerConfigs */ + gameServerConfigs?: (google.cloud.gaming.v1.IGameServerConfig[]|null); + + /** ListGameServerConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListGameServerConfigsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListGameServerConfigsResponse. */ + class ListGameServerConfigsResponse implements IListGameServerConfigsResponse { + + /** + * Constructs a new ListGameServerConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IListGameServerConfigsResponse); + + /** ListGameServerConfigsResponse gameServerConfigs. */ + public gameServerConfigs: google.cloud.gaming.v1.IGameServerConfig[]; + + /** ListGameServerConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListGameServerConfigsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListGameServerConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGameServerConfigsResponse instance + */ + public static create(properties?: google.cloud.gaming.v1.IListGameServerConfigsResponse): google.cloud.gaming.v1.ListGameServerConfigsResponse; + + /** + * Encodes the specified ListGameServerConfigsResponse message. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerConfigsResponse.verify|verify} messages. + * @param message ListGameServerConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IListGameServerConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGameServerConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerConfigsResponse.verify|verify} messages. + * @param message ListGameServerConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IListGameServerConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGameServerConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGameServerConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.ListGameServerConfigsResponse; + + /** + * Decodes a ListGameServerConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGameServerConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.ListGameServerConfigsResponse; + + /** + * Verifies a ListGameServerConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGameServerConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGameServerConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.ListGameServerConfigsResponse; + + /** + * Creates a plain object from a ListGameServerConfigsResponse message. Also converts values to other types if specified. + * @param message ListGameServerConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.ListGameServerConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGameServerConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGameServerConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetGameServerConfigRequest. */ + interface IGetGameServerConfigRequest { + + /** GetGameServerConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetGameServerConfigRequest. */ + class GetGameServerConfigRequest implements IGetGameServerConfigRequest { + + /** + * Constructs a new GetGameServerConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IGetGameServerConfigRequest); + + /** GetGameServerConfigRequest name. */ + public name: string; + + /** + * Creates a new GetGameServerConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGameServerConfigRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IGetGameServerConfigRequest): google.cloud.gaming.v1.GetGameServerConfigRequest; + + /** + * Encodes the specified GetGameServerConfigRequest message. Does not implicitly {@link google.cloud.gaming.v1.GetGameServerConfigRequest.verify|verify} messages. + * @param message GetGameServerConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IGetGameServerConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGameServerConfigRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GetGameServerConfigRequest.verify|verify} messages. + * @param message GetGameServerConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IGetGameServerConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGameServerConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.GetGameServerConfigRequest; + + /** + * Decodes a GetGameServerConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.GetGameServerConfigRequest; + + /** + * Verifies a GetGameServerConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGameServerConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGameServerConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.GetGameServerConfigRequest; + + /** + * Creates a plain object from a GetGameServerConfigRequest message. Also converts values to other types if specified. + * @param message GetGameServerConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.GetGameServerConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGameServerConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGameServerConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateGameServerConfigRequest. */ + interface ICreateGameServerConfigRequest { + + /** CreateGameServerConfigRequest parent */ + parent?: (string|null); + + /** CreateGameServerConfigRequest configId */ + configId?: (string|null); + + /** CreateGameServerConfigRequest gameServerConfig */ + gameServerConfig?: (google.cloud.gaming.v1.IGameServerConfig|null); + } + + /** Represents a CreateGameServerConfigRequest. */ + class CreateGameServerConfigRequest implements ICreateGameServerConfigRequest { + + /** + * Constructs a new CreateGameServerConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.ICreateGameServerConfigRequest); + + /** CreateGameServerConfigRequest parent. */ + public parent: string; + + /** CreateGameServerConfigRequest configId. */ + public configId: string; + + /** CreateGameServerConfigRequest gameServerConfig. */ + public gameServerConfig?: (google.cloud.gaming.v1.IGameServerConfig|null); + + /** + * Creates a new CreateGameServerConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGameServerConfigRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.ICreateGameServerConfigRequest): google.cloud.gaming.v1.CreateGameServerConfigRequest; + + /** + * Encodes the specified CreateGameServerConfigRequest message. Does not implicitly {@link google.cloud.gaming.v1.CreateGameServerConfigRequest.verify|verify} messages. + * @param message CreateGameServerConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.ICreateGameServerConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateGameServerConfigRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.CreateGameServerConfigRequest.verify|verify} messages. + * @param message CreateGameServerConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.ICreateGameServerConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateGameServerConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.CreateGameServerConfigRequest; + + /** + * Decodes a CreateGameServerConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.CreateGameServerConfigRequest; + + /** + * Verifies a CreateGameServerConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateGameServerConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateGameServerConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.CreateGameServerConfigRequest; + + /** + * Creates a plain object from a CreateGameServerConfigRequest message. Also converts values to other types if specified. + * @param message CreateGameServerConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.CreateGameServerConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateGameServerConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateGameServerConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteGameServerConfigRequest. */ + interface IDeleteGameServerConfigRequest { + + /** DeleteGameServerConfigRequest name */ + name?: (string|null); + } + + /** Represents a DeleteGameServerConfigRequest. */ + class DeleteGameServerConfigRequest implements IDeleteGameServerConfigRequest { + + /** + * Constructs a new DeleteGameServerConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IDeleteGameServerConfigRequest); + + /** DeleteGameServerConfigRequest name. */ + public name: string; + + /** + * Creates a new DeleteGameServerConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGameServerConfigRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IDeleteGameServerConfigRequest): google.cloud.gaming.v1.DeleteGameServerConfigRequest; + + /** + * Encodes the specified DeleteGameServerConfigRequest message. Does not implicitly {@link google.cloud.gaming.v1.DeleteGameServerConfigRequest.verify|verify} messages. + * @param message DeleteGameServerConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IDeleteGameServerConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGameServerConfigRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.DeleteGameServerConfigRequest.verify|verify} messages. + * @param message DeleteGameServerConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IDeleteGameServerConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGameServerConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.DeleteGameServerConfigRequest; + + /** + * Decodes a DeleteGameServerConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.DeleteGameServerConfigRequest; + + /** + * Verifies a DeleteGameServerConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGameServerConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGameServerConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.DeleteGameServerConfigRequest; + + /** + * Creates a plain object from a DeleteGameServerConfigRequest message. Also converts values to other types if specified. + * @param message DeleteGameServerConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.DeleteGameServerConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGameServerConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteGameServerConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScalingConfig. */ + interface IScalingConfig { + + /** ScalingConfig name */ + name?: (string|null); + + /** ScalingConfig fleetAutoscalerSpec */ + fleetAutoscalerSpec?: (string|null); + + /** ScalingConfig selectors */ + selectors?: (google.cloud.gaming.v1.ILabelSelector[]|null); + + /** ScalingConfig schedules */ + schedules?: (google.cloud.gaming.v1.ISchedule[]|null); + } + + /** Represents a ScalingConfig. */ + class ScalingConfig implements IScalingConfig { + + /** + * Constructs a new ScalingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IScalingConfig); + + /** ScalingConfig name. */ + public name: string; + + /** ScalingConfig fleetAutoscalerSpec. */ + public fleetAutoscalerSpec: string; + + /** ScalingConfig selectors. */ + public selectors: google.cloud.gaming.v1.ILabelSelector[]; + + /** ScalingConfig schedules. */ + public schedules: google.cloud.gaming.v1.ISchedule[]; + + /** + * Creates a new ScalingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ScalingConfig instance + */ + public static create(properties?: google.cloud.gaming.v1.IScalingConfig): google.cloud.gaming.v1.ScalingConfig; + + /** + * Encodes the specified ScalingConfig message. Does not implicitly {@link google.cloud.gaming.v1.ScalingConfig.verify|verify} messages. + * @param message ScalingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IScalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScalingConfig message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.ScalingConfig.verify|verify} messages. + * @param message ScalingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IScalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScalingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.ScalingConfig; + + /** + * Decodes a ScalingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.ScalingConfig; + + /** + * Verifies a ScalingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScalingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScalingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.ScalingConfig; + + /** + * Creates a plain object from a ScalingConfig message. Also converts values to other types if specified. + * @param message ScalingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.ScalingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScalingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScalingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FleetConfig. */ + interface IFleetConfig { + + /** FleetConfig fleetSpec */ + fleetSpec?: (string|null); + + /** FleetConfig name */ + name?: (string|null); + } + + /** Represents a FleetConfig. */ + class FleetConfig implements IFleetConfig { + + /** + * Constructs a new FleetConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IFleetConfig); + + /** FleetConfig fleetSpec. */ + public fleetSpec: string; + + /** FleetConfig name. */ + public name: string; + + /** + * Creates a new FleetConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns FleetConfig instance + */ + public static create(properties?: google.cloud.gaming.v1.IFleetConfig): google.cloud.gaming.v1.FleetConfig; + + /** + * Encodes the specified FleetConfig message. Does not implicitly {@link google.cloud.gaming.v1.FleetConfig.verify|verify} messages. + * @param message FleetConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IFleetConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FleetConfig message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.FleetConfig.verify|verify} messages. + * @param message FleetConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IFleetConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FleetConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FleetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.FleetConfig; + + /** + * Decodes a FleetConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FleetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.FleetConfig; + + /** + * Verifies a FleetConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FleetConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FleetConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.FleetConfig; + + /** + * Creates a plain object from a FleetConfig message. Also converts values to other types if specified. + * @param message FleetConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.FleetConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FleetConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FleetConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GameServerConfig. */ + interface IGameServerConfig { + + /** GameServerConfig name */ + name?: (string|null); + + /** GameServerConfig createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** GameServerConfig updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** GameServerConfig labels */ + labels?: ({ [k: string]: string }|null); + + /** GameServerConfig fleetConfigs */ + fleetConfigs?: (google.cloud.gaming.v1.IFleetConfig[]|null); + + /** GameServerConfig scalingConfigs */ + scalingConfigs?: (google.cloud.gaming.v1.IScalingConfig[]|null); + + /** GameServerConfig description */ + description?: (string|null); + } + + /** Represents a GameServerConfig. */ + class GameServerConfig implements IGameServerConfig { + + /** + * Constructs a new GameServerConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IGameServerConfig); + + /** GameServerConfig name. */ + public name: string; + + /** GameServerConfig createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** GameServerConfig updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** GameServerConfig labels. */ + public labels: { [k: string]: string }; + + /** GameServerConfig fleetConfigs. */ + public fleetConfigs: google.cloud.gaming.v1.IFleetConfig[]; + + /** GameServerConfig scalingConfigs. */ + public scalingConfigs: google.cloud.gaming.v1.IScalingConfig[]; + + /** GameServerConfig description. */ + public description: string; + + /** + * Creates a new GameServerConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GameServerConfig instance + */ + public static create(properties?: google.cloud.gaming.v1.IGameServerConfig): google.cloud.gaming.v1.GameServerConfig; + + /** + * Encodes the specified GameServerConfig message. Does not implicitly {@link google.cloud.gaming.v1.GameServerConfig.verify|verify} messages. + * @param message GameServerConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IGameServerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GameServerConfig message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GameServerConfig.verify|verify} messages. + * @param message GameServerConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IGameServerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GameServerConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GameServerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.GameServerConfig; + + /** + * Decodes a GameServerConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GameServerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.GameServerConfig; + + /** + * Verifies a GameServerConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GameServerConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GameServerConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.GameServerConfig; + + /** + * Creates a plain object from a GameServerConfig message. Also converts values to other types if specified. + * @param message GameServerConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.GameServerConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GameServerConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GameServerConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a GameServerConfigsService */ + class GameServerConfigsService extends $protobuf.rpc.Service { + + /** + * Constructs a new GameServerConfigsService 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 GameServerConfigsService 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): GameServerConfigsService; + + /** + * Calls ListGameServerConfigs. + * @param request ListGameServerConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListGameServerConfigsResponse + */ + public listGameServerConfigs(request: google.cloud.gaming.v1.IListGameServerConfigsRequest, callback: google.cloud.gaming.v1.GameServerConfigsService.ListGameServerConfigsCallback): void; + + /** + * Calls ListGameServerConfigs. + * @param request ListGameServerConfigsRequest message or plain object + * @returns Promise + */ + public listGameServerConfigs(request: google.cloud.gaming.v1.IListGameServerConfigsRequest): Promise; + + /** + * Calls GetGameServerConfig. + * @param request GetGameServerConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GameServerConfig + */ + public getGameServerConfig(request: google.cloud.gaming.v1.IGetGameServerConfigRequest, callback: google.cloud.gaming.v1.GameServerConfigsService.GetGameServerConfigCallback): void; + + /** + * Calls GetGameServerConfig. + * @param request GetGameServerConfigRequest message or plain object + * @returns Promise + */ + public getGameServerConfig(request: google.cloud.gaming.v1.IGetGameServerConfigRequest): Promise; + + /** + * Calls CreateGameServerConfig. + * @param request CreateGameServerConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createGameServerConfig(request: google.cloud.gaming.v1.ICreateGameServerConfigRequest, callback: google.cloud.gaming.v1.GameServerConfigsService.CreateGameServerConfigCallback): void; + + /** + * Calls CreateGameServerConfig. + * @param request CreateGameServerConfigRequest message or plain object + * @returns Promise + */ + public createGameServerConfig(request: google.cloud.gaming.v1.ICreateGameServerConfigRequest): Promise; + + /** + * Calls DeleteGameServerConfig. + * @param request DeleteGameServerConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteGameServerConfig(request: google.cloud.gaming.v1.IDeleteGameServerConfigRequest, callback: google.cloud.gaming.v1.GameServerConfigsService.DeleteGameServerConfigCallback): void; + + /** + * Calls DeleteGameServerConfig. + * @param request DeleteGameServerConfigRequest message or plain object + * @returns Promise + */ + public deleteGameServerConfig(request: google.cloud.gaming.v1.IDeleteGameServerConfigRequest): Promise; + } + + namespace GameServerConfigsService { + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerConfigsService|listGameServerConfigs}. + * @param error Error, if any + * @param [response] ListGameServerConfigsResponse + */ + type ListGameServerConfigsCallback = (error: (Error|null), response?: google.cloud.gaming.v1.ListGameServerConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerConfigsService|getGameServerConfig}. + * @param error Error, if any + * @param [response] GameServerConfig + */ + type GetGameServerConfigCallback = (error: (Error|null), response?: google.cloud.gaming.v1.GameServerConfig) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerConfigsService|createGameServerConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateGameServerConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerConfigsService|deleteGameServerConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteGameServerConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a ListGameServerDeploymentsRequest. */ + interface IListGameServerDeploymentsRequest { + + /** ListGameServerDeploymentsRequest parent */ + parent?: (string|null); + + /** ListGameServerDeploymentsRequest pageSize */ + pageSize?: (number|null); + + /** ListGameServerDeploymentsRequest pageToken */ + pageToken?: (string|null); + + /** ListGameServerDeploymentsRequest filter */ + filter?: (string|null); + + /** ListGameServerDeploymentsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListGameServerDeploymentsRequest. */ + class ListGameServerDeploymentsRequest implements IListGameServerDeploymentsRequest { + + /** + * Constructs a new ListGameServerDeploymentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IListGameServerDeploymentsRequest); + + /** ListGameServerDeploymentsRequest parent. */ + public parent: string; + + /** ListGameServerDeploymentsRequest pageSize. */ + public pageSize: number; + + /** ListGameServerDeploymentsRequest pageToken. */ + public pageToken: string; + + /** ListGameServerDeploymentsRequest filter. */ + public filter: string; + + /** ListGameServerDeploymentsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListGameServerDeploymentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGameServerDeploymentsRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IListGameServerDeploymentsRequest): google.cloud.gaming.v1.ListGameServerDeploymentsRequest; + + /** + * Encodes the specified ListGameServerDeploymentsRequest message. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerDeploymentsRequest.verify|verify} messages. + * @param message ListGameServerDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IListGameServerDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGameServerDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerDeploymentsRequest.verify|verify} messages. + * @param message ListGameServerDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IListGameServerDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGameServerDeploymentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGameServerDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.ListGameServerDeploymentsRequest; + + /** + * Decodes a ListGameServerDeploymentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGameServerDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.ListGameServerDeploymentsRequest; + + /** + * Verifies a ListGameServerDeploymentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGameServerDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGameServerDeploymentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.ListGameServerDeploymentsRequest; + + /** + * Creates a plain object from a ListGameServerDeploymentsRequest message. Also converts values to other types if specified. + * @param message ListGameServerDeploymentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.ListGameServerDeploymentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGameServerDeploymentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGameServerDeploymentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGameServerDeploymentsResponse. */ + interface IListGameServerDeploymentsResponse { + + /** ListGameServerDeploymentsResponse gameServerDeployments */ + gameServerDeployments?: (google.cloud.gaming.v1.IGameServerDeployment[]|null); + + /** ListGameServerDeploymentsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListGameServerDeploymentsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListGameServerDeploymentsResponse. */ + class ListGameServerDeploymentsResponse implements IListGameServerDeploymentsResponse { + + /** + * Constructs a new ListGameServerDeploymentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IListGameServerDeploymentsResponse); + + /** ListGameServerDeploymentsResponse gameServerDeployments. */ + public gameServerDeployments: google.cloud.gaming.v1.IGameServerDeployment[]; + + /** ListGameServerDeploymentsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListGameServerDeploymentsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListGameServerDeploymentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGameServerDeploymentsResponse instance + */ + public static create(properties?: google.cloud.gaming.v1.IListGameServerDeploymentsResponse): google.cloud.gaming.v1.ListGameServerDeploymentsResponse; + + /** + * Encodes the specified ListGameServerDeploymentsResponse message. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerDeploymentsResponse.verify|verify} messages. + * @param message ListGameServerDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IListGameServerDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGameServerDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerDeploymentsResponse.verify|verify} messages. + * @param message ListGameServerDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IListGameServerDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGameServerDeploymentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGameServerDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.ListGameServerDeploymentsResponse; + + /** + * Decodes a ListGameServerDeploymentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGameServerDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.ListGameServerDeploymentsResponse; + + /** + * Verifies a ListGameServerDeploymentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGameServerDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGameServerDeploymentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.ListGameServerDeploymentsResponse; + + /** + * Creates a plain object from a ListGameServerDeploymentsResponse message. Also converts values to other types if specified. + * @param message ListGameServerDeploymentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.ListGameServerDeploymentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGameServerDeploymentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGameServerDeploymentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetGameServerDeploymentRequest. */ + interface IGetGameServerDeploymentRequest { + + /** GetGameServerDeploymentRequest name */ + name?: (string|null); + } + + /** Represents a GetGameServerDeploymentRequest. */ + class GetGameServerDeploymentRequest implements IGetGameServerDeploymentRequest { + + /** + * Constructs a new GetGameServerDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IGetGameServerDeploymentRequest); + + /** GetGameServerDeploymentRequest name. */ + public name: string; + + /** + * Creates a new GetGameServerDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGameServerDeploymentRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IGetGameServerDeploymentRequest): google.cloud.gaming.v1.GetGameServerDeploymentRequest; + + /** + * Encodes the specified GetGameServerDeploymentRequest message. Does not implicitly {@link google.cloud.gaming.v1.GetGameServerDeploymentRequest.verify|verify} messages. + * @param message GetGameServerDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IGetGameServerDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGameServerDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GetGameServerDeploymentRequest.verify|verify} messages. + * @param message GetGameServerDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IGetGameServerDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGameServerDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.GetGameServerDeploymentRequest; + + /** + * Decodes a GetGameServerDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.GetGameServerDeploymentRequest; + + /** + * Verifies a GetGameServerDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGameServerDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGameServerDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.GetGameServerDeploymentRequest; + + /** + * Creates a plain object from a GetGameServerDeploymentRequest message. Also converts values to other types if specified. + * @param message GetGameServerDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.GetGameServerDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGameServerDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGameServerDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetGameServerDeploymentRolloutRequest. */ + interface IGetGameServerDeploymentRolloutRequest { + + /** GetGameServerDeploymentRolloutRequest name */ + name?: (string|null); + } + + /** Represents a GetGameServerDeploymentRolloutRequest. */ + class GetGameServerDeploymentRolloutRequest implements IGetGameServerDeploymentRolloutRequest { + + /** + * Constructs a new GetGameServerDeploymentRolloutRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest); + + /** GetGameServerDeploymentRolloutRequest name. */ + public name: string; + + /** + * Creates a new GetGameServerDeploymentRolloutRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGameServerDeploymentRolloutRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest): google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest; + + /** + * Encodes the specified GetGameServerDeploymentRolloutRequest message. Does not implicitly {@link google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest.verify|verify} messages. + * @param message GetGameServerDeploymentRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGameServerDeploymentRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest.verify|verify} messages. + * @param message GetGameServerDeploymentRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGameServerDeploymentRolloutRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest; + + /** + * Decodes a GetGameServerDeploymentRolloutRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest; + + /** + * Verifies a GetGameServerDeploymentRolloutRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGameServerDeploymentRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGameServerDeploymentRolloutRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest; + + /** + * Creates a plain object from a GetGameServerDeploymentRolloutRequest message. Also converts values to other types if specified. + * @param message GetGameServerDeploymentRolloutRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGameServerDeploymentRolloutRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGameServerDeploymentRolloutRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateGameServerDeploymentRequest. */ + interface ICreateGameServerDeploymentRequest { + + /** CreateGameServerDeploymentRequest parent */ + parent?: (string|null); + + /** CreateGameServerDeploymentRequest deploymentId */ + deploymentId?: (string|null); + + /** CreateGameServerDeploymentRequest gameServerDeployment */ + gameServerDeployment?: (google.cloud.gaming.v1.IGameServerDeployment|null); + } + + /** Represents a CreateGameServerDeploymentRequest. */ + class CreateGameServerDeploymentRequest implements ICreateGameServerDeploymentRequest { + + /** + * Constructs a new CreateGameServerDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.ICreateGameServerDeploymentRequest); + + /** CreateGameServerDeploymentRequest parent. */ + public parent: string; + + /** CreateGameServerDeploymentRequest deploymentId. */ + public deploymentId: string; + + /** CreateGameServerDeploymentRequest gameServerDeployment. */ + public gameServerDeployment?: (google.cloud.gaming.v1.IGameServerDeployment|null); + + /** + * Creates a new CreateGameServerDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGameServerDeploymentRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.ICreateGameServerDeploymentRequest): google.cloud.gaming.v1.CreateGameServerDeploymentRequest; + + /** + * Encodes the specified CreateGameServerDeploymentRequest message. Does not implicitly {@link google.cloud.gaming.v1.CreateGameServerDeploymentRequest.verify|verify} messages. + * @param message CreateGameServerDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.ICreateGameServerDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateGameServerDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.CreateGameServerDeploymentRequest.verify|verify} messages. + * @param message CreateGameServerDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.ICreateGameServerDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateGameServerDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.CreateGameServerDeploymentRequest; + + /** + * Decodes a CreateGameServerDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.CreateGameServerDeploymentRequest; + + /** + * Verifies a CreateGameServerDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateGameServerDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateGameServerDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.CreateGameServerDeploymentRequest; + + /** + * Creates a plain object from a CreateGameServerDeploymentRequest message. Also converts values to other types if specified. + * @param message CreateGameServerDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.CreateGameServerDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateGameServerDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateGameServerDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteGameServerDeploymentRequest. */ + interface IDeleteGameServerDeploymentRequest { + + /** DeleteGameServerDeploymentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteGameServerDeploymentRequest. */ + class DeleteGameServerDeploymentRequest implements IDeleteGameServerDeploymentRequest { + + /** + * Constructs a new DeleteGameServerDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest); + + /** DeleteGameServerDeploymentRequest name. */ + public name: string; + + /** + * Creates a new DeleteGameServerDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGameServerDeploymentRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest): google.cloud.gaming.v1.DeleteGameServerDeploymentRequest; + + /** + * Encodes the specified DeleteGameServerDeploymentRequest message. Does not implicitly {@link google.cloud.gaming.v1.DeleteGameServerDeploymentRequest.verify|verify} messages. + * @param message DeleteGameServerDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGameServerDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.DeleteGameServerDeploymentRequest.verify|verify} messages. + * @param message DeleteGameServerDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGameServerDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.DeleteGameServerDeploymentRequest; + + /** + * Decodes a DeleteGameServerDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.DeleteGameServerDeploymentRequest; + + /** + * Verifies a DeleteGameServerDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGameServerDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGameServerDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.DeleteGameServerDeploymentRequest; + + /** + * Creates a plain object from a DeleteGameServerDeploymentRequest message. Also converts values to other types if specified. + * @param message DeleteGameServerDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.DeleteGameServerDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGameServerDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteGameServerDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateGameServerDeploymentRequest. */ + interface IUpdateGameServerDeploymentRequest { + + /** UpdateGameServerDeploymentRequest gameServerDeployment */ + gameServerDeployment?: (google.cloud.gaming.v1.IGameServerDeployment|null); + + /** UpdateGameServerDeploymentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateGameServerDeploymentRequest. */ + class UpdateGameServerDeploymentRequest implements IUpdateGameServerDeploymentRequest { + + /** + * Constructs a new UpdateGameServerDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest); + + /** UpdateGameServerDeploymentRequest gameServerDeployment. */ + public gameServerDeployment?: (google.cloud.gaming.v1.IGameServerDeployment|null); + + /** UpdateGameServerDeploymentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateGameServerDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateGameServerDeploymentRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest): google.cloud.gaming.v1.UpdateGameServerDeploymentRequest; + + /** + * Encodes the specified UpdateGameServerDeploymentRequest message. Does not implicitly {@link google.cloud.gaming.v1.UpdateGameServerDeploymentRequest.verify|verify} messages. + * @param message UpdateGameServerDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateGameServerDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.UpdateGameServerDeploymentRequest.verify|verify} messages. + * @param message UpdateGameServerDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateGameServerDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.UpdateGameServerDeploymentRequest; + + /** + * Decodes an UpdateGameServerDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.UpdateGameServerDeploymentRequest; + + /** + * Verifies an UpdateGameServerDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateGameServerDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateGameServerDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.UpdateGameServerDeploymentRequest; + + /** + * Creates a plain object from an UpdateGameServerDeploymentRequest message. Also converts values to other types if specified. + * @param message UpdateGameServerDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.UpdateGameServerDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateGameServerDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateGameServerDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateGameServerDeploymentRolloutRequest. */ + interface IUpdateGameServerDeploymentRolloutRequest { + + /** UpdateGameServerDeploymentRolloutRequest rollout */ + rollout?: (google.cloud.gaming.v1.IGameServerDeploymentRollout|null); + + /** UpdateGameServerDeploymentRolloutRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateGameServerDeploymentRolloutRequest. */ + class UpdateGameServerDeploymentRolloutRequest implements IUpdateGameServerDeploymentRolloutRequest { + + /** + * Constructs a new UpdateGameServerDeploymentRolloutRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest); + + /** UpdateGameServerDeploymentRolloutRequest rollout. */ + public rollout?: (google.cloud.gaming.v1.IGameServerDeploymentRollout|null); + + /** UpdateGameServerDeploymentRolloutRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateGameServerDeploymentRolloutRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateGameServerDeploymentRolloutRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest): google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest; + + /** + * Encodes the specified UpdateGameServerDeploymentRolloutRequest message. Does not implicitly {@link google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest.verify|verify} messages. + * @param message UpdateGameServerDeploymentRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateGameServerDeploymentRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest.verify|verify} messages. + * @param message UpdateGameServerDeploymentRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateGameServerDeploymentRolloutRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest; + + /** + * Decodes an UpdateGameServerDeploymentRolloutRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest; + + /** + * Verifies an UpdateGameServerDeploymentRolloutRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateGameServerDeploymentRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateGameServerDeploymentRolloutRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest; + + /** + * Creates a plain object from an UpdateGameServerDeploymentRolloutRequest message. Also converts values to other types if specified. + * @param message UpdateGameServerDeploymentRolloutRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateGameServerDeploymentRolloutRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateGameServerDeploymentRolloutRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchDeploymentStateRequest. */ + interface IFetchDeploymentStateRequest { + + /** FetchDeploymentStateRequest name */ + name?: (string|null); + } + + /** Represents a FetchDeploymentStateRequest. */ + class FetchDeploymentStateRequest implements IFetchDeploymentStateRequest { + + /** + * Constructs a new FetchDeploymentStateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IFetchDeploymentStateRequest); + + /** FetchDeploymentStateRequest name. */ + public name: string; + + /** + * Creates a new FetchDeploymentStateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchDeploymentStateRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IFetchDeploymentStateRequest): google.cloud.gaming.v1.FetchDeploymentStateRequest; + + /** + * Encodes the specified FetchDeploymentStateRequest message. Does not implicitly {@link google.cloud.gaming.v1.FetchDeploymentStateRequest.verify|verify} messages. + * @param message FetchDeploymentStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IFetchDeploymentStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchDeploymentStateRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.FetchDeploymentStateRequest.verify|verify} messages. + * @param message FetchDeploymentStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IFetchDeploymentStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchDeploymentStateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchDeploymentStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.FetchDeploymentStateRequest; + + /** + * Decodes a FetchDeploymentStateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchDeploymentStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.FetchDeploymentStateRequest; + + /** + * Verifies a FetchDeploymentStateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchDeploymentStateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchDeploymentStateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.FetchDeploymentStateRequest; + + /** + * Creates a plain object from a FetchDeploymentStateRequest message. Also converts values to other types if specified. + * @param message FetchDeploymentStateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.FetchDeploymentStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchDeploymentStateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchDeploymentStateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchDeploymentStateResponse. */ + interface IFetchDeploymentStateResponse { + + /** FetchDeploymentStateResponse clusterState */ + clusterState?: (google.cloud.gaming.v1.FetchDeploymentStateResponse.IDeployedClusterState[]|null); + + /** FetchDeploymentStateResponse unavailable */ + unavailable?: (string[]|null); + } + + /** Represents a FetchDeploymentStateResponse. */ + class FetchDeploymentStateResponse implements IFetchDeploymentStateResponse { + + /** + * Constructs a new FetchDeploymentStateResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IFetchDeploymentStateResponse); + + /** FetchDeploymentStateResponse clusterState. */ + public clusterState: google.cloud.gaming.v1.FetchDeploymentStateResponse.IDeployedClusterState[]; + + /** FetchDeploymentStateResponse unavailable. */ + public unavailable: string[]; + + /** + * Creates a new FetchDeploymentStateResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchDeploymentStateResponse instance + */ + public static create(properties?: google.cloud.gaming.v1.IFetchDeploymentStateResponse): google.cloud.gaming.v1.FetchDeploymentStateResponse; + + /** + * Encodes the specified FetchDeploymentStateResponse message. Does not implicitly {@link google.cloud.gaming.v1.FetchDeploymentStateResponse.verify|verify} messages. + * @param message FetchDeploymentStateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IFetchDeploymentStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchDeploymentStateResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.FetchDeploymentStateResponse.verify|verify} messages. + * @param message FetchDeploymentStateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IFetchDeploymentStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchDeploymentStateResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchDeploymentStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.FetchDeploymentStateResponse; + + /** + * Decodes a FetchDeploymentStateResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchDeploymentStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.FetchDeploymentStateResponse; + + /** + * Verifies a FetchDeploymentStateResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchDeploymentStateResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchDeploymentStateResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.FetchDeploymentStateResponse; + + /** + * Creates a plain object from a FetchDeploymentStateResponse message. Also converts values to other types if specified. + * @param message FetchDeploymentStateResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.FetchDeploymentStateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchDeploymentStateResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchDeploymentStateResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FetchDeploymentStateResponse { + + /** Properties of a DeployedClusterState. */ + interface IDeployedClusterState { + + /** DeployedClusterState cluster */ + cluster?: (string|null); + + /** DeployedClusterState fleetDetails */ + fleetDetails?: (google.cloud.gaming.v1.IDeployedFleetDetails[]|null); + } + + /** Represents a DeployedClusterState. */ + class DeployedClusterState implements IDeployedClusterState { + + /** + * Constructs a new DeployedClusterState. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.FetchDeploymentStateResponse.IDeployedClusterState); + + /** DeployedClusterState cluster. */ + public cluster: string; + + /** DeployedClusterState fleetDetails. */ + public fleetDetails: google.cloud.gaming.v1.IDeployedFleetDetails[]; + + /** + * Creates a new DeployedClusterState instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployedClusterState instance + */ + public static create(properties?: google.cloud.gaming.v1.FetchDeploymentStateResponse.IDeployedClusterState): google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState; + + /** + * Encodes the specified DeployedClusterState message. Does not implicitly {@link google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState.verify|verify} messages. + * @param message DeployedClusterState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.FetchDeploymentStateResponse.IDeployedClusterState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployedClusterState message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState.verify|verify} messages. + * @param message DeployedClusterState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.FetchDeploymentStateResponse.IDeployedClusterState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployedClusterState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployedClusterState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState; + + /** + * Decodes a DeployedClusterState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployedClusterState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState; + + /** + * Verifies a DeployedClusterState message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployedClusterState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployedClusterState + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState; + + /** + * Creates a plain object from a DeployedClusterState message. Also converts values to other types if specified. + * @param message DeployedClusterState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployedClusterState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployedClusterState + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GameServerDeployment. */ + interface IGameServerDeployment { + + /** GameServerDeployment name */ + name?: (string|null); + + /** GameServerDeployment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** GameServerDeployment updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** GameServerDeployment labels */ + labels?: ({ [k: string]: string }|null); + + /** GameServerDeployment etag */ + etag?: (string|null); + + /** GameServerDeployment description */ + description?: (string|null); + } + + /** Represents a GameServerDeployment. */ + class GameServerDeployment implements IGameServerDeployment { + + /** + * Constructs a new GameServerDeployment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IGameServerDeployment); + + /** GameServerDeployment name. */ + public name: string; + + /** GameServerDeployment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** GameServerDeployment updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** GameServerDeployment labels. */ + public labels: { [k: string]: string }; + + /** GameServerDeployment etag. */ + public etag: string; + + /** GameServerDeployment description. */ + public description: string; + + /** + * Creates a new GameServerDeployment instance using the specified properties. + * @param [properties] Properties to set + * @returns GameServerDeployment instance + */ + public static create(properties?: google.cloud.gaming.v1.IGameServerDeployment): google.cloud.gaming.v1.GameServerDeployment; + + /** + * Encodes the specified GameServerDeployment message. Does not implicitly {@link google.cloud.gaming.v1.GameServerDeployment.verify|verify} messages. + * @param message GameServerDeployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IGameServerDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GameServerDeployment message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GameServerDeployment.verify|verify} messages. + * @param message GameServerDeployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IGameServerDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GameServerDeployment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GameServerDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.GameServerDeployment; + + /** + * Decodes a GameServerDeployment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GameServerDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.GameServerDeployment; + + /** + * Verifies a GameServerDeployment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GameServerDeployment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GameServerDeployment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.GameServerDeployment; + + /** + * Creates a plain object from a GameServerDeployment message. Also converts values to other types if specified. + * @param message GameServerDeployment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.GameServerDeployment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GameServerDeployment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GameServerDeployment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GameServerConfigOverride. */ + interface IGameServerConfigOverride { + + /** GameServerConfigOverride realmsSelector */ + realmsSelector?: (google.cloud.gaming.v1.IRealmSelector|null); + + /** GameServerConfigOverride configVersion */ + configVersion?: (string|null); + } + + /** Represents a GameServerConfigOverride. */ + class GameServerConfigOverride implements IGameServerConfigOverride { + + /** + * Constructs a new GameServerConfigOverride. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IGameServerConfigOverride); + + /** GameServerConfigOverride realmsSelector. */ + public realmsSelector?: (google.cloud.gaming.v1.IRealmSelector|null); + + /** GameServerConfigOverride configVersion. */ + public configVersion?: (string|null); + + /** GameServerConfigOverride selector. */ + public selector?: "realmsSelector"; + + /** GameServerConfigOverride change. */ + public change?: "configVersion"; + + /** + * Creates a new GameServerConfigOverride instance using the specified properties. + * @param [properties] Properties to set + * @returns GameServerConfigOverride instance + */ + public static create(properties?: google.cloud.gaming.v1.IGameServerConfigOverride): google.cloud.gaming.v1.GameServerConfigOverride; + + /** + * Encodes the specified GameServerConfigOverride message. Does not implicitly {@link google.cloud.gaming.v1.GameServerConfigOverride.verify|verify} messages. + * @param message GameServerConfigOverride message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IGameServerConfigOverride, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GameServerConfigOverride message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GameServerConfigOverride.verify|verify} messages. + * @param message GameServerConfigOverride message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IGameServerConfigOverride, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GameServerConfigOverride message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GameServerConfigOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.GameServerConfigOverride; + + /** + * Decodes a GameServerConfigOverride message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GameServerConfigOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.GameServerConfigOverride; + + /** + * Verifies a GameServerConfigOverride message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GameServerConfigOverride message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GameServerConfigOverride + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.GameServerConfigOverride; + + /** + * Creates a plain object from a GameServerConfigOverride message. Also converts values to other types if specified. + * @param message GameServerConfigOverride + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.GameServerConfigOverride, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GameServerConfigOverride to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GameServerConfigOverride + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GameServerDeploymentRollout. */ + interface IGameServerDeploymentRollout { + + /** GameServerDeploymentRollout name */ + name?: (string|null); + + /** GameServerDeploymentRollout createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** GameServerDeploymentRollout updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** GameServerDeploymentRollout defaultGameServerConfig */ + defaultGameServerConfig?: (string|null); + + /** GameServerDeploymentRollout gameServerConfigOverrides */ + gameServerConfigOverrides?: (google.cloud.gaming.v1.IGameServerConfigOverride[]|null); + + /** GameServerDeploymentRollout etag */ + etag?: (string|null); + } + + /** Represents a GameServerDeploymentRollout. */ + class GameServerDeploymentRollout implements IGameServerDeploymentRollout { + + /** + * Constructs a new GameServerDeploymentRollout. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IGameServerDeploymentRollout); + + /** GameServerDeploymentRollout name. */ + public name: string; + + /** GameServerDeploymentRollout createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** GameServerDeploymentRollout updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** GameServerDeploymentRollout defaultGameServerConfig. */ + public defaultGameServerConfig: string; + + /** GameServerDeploymentRollout gameServerConfigOverrides. */ + public gameServerConfigOverrides: google.cloud.gaming.v1.IGameServerConfigOverride[]; + + /** GameServerDeploymentRollout etag. */ + public etag: string; + + /** + * Creates a new GameServerDeploymentRollout instance using the specified properties. + * @param [properties] Properties to set + * @returns GameServerDeploymentRollout instance + */ + public static create(properties?: google.cloud.gaming.v1.IGameServerDeploymentRollout): google.cloud.gaming.v1.GameServerDeploymentRollout; + + /** + * Encodes the specified GameServerDeploymentRollout message. Does not implicitly {@link google.cloud.gaming.v1.GameServerDeploymentRollout.verify|verify} messages. + * @param message GameServerDeploymentRollout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IGameServerDeploymentRollout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GameServerDeploymentRollout message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GameServerDeploymentRollout.verify|verify} messages. + * @param message GameServerDeploymentRollout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IGameServerDeploymentRollout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GameServerDeploymentRollout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GameServerDeploymentRollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.GameServerDeploymentRollout; + + /** + * Decodes a GameServerDeploymentRollout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GameServerDeploymentRollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.GameServerDeploymentRollout; + + /** + * Verifies a GameServerDeploymentRollout message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GameServerDeploymentRollout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GameServerDeploymentRollout + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.GameServerDeploymentRollout; + + /** + * Creates a plain object from a GameServerDeploymentRollout message. Also converts values to other types if specified. + * @param message GameServerDeploymentRollout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.GameServerDeploymentRollout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GameServerDeploymentRollout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GameServerDeploymentRollout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PreviewGameServerDeploymentRolloutRequest. */ + interface IPreviewGameServerDeploymentRolloutRequest { + + /** PreviewGameServerDeploymentRolloutRequest rollout */ + rollout?: (google.cloud.gaming.v1.IGameServerDeploymentRollout|null); + + /** PreviewGameServerDeploymentRolloutRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** PreviewGameServerDeploymentRolloutRequest previewTime */ + previewTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a PreviewGameServerDeploymentRolloutRequest. */ + class PreviewGameServerDeploymentRolloutRequest implements IPreviewGameServerDeploymentRolloutRequest { + + /** + * Constructs a new PreviewGameServerDeploymentRolloutRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest); + + /** PreviewGameServerDeploymentRolloutRequest rollout. */ + public rollout?: (google.cloud.gaming.v1.IGameServerDeploymentRollout|null); + + /** PreviewGameServerDeploymentRolloutRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** PreviewGameServerDeploymentRolloutRequest previewTime. */ + public previewTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new PreviewGameServerDeploymentRolloutRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PreviewGameServerDeploymentRolloutRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest): google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest; + + /** + * Encodes the specified PreviewGameServerDeploymentRolloutRequest message. Does not implicitly {@link google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest.verify|verify} messages. + * @param message PreviewGameServerDeploymentRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreviewGameServerDeploymentRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest.verify|verify} messages. + * @param message PreviewGameServerDeploymentRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreviewGameServerDeploymentRolloutRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreviewGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest; + + /** + * Decodes a PreviewGameServerDeploymentRolloutRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreviewGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest; + + /** + * Verifies a PreviewGameServerDeploymentRolloutRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreviewGameServerDeploymentRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreviewGameServerDeploymentRolloutRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest; + + /** + * Creates a plain object from a PreviewGameServerDeploymentRolloutRequest message. Also converts values to other types if specified. + * @param message PreviewGameServerDeploymentRolloutRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreviewGameServerDeploymentRolloutRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PreviewGameServerDeploymentRolloutRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PreviewGameServerDeploymentRolloutResponse. */ + interface IPreviewGameServerDeploymentRolloutResponse { + + /** PreviewGameServerDeploymentRolloutResponse unavailable */ + unavailable?: (string[]|null); + + /** PreviewGameServerDeploymentRolloutResponse etag */ + etag?: (string|null); + + /** PreviewGameServerDeploymentRolloutResponse targetState */ + targetState?: (google.cloud.gaming.v1.ITargetState|null); + } + + /** Represents a PreviewGameServerDeploymentRolloutResponse. */ + class PreviewGameServerDeploymentRolloutResponse implements IPreviewGameServerDeploymentRolloutResponse { + + /** + * Constructs a new PreviewGameServerDeploymentRolloutResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutResponse); + + /** PreviewGameServerDeploymentRolloutResponse unavailable. */ + public unavailable: string[]; + + /** PreviewGameServerDeploymentRolloutResponse etag. */ + public etag: string; + + /** PreviewGameServerDeploymentRolloutResponse targetState. */ + public targetState?: (google.cloud.gaming.v1.ITargetState|null); + + /** + * Creates a new PreviewGameServerDeploymentRolloutResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PreviewGameServerDeploymentRolloutResponse instance + */ + public static create(properties?: google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutResponse): google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse; + + /** + * Encodes the specified PreviewGameServerDeploymentRolloutResponse message. Does not implicitly {@link google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse.verify|verify} messages. + * @param message PreviewGameServerDeploymentRolloutResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreviewGameServerDeploymentRolloutResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse.verify|verify} messages. + * @param message PreviewGameServerDeploymentRolloutResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreviewGameServerDeploymentRolloutResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreviewGameServerDeploymentRolloutResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse; + + /** + * Decodes a PreviewGameServerDeploymentRolloutResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreviewGameServerDeploymentRolloutResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse; + + /** + * Verifies a PreviewGameServerDeploymentRolloutResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreviewGameServerDeploymentRolloutResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreviewGameServerDeploymentRolloutResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse; + + /** + * Creates a plain object from a PreviewGameServerDeploymentRolloutResponse message. Also converts values to other types if specified. + * @param message PreviewGameServerDeploymentRolloutResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreviewGameServerDeploymentRolloutResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PreviewGameServerDeploymentRolloutResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a GameServerDeploymentsService */ + class GameServerDeploymentsService extends $protobuf.rpc.Service { + + /** + * Constructs a new GameServerDeploymentsService 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 GameServerDeploymentsService 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): GameServerDeploymentsService; + + /** + * Calls ListGameServerDeployments. + * @param request ListGameServerDeploymentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListGameServerDeploymentsResponse + */ + public listGameServerDeployments(request: google.cloud.gaming.v1.IListGameServerDeploymentsRequest, callback: google.cloud.gaming.v1.GameServerDeploymentsService.ListGameServerDeploymentsCallback): void; + + /** + * Calls ListGameServerDeployments. + * @param request ListGameServerDeploymentsRequest message or plain object + * @returns Promise + */ + public listGameServerDeployments(request: google.cloud.gaming.v1.IListGameServerDeploymentsRequest): Promise; + + /** + * Calls GetGameServerDeployment. + * @param request GetGameServerDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GameServerDeployment + */ + public getGameServerDeployment(request: google.cloud.gaming.v1.IGetGameServerDeploymentRequest, callback: google.cloud.gaming.v1.GameServerDeploymentsService.GetGameServerDeploymentCallback): void; + + /** + * Calls GetGameServerDeployment. + * @param request GetGameServerDeploymentRequest message or plain object + * @returns Promise + */ + public getGameServerDeployment(request: google.cloud.gaming.v1.IGetGameServerDeploymentRequest): Promise; + + /** + * Calls CreateGameServerDeployment. + * @param request CreateGameServerDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createGameServerDeployment(request: google.cloud.gaming.v1.ICreateGameServerDeploymentRequest, callback: google.cloud.gaming.v1.GameServerDeploymentsService.CreateGameServerDeploymentCallback): void; + + /** + * Calls CreateGameServerDeployment. + * @param request CreateGameServerDeploymentRequest message or plain object + * @returns Promise + */ + public createGameServerDeployment(request: google.cloud.gaming.v1.ICreateGameServerDeploymentRequest): Promise; + + /** + * Calls DeleteGameServerDeployment. + * @param request DeleteGameServerDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteGameServerDeployment(request: google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest, callback: google.cloud.gaming.v1.GameServerDeploymentsService.DeleteGameServerDeploymentCallback): void; + + /** + * Calls DeleteGameServerDeployment. + * @param request DeleteGameServerDeploymentRequest message or plain object + * @returns Promise + */ + public deleteGameServerDeployment(request: google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest): Promise; + + /** + * Calls UpdateGameServerDeployment. + * @param request UpdateGameServerDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateGameServerDeployment(request: google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest, callback: google.cloud.gaming.v1.GameServerDeploymentsService.UpdateGameServerDeploymentCallback): void; + + /** + * Calls UpdateGameServerDeployment. + * @param request UpdateGameServerDeploymentRequest message or plain object + * @returns Promise + */ + public updateGameServerDeployment(request: google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest): Promise; + + /** + * Calls GetGameServerDeploymentRollout. + * @param request GetGameServerDeploymentRolloutRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GameServerDeploymentRollout + */ + public getGameServerDeploymentRollout(request: google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest, callback: google.cloud.gaming.v1.GameServerDeploymentsService.GetGameServerDeploymentRolloutCallback): void; + + /** + * Calls GetGameServerDeploymentRollout. + * @param request GetGameServerDeploymentRolloutRequest message or plain object + * @returns Promise + */ + public getGameServerDeploymentRollout(request: google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest): Promise; + + /** + * Calls UpdateGameServerDeploymentRollout. + * @param request UpdateGameServerDeploymentRolloutRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateGameServerDeploymentRollout(request: google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest, callback: google.cloud.gaming.v1.GameServerDeploymentsService.UpdateGameServerDeploymentRolloutCallback): void; + + /** + * Calls UpdateGameServerDeploymentRollout. + * @param request UpdateGameServerDeploymentRolloutRequest message or plain object + * @returns Promise + */ + public updateGameServerDeploymentRollout(request: google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest): Promise; + + /** + * Calls PreviewGameServerDeploymentRollout. + * @param request PreviewGameServerDeploymentRolloutRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PreviewGameServerDeploymentRolloutResponse + */ + public previewGameServerDeploymentRollout(request: google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest, callback: google.cloud.gaming.v1.GameServerDeploymentsService.PreviewGameServerDeploymentRolloutCallback): void; + + /** + * Calls PreviewGameServerDeploymentRollout. + * @param request PreviewGameServerDeploymentRolloutRequest message or plain object + * @returns Promise + */ + public previewGameServerDeploymentRollout(request: google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest): Promise; + + /** + * Calls FetchDeploymentState. + * @param request FetchDeploymentStateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FetchDeploymentStateResponse + */ + public fetchDeploymentState(request: google.cloud.gaming.v1.IFetchDeploymentStateRequest, callback: google.cloud.gaming.v1.GameServerDeploymentsService.FetchDeploymentStateCallback): void; + + /** + * Calls FetchDeploymentState. + * @param request FetchDeploymentStateRequest message or plain object + * @returns Promise + */ + public fetchDeploymentState(request: google.cloud.gaming.v1.IFetchDeploymentStateRequest): Promise; + } + + namespace GameServerDeploymentsService { + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|listGameServerDeployments}. + * @param error Error, if any + * @param [response] ListGameServerDeploymentsResponse + */ + type ListGameServerDeploymentsCallback = (error: (Error|null), response?: google.cloud.gaming.v1.ListGameServerDeploymentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|getGameServerDeployment}. + * @param error Error, if any + * @param [response] GameServerDeployment + */ + type GetGameServerDeploymentCallback = (error: (Error|null), response?: google.cloud.gaming.v1.GameServerDeployment) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|createGameServerDeployment}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateGameServerDeploymentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|deleteGameServerDeployment}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteGameServerDeploymentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|updateGameServerDeployment}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateGameServerDeploymentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|getGameServerDeploymentRollout}. + * @param error Error, if any + * @param [response] GameServerDeploymentRollout + */ + type GetGameServerDeploymentRolloutCallback = (error: (Error|null), response?: google.cloud.gaming.v1.GameServerDeploymentRollout) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|updateGameServerDeploymentRollout}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateGameServerDeploymentRolloutCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|previewGameServerDeploymentRollout}. + * @param error Error, if any + * @param [response] PreviewGameServerDeploymentRolloutResponse + */ + type PreviewGameServerDeploymentRolloutCallback = (error: (Error|null), response?: google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|fetchDeploymentState}. + * @param error Error, if any + * @param [response] FetchDeploymentStateResponse + */ + type FetchDeploymentStateCallback = (error: (Error|null), response?: google.cloud.gaming.v1.FetchDeploymentStateResponse) => void; + } + + /** Properties of a ListRealmsRequest. */ + interface IListRealmsRequest { + + /** ListRealmsRequest parent */ + parent?: (string|null); + + /** ListRealmsRequest pageSize */ + pageSize?: (number|null); + + /** ListRealmsRequest pageToken */ + pageToken?: (string|null); + + /** ListRealmsRequest filter */ + filter?: (string|null); + + /** ListRealmsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListRealmsRequest. */ + class ListRealmsRequest implements IListRealmsRequest { + + /** + * Constructs a new ListRealmsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IListRealmsRequest); + + /** ListRealmsRequest parent. */ + public parent: string; + + /** ListRealmsRequest pageSize. */ + public pageSize: number; + + /** ListRealmsRequest pageToken. */ + public pageToken: string; + + /** ListRealmsRequest filter. */ + public filter: string; + + /** ListRealmsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListRealmsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRealmsRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IListRealmsRequest): google.cloud.gaming.v1.ListRealmsRequest; + + /** + * Encodes the specified ListRealmsRequest message. Does not implicitly {@link google.cloud.gaming.v1.ListRealmsRequest.verify|verify} messages. + * @param message ListRealmsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IListRealmsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRealmsRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.ListRealmsRequest.verify|verify} messages. + * @param message ListRealmsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IListRealmsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRealmsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRealmsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.ListRealmsRequest; + + /** + * Decodes a ListRealmsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRealmsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.ListRealmsRequest; + + /** + * Verifies a ListRealmsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRealmsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRealmsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.ListRealmsRequest; + + /** + * Creates a plain object from a ListRealmsRequest message. Also converts values to other types if specified. + * @param message ListRealmsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.ListRealmsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRealmsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRealmsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRealmsResponse. */ + interface IListRealmsResponse { + + /** ListRealmsResponse realms */ + realms?: (google.cloud.gaming.v1.IRealm[]|null); + + /** ListRealmsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListRealmsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListRealmsResponse. */ + class ListRealmsResponse implements IListRealmsResponse { + + /** + * Constructs a new ListRealmsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IListRealmsResponse); + + /** ListRealmsResponse realms. */ + public realms: google.cloud.gaming.v1.IRealm[]; + + /** ListRealmsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListRealmsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListRealmsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRealmsResponse instance + */ + public static create(properties?: google.cloud.gaming.v1.IListRealmsResponse): google.cloud.gaming.v1.ListRealmsResponse; + + /** + * Encodes the specified ListRealmsResponse message. Does not implicitly {@link google.cloud.gaming.v1.ListRealmsResponse.verify|verify} messages. + * @param message ListRealmsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IListRealmsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRealmsResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.ListRealmsResponse.verify|verify} messages. + * @param message ListRealmsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IListRealmsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRealmsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRealmsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.ListRealmsResponse; + + /** + * Decodes a ListRealmsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRealmsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.ListRealmsResponse; + + /** + * Verifies a ListRealmsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRealmsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRealmsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.ListRealmsResponse; + + /** + * Creates a plain object from a ListRealmsResponse message. Also converts values to other types if specified. + * @param message ListRealmsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.ListRealmsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRealmsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRealmsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetRealmRequest. */ + interface IGetRealmRequest { + + /** GetRealmRequest name */ + name?: (string|null); + } + + /** Represents a GetRealmRequest. */ + class GetRealmRequest implements IGetRealmRequest { + + /** + * Constructs a new GetRealmRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IGetRealmRequest); + + /** GetRealmRequest name. */ + public name: string; + + /** + * Creates a new GetRealmRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRealmRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IGetRealmRequest): google.cloud.gaming.v1.GetRealmRequest; + + /** + * Encodes the specified GetRealmRequest message. Does not implicitly {@link google.cloud.gaming.v1.GetRealmRequest.verify|verify} messages. + * @param message GetRealmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IGetRealmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRealmRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GetRealmRequest.verify|verify} messages. + * @param message GetRealmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IGetRealmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRealmRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.GetRealmRequest; + + /** + * Decodes a GetRealmRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.GetRealmRequest; + + /** + * Verifies a GetRealmRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRealmRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRealmRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.GetRealmRequest; + + /** + * Creates a plain object from a GetRealmRequest message. Also converts values to other types if specified. + * @param message GetRealmRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.GetRealmRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRealmRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetRealmRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateRealmRequest. */ + interface ICreateRealmRequest { + + /** CreateRealmRequest parent */ + parent?: (string|null); + + /** CreateRealmRequest realmId */ + realmId?: (string|null); + + /** CreateRealmRequest realm */ + realm?: (google.cloud.gaming.v1.IRealm|null); + } + + /** Represents a CreateRealmRequest. */ + class CreateRealmRequest implements ICreateRealmRequest { + + /** + * Constructs a new CreateRealmRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.ICreateRealmRequest); + + /** CreateRealmRequest parent. */ + public parent: string; + + /** CreateRealmRequest realmId. */ + public realmId: string; + + /** CreateRealmRequest realm. */ + public realm?: (google.cloud.gaming.v1.IRealm|null); + + /** + * Creates a new CreateRealmRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateRealmRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.ICreateRealmRequest): google.cloud.gaming.v1.CreateRealmRequest; + + /** + * Encodes the specified CreateRealmRequest message. Does not implicitly {@link google.cloud.gaming.v1.CreateRealmRequest.verify|verify} messages. + * @param message CreateRealmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.ICreateRealmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateRealmRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.CreateRealmRequest.verify|verify} messages. + * @param message CreateRealmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.ICreateRealmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateRealmRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.CreateRealmRequest; + + /** + * Decodes a CreateRealmRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.CreateRealmRequest; + + /** + * Verifies a CreateRealmRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateRealmRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateRealmRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.CreateRealmRequest; + + /** + * Creates a plain object from a CreateRealmRequest message. Also converts values to other types if specified. + * @param message CreateRealmRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.CreateRealmRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateRealmRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateRealmRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteRealmRequest. */ + interface IDeleteRealmRequest { + + /** DeleteRealmRequest name */ + name?: (string|null); + } + + /** Represents a DeleteRealmRequest. */ + class DeleteRealmRequest implements IDeleteRealmRequest { + + /** + * Constructs a new DeleteRealmRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IDeleteRealmRequest); + + /** DeleteRealmRequest name. */ + public name: string; + + /** + * Creates a new DeleteRealmRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRealmRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IDeleteRealmRequest): google.cloud.gaming.v1.DeleteRealmRequest; + + /** + * Encodes the specified DeleteRealmRequest message. Does not implicitly {@link google.cloud.gaming.v1.DeleteRealmRequest.verify|verify} messages. + * @param message DeleteRealmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IDeleteRealmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRealmRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.DeleteRealmRequest.verify|verify} messages. + * @param message DeleteRealmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IDeleteRealmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRealmRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.DeleteRealmRequest; + + /** + * Decodes a DeleteRealmRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.DeleteRealmRequest; + + /** + * Verifies a DeleteRealmRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRealmRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRealmRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.DeleteRealmRequest; + + /** + * Creates a plain object from a DeleteRealmRequest message. Also converts values to other types if specified. + * @param message DeleteRealmRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.DeleteRealmRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRealmRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteRealmRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateRealmRequest. */ + interface IUpdateRealmRequest { + + /** UpdateRealmRequest realm */ + realm?: (google.cloud.gaming.v1.IRealm|null); + + /** UpdateRealmRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateRealmRequest. */ + class UpdateRealmRequest implements IUpdateRealmRequest { + + /** + * Constructs a new UpdateRealmRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IUpdateRealmRequest); + + /** UpdateRealmRequest realm. */ + public realm?: (google.cloud.gaming.v1.IRealm|null); + + /** UpdateRealmRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateRealmRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateRealmRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IUpdateRealmRequest): google.cloud.gaming.v1.UpdateRealmRequest; + + /** + * Encodes the specified UpdateRealmRequest message. Does not implicitly {@link google.cloud.gaming.v1.UpdateRealmRequest.verify|verify} messages. + * @param message UpdateRealmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IUpdateRealmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateRealmRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.UpdateRealmRequest.verify|verify} messages. + * @param message UpdateRealmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IUpdateRealmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateRealmRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.UpdateRealmRequest; + + /** + * Decodes an UpdateRealmRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.UpdateRealmRequest; + + /** + * Verifies an UpdateRealmRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateRealmRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateRealmRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.UpdateRealmRequest; + + /** + * Creates a plain object from an UpdateRealmRequest message. Also converts values to other types if specified. + * @param message UpdateRealmRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.UpdateRealmRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateRealmRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateRealmRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PreviewRealmUpdateRequest. */ + interface IPreviewRealmUpdateRequest { + + /** PreviewRealmUpdateRequest realm */ + realm?: (google.cloud.gaming.v1.IRealm|null); + + /** PreviewRealmUpdateRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** PreviewRealmUpdateRequest previewTime */ + previewTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a PreviewRealmUpdateRequest. */ + class PreviewRealmUpdateRequest implements IPreviewRealmUpdateRequest { + + /** + * Constructs a new PreviewRealmUpdateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IPreviewRealmUpdateRequest); + + /** PreviewRealmUpdateRequest realm. */ + public realm?: (google.cloud.gaming.v1.IRealm|null); + + /** PreviewRealmUpdateRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** PreviewRealmUpdateRequest previewTime. */ + public previewTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new PreviewRealmUpdateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PreviewRealmUpdateRequest instance + */ + public static create(properties?: google.cloud.gaming.v1.IPreviewRealmUpdateRequest): google.cloud.gaming.v1.PreviewRealmUpdateRequest; + + /** + * Encodes the specified PreviewRealmUpdateRequest message. Does not implicitly {@link google.cloud.gaming.v1.PreviewRealmUpdateRequest.verify|verify} messages. + * @param message PreviewRealmUpdateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IPreviewRealmUpdateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreviewRealmUpdateRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.PreviewRealmUpdateRequest.verify|verify} messages. + * @param message PreviewRealmUpdateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IPreviewRealmUpdateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreviewRealmUpdateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreviewRealmUpdateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.PreviewRealmUpdateRequest; + + /** + * Decodes a PreviewRealmUpdateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreviewRealmUpdateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.PreviewRealmUpdateRequest; + + /** + * Verifies a PreviewRealmUpdateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreviewRealmUpdateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreviewRealmUpdateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.PreviewRealmUpdateRequest; + + /** + * Creates a plain object from a PreviewRealmUpdateRequest message. Also converts values to other types if specified. + * @param message PreviewRealmUpdateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.PreviewRealmUpdateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreviewRealmUpdateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PreviewRealmUpdateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PreviewRealmUpdateResponse. */ + interface IPreviewRealmUpdateResponse { + + /** PreviewRealmUpdateResponse etag */ + etag?: (string|null); + + /** PreviewRealmUpdateResponse targetState */ + targetState?: (google.cloud.gaming.v1.ITargetState|null); + } + + /** Represents a PreviewRealmUpdateResponse. */ + class PreviewRealmUpdateResponse implements IPreviewRealmUpdateResponse { + + /** + * Constructs a new PreviewRealmUpdateResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IPreviewRealmUpdateResponse); + + /** PreviewRealmUpdateResponse etag. */ + public etag: string; + + /** PreviewRealmUpdateResponse targetState. */ + public targetState?: (google.cloud.gaming.v1.ITargetState|null); + + /** + * Creates a new PreviewRealmUpdateResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PreviewRealmUpdateResponse instance + */ + public static create(properties?: google.cloud.gaming.v1.IPreviewRealmUpdateResponse): google.cloud.gaming.v1.PreviewRealmUpdateResponse; + + /** + * Encodes the specified PreviewRealmUpdateResponse message. Does not implicitly {@link google.cloud.gaming.v1.PreviewRealmUpdateResponse.verify|verify} messages. + * @param message PreviewRealmUpdateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IPreviewRealmUpdateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreviewRealmUpdateResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.PreviewRealmUpdateResponse.verify|verify} messages. + * @param message PreviewRealmUpdateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IPreviewRealmUpdateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreviewRealmUpdateResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreviewRealmUpdateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.PreviewRealmUpdateResponse; + + /** + * Decodes a PreviewRealmUpdateResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreviewRealmUpdateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.PreviewRealmUpdateResponse; + + /** + * Verifies a PreviewRealmUpdateResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreviewRealmUpdateResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreviewRealmUpdateResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.PreviewRealmUpdateResponse; + + /** + * Creates a plain object from a PreviewRealmUpdateResponse message. Also converts values to other types if specified. + * @param message PreviewRealmUpdateResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.PreviewRealmUpdateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreviewRealmUpdateResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PreviewRealmUpdateResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Realm. */ + interface IRealm { + + /** Realm name */ + name?: (string|null); + + /** Realm createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Realm updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Realm labels */ + labels?: ({ [k: string]: string }|null); + + /** Realm timeZone */ + timeZone?: (string|null); + + /** Realm etag */ + etag?: (string|null); + + /** Realm description */ + description?: (string|null); + } + + /** Represents a Realm. */ + class Realm implements IRealm { + + /** + * Constructs a new Realm. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1.IRealm); + + /** Realm name. */ + public name: string; + + /** Realm createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Realm updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Realm labels. */ + public labels: { [k: string]: string }; + + /** Realm timeZone. */ + public timeZone: string; + + /** Realm etag. */ + public etag: string; + + /** Realm description. */ + public description: string; + + /** + * Creates a new Realm instance using the specified properties. + * @param [properties] Properties to set + * @returns Realm instance + */ + public static create(properties?: google.cloud.gaming.v1.IRealm): google.cloud.gaming.v1.Realm; + + /** + * Encodes the specified Realm message. Does not implicitly {@link google.cloud.gaming.v1.Realm.verify|verify} messages. + * @param message Realm message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1.IRealm, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Realm message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.Realm.verify|verify} messages. + * @param message Realm message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1.IRealm, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Realm message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Realm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1.Realm; + + /** + * Decodes a Realm message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Realm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1.Realm; + + /** + * Verifies a Realm message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Realm message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Realm + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1.Realm; + + /** + * Creates a plain object from a Realm message. Also converts values to other types if specified. + * @param message Realm + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1.Realm, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Realm to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Realm + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a RealmsService */ + class RealmsService extends $protobuf.rpc.Service { + + /** + * Constructs a new RealmsService 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 RealmsService 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): RealmsService; + + /** + * Calls ListRealms. + * @param request ListRealmsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRealmsResponse + */ + public listRealms(request: google.cloud.gaming.v1.IListRealmsRequest, callback: google.cloud.gaming.v1.RealmsService.ListRealmsCallback): void; + + /** + * Calls ListRealms. + * @param request ListRealmsRequest message or plain object + * @returns Promise + */ + public listRealms(request: google.cloud.gaming.v1.IListRealmsRequest): Promise; + + /** + * Calls GetRealm. + * @param request GetRealmRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Realm + */ + public getRealm(request: google.cloud.gaming.v1.IGetRealmRequest, callback: google.cloud.gaming.v1.RealmsService.GetRealmCallback): void; + + /** + * Calls GetRealm. + * @param request GetRealmRequest message or plain object + * @returns Promise + */ + public getRealm(request: google.cloud.gaming.v1.IGetRealmRequest): Promise; + + /** + * Calls CreateRealm. + * @param request CreateRealmRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createRealm(request: google.cloud.gaming.v1.ICreateRealmRequest, callback: google.cloud.gaming.v1.RealmsService.CreateRealmCallback): void; + + /** + * Calls CreateRealm. + * @param request CreateRealmRequest message or plain object + * @returns Promise + */ + public createRealm(request: google.cloud.gaming.v1.ICreateRealmRequest): Promise; + + /** + * Calls DeleteRealm. + * @param request DeleteRealmRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteRealm(request: google.cloud.gaming.v1.IDeleteRealmRequest, callback: google.cloud.gaming.v1.RealmsService.DeleteRealmCallback): void; + + /** + * Calls DeleteRealm. + * @param request DeleteRealmRequest message or plain object + * @returns Promise + */ + public deleteRealm(request: google.cloud.gaming.v1.IDeleteRealmRequest): Promise; + + /** + * Calls UpdateRealm. + * @param request UpdateRealmRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateRealm(request: google.cloud.gaming.v1.IUpdateRealmRequest, callback: google.cloud.gaming.v1.RealmsService.UpdateRealmCallback): void; + + /** + * Calls UpdateRealm. + * @param request UpdateRealmRequest message or plain object + * @returns Promise + */ + public updateRealm(request: google.cloud.gaming.v1.IUpdateRealmRequest): Promise; + + /** + * Calls PreviewRealmUpdate. + * @param request PreviewRealmUpdateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PreviewRealmUpdateResponse + */ + public previewRealmUpdate(request: google.cloud.gaming.v1.IPreviewRealmUpdateRequest, callback: google.cloud.gaming.v1.RealmsService.PreviewRealmUpdateCallback): void; + + /** + * Calls PreviewRealmUpdate. + * @param request PreviewRealmUpdateRequest message or plain object + * @returns Promise + */ + public previewRealmUpdate(request: google.cloud.gaming.v1.IPreviewRealmUpdateRequest): Promise; + } + + namespace RealmsService { + + /** + * Callback as used by {@link google.cloud.gaming.v1.RealmsService|listRealms}. + * @param error Error, if any + * @param [response] ListRealmsResponse + */ + type ListRealmsCallback = (error: (Error|null), response?: google.cloud.gaming.v1.ListRealmsResponse) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.RealmsService|getRealm}. + * @param error Error, if any + * @param [response] Realm + */ + type GetRealmCallback = (error: (Error|null), response?: google.cloud.gaming.v1.Realm) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.RealmsService|createRealm}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateRealmCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.RealmsService|deleteRealm}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteRealmCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.RealmsService|updateRealm}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateRealmCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1.RealmsService|previewRealmUpdate}. + * @param error Error, if any + * @param [response] PreviewRealmUpdateResponse + */ + type PreviewRealmUpdateCallback = (error: (Error|null), response?: google.cloud.gaming.v1.PreviewRealmUpdateResponse) => void; + } + } + + /** Namespace v1beta. */ + namespace v1beta { + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + + /** OperationMetadata unreachable */ + unreachable?: (string[]|null); + + /** OperationMetadata operationStatus */ + operationStatus?: ({ [k: string]: google.cloud.gaming.v1beta.IOperationStatus }|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** OperationMetadata unreachable. */ + public unreachable: string[]; + + /** OperationMetadata operationStatus. */ + public operationStatus: { [k: string]: google.cloud.gaming.v1beta.IOperationStatus }; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IOperationMetadata): google.cloud.gaming.v1beta.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.gaming.v1beta.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationStatus. */ + interface IOperationStatus { + + /** OperationStatus done */ + done?: (boolean|null); + + /** OperationStatus errorCode */ + errorCode?: (google.cloud.gaming.v1beta.OperationStatus.ErrorCode|keyof typeof google.cloud.gaming.v1beta.OperationStatus.ErrorCode|null); + + /** OperationStatus errorMessage */ + errorMessage?: (string|null); + } + + /** Represents an OperationStatus. */ + class OperationStatus implements IOperationStatus { + + /** + * Constructs a new OperationStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IOperationStatus); + + /** OperationStatus done. */ + public done: boolean; + + /** OperationStatus errorCode. */ + public errorCode: (google.cloud.gaming.v1beta.OperationStatus.ErrorCode|keyof typeof google.cloud.gaming.v1beta.OperationStatus.ErrorCode); + + /** OperationStatus errorMessage. */ + public errorMessage: string; + + /** + * Creates a new OperationStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationStatus instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IOperationStatus): google.cloud.gaming.v1beta.OperationStatus; + + /** + * Encodes the specified OperationStatus message. Does not implicitly {@link google.cloud.gaming.v1beta.OperationStatus.verify|verify} messages. + * @param message OperationStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IOperationStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationStatus message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.OperationStatus.verify|verify} messages. + * @param message OperationStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IOperationStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.OperationStatus; + + /** + * Decodes an OperationStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.OperationStatus; + + /** + * Verifies an OperationStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.OperationStatus; + + /** + * Creates a plain object from an OperationStatus message. Also converts values to other types if specified. + * @param message OperationStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.OperationStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace OperationStatus { + + /** ErrorCode enum. */ + enum ErrorCode { + ERROR_CODE_UNSPECIFIED = 0, + INTERNAL_ERROR = 1, + PERMISSION_DENIED = 2, + CLUSTER_CONNECTION = 3 + } + } + + /** Properties of a LabelSelector. */ + interface ILabelSelector { + + /** LabelSelector labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a LabelSelector. */ + class LabelSelector implements ILabelSelector { + + /** + * Constructs a new LabelSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.ILabelSelector); + + /** LabelSelector labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new LabelSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns LabelSelector instance + */ + public static create(properties?: google.cloud.gaming.v1beta.ILabelSelector): google.cloud.gaming.v1beta.LabelSelector; + + /** + * Encodes the specified LabelSelector message. Does not implicitly {@link google.cloud.gaming.v1beta.LabelSelector.verify|verify} messages. + * @param message LabelSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.ILabelSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LabelSelector message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.LabelSelector.verify|verify} messages. + * @param message LabelSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.ILabelSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LabelSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LabelSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.LabelSelector; + + /** + * Decodes a LabelSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LabelSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.LabelSelector; + + /** + * Verifies a LabelSelector message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LabelSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LabelSelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.LabelSelector; + + /** + * Creates a plain object from a LabelSelector message. Also converts values to other types if specified. + * @param message LabelSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.LabelSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LabelSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LabelSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RealmSelector. */ + interface IRealmSelector { + + /** RealmSelector realms */ + realms?: (string[]|null); + } + + /** Represents a RealmSelector. */ + class RealmSelector implements IRealmSelector { + + /** + * Constructs a new RealmSelector. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IRealmSelector); + + /** RealmSelector realms. */ + public realms: string[]; + + /** + * Creates a new RealmSelector instance using the specified properties. + * @param [properties] Properties to set + * @returns RealmSelector instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IRealmSelector): google.cloud.gaming.v1beta.RealmSelector; + + /** + * Encodes the specified RealmSelector message. Does not implicitly {@link google.cloud.gaming.v1beta.RealmSelector.verify|verify} messages. + * @param message RealmSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IRealmSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RealmSelector message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.RealmSelector.verify|verify} messages. + * @param message RealmSelector message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IRealmSelector, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RealmSelector message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RealmSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.RealmSelector; + + /** + * Decodes a RealmSelector message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RealmSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.RealmSelector; + + /** + * Verifies a RealmSelector message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RealmSelector message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RealmSelector + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.RealmSelector; + + /** + * Creates a plain object from a RealmSelector message. Also converts values to other types if specified. + * @param message RealmSelector + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.RealmSelector, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RealmSelector to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RealmSelector + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Schedule. */ + interface ISchedule { + + /** Schedule startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Schedule endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** Schedule cronJobDuration */ + cronJobDuration?: (google.protobuf.IDuration|null); + + /** Schedule cronSpec */ + cronSpec?: (string|null); + } + + /** Represents a Schedule. */ + class Schedule implements ISchedule { + + /** + * Constructs a new Schedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.ISchedule); + + /** Schedule startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Schedule endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Schedule cronJobDuration. */ + public cronJobDuration?: (google.protobuf.IDuration|null); + + /** Schedule cronSpec. */ + public cronSpec: string; + + /** + * Creates a new Schedule instance using the specified properties. + * @param [properties] Properties to set + * @returns Schedule instance + */ + public static create(properties?: google.cloud.gaming.v1beta.ISchedule): google.cloud.gaming.v1beta.Schedule; + + /** + * Encodes the specified Schedule message. Does not implicitly {@link google.cloud.gaming.v1beta.Schedule.verify|verify} messages. + * @param message Schedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.ISchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Schedule message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.Schedule.verify|verify} messages. + * @param message Schedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.ISchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Schedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.Schedule; + + /** + * Decodes a Schedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.Schedule; + + /** + * Verifies a Schedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Schedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Schedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.Schedule; + + /** + * Creates a plain object from a Schedule message. Also converts values to other types if specified. + * @param message Schedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.Schedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Schedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Schedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpecSource. */ + interface ISpecSource { + + /** SpecSource gameServerConfigName */ + gameServerConfigName?: (string|null); + + /** SpecSource name */ + name?: (string|null); + } + + /** Represents a SpecSource. */ + class SpecSource implements ISpecSource { + + /** + * Constructs a new SpecSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.ISpecSource); + + /** SpecSource gameServerConfigName. */ + public gameServerConfigName: string; + + /** SpecSource name. */ + public name: string; + + /** + * Creates a new SpecSource instance using the specified properties. + * @param [properties] Properties to set + * @returns SpecSource instance + */ + public static create(properties?: google.cloud.gaming.v1beta.ISpecSource): google.cloud.gaming.v1beta.SpecSource; + + /** + * Encodes the specified SpecSource message. Does not implicitly {@link google.cloud.gaming.v1beta.SpecSource.verify|verify} messages. + * @param message SpecSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.ISpecSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpecSource message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.SpecSource.verify|verify} messages. + * @param message SpecSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.ISpecSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpecSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpecSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.SpecSource; + + /** + * Decodes a SpecSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpecSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.SpecSource; + + /** + * Verifies a SpecSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpecSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpecSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.SpecSource; + + /** + * Creates a plain object from a SpecSource message. Also converts values to other types if specified. + * @param message SpecSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.SpecSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpecSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpecSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TargetDetails. */ + interface ITargetDetails { + + /** TargetDetails gameServerClusterName */ + gameServerClusterName?: (string|null); + + /** TargetDetails gameServerDeploymentName */ + gameServerDeploymentName?: (string|null); + + /** TargetDetails fleetDetails */ + fleetDetails?: (google.cloud.gaming.v1beta.TargetDetails.ITargetFleetDetails[]|null); + } + + /** Represents a TargetDetails. */ + class TargetDetails implements ITargetDetails { + + /** + * Constructs a new TargetDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.ITargetDetails); + + /** TargetDetails gameServerClusterName. */ + public gameServerClusterName: string; + + /** TargetDetails gameServerDeploymentName. */ + public gameServerDeploymentName: string; + + /** TargetDetails fleetDetails. */ + public fleetDetails: google.cloud.gaming.v1beta.TargetDetails.ITargetFleetDetails[]; + + /** + * Creates a new TargetDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetDetails instance + */ + public static create(properties?: google.cloud.gaming.v1beta.ITargetDetails): google.cloud.gaming.v1beta.TargetDetails; + + /** + * Encodes the specified TargetDetails message. Does not implicitly {@link google.cloud.gaming.v1beta.TargetDetails.verify|verify} messages. + * @param message TargetDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.ITargetDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetDetails message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.TargetDetails.verify|verify} messages. + * @param message TargetDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.ITargetDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.TargetDetails; + + /** + * Decodes a TargetDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.TargetDetails; + + /** + * Verifies a TargetDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.TargetDetails; + + /** + * Creates a plain object from a TargetDetails message. Also converts values to other types if specified. + * @param message TargetDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.TargetDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TargetDetails { + + /** Properties of a TargetFleetDetails. */ + interface ITargetFleetDetails { + + /** TargetFleetDetails fleet */ + fleet?: (google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleet|null); + + /** TargetFleetDetails autoscaler */ + autoscaler?: (google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler|null); + } + + /** Represents a TargetFleetDetails. */ + class TargetFleetDetails implements ITargetFleetDetails { + + /** + * Constructs a new TargetFleetDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.TargetDetails.ITargetFleetDetails); + + /** TargetFleetDetails fleet. */ + public fleet?: (google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleet|null); + + /** TargetFleetDetails autoscaler. */ + public autoscaler?: (google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler|null); + + /** + * Creates a new TargetFleetDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetFleetDetails instance + */ + public static create(properties?: google.cloud.gaming.v1beta.TargetDetails.ITargetFleetDetails): google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails; + + /** + * Encodes the specified TargetFleetDetails message. Does not implicitly {@link google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.verify|verify} messages. + * @param message TargetFleetDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.TargetDetails.ITargetFleetDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetFleetDetails message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.verify|verify} messages. + * @param message TargetFleetDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.TargetDetails.ITargetFleetDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetFleetDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetFleetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails; + + /** + * Decodes a TargetFleetDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetFleetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails; + + /** + * Verifies a TargetFleetDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetFleetDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetFleetDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails; + + /** + * Creates a plain object from a TargetFleetDetails message. Also converts values to other types if specified. + * @param message TargetFleetDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetFleetDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetFleetDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace TargetFleetDetails { + + /** Properties of a TargetFleet. */ + interface ITargetFleet { + + /** TargetFleet name */ + name?: (string|null); + + /** TargetFleet specSource */ + specSource?: (google.cloud.gaming.v1beta.ISpecSource|null); + } + + /** Represents a TargetFleet. */ + class TargetFleet implements ITargetFleet { + + /** + * Constructs a new TargetFleet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleet); + + /** TargetFleet name. */ + public name: string; + + /** TargetFleet specSource. */ + public specSource?: (google.cloud.gaming.v1beta.ISpecSource|null); + + /** + * Creates a new TargetFleet instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetFleet instance + */ + public static create(properties?: google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleet): google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet; + + /** + * Encodes the specified TargetFleet message. Does not implicitly {@link google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet.verify|verify} messages. + * @param message TargetFleet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetFleet message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet.verify|verify} messages. + * @param message TargetFleet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetFleet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetFleet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet; + + /** + * Decodes a TargetFleet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetFleet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet; + + /** + * Verifies a TargetFleet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetFleet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetFleet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet; + + /** + * Creates a plain object from a TargetFleet message. Also converts values to other types if specified. + * @param message TargetFleet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetFleet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetFleet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TargetFleetAutoscaler. */ + interface ITargetFleetAutoscaler { + + /** TargetFleetAutoscaler name */ + name?: (string|null); + + /** TargetFleetAutoscaler specSource */ + specSource?: (google.cloud.gaming.v1beta.ISpecSource|null); + } + + /** Represents a TargetFleetAutoscaler. */ + class TargetFleetAutoscaler implements ITargetFleetAutoscaler { + + /** + * Constructs a new TargetFleetAutoscaler. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler); + + /** TargetFleetAutoscaler name. */ + public name: string; + + /** TargetFleetAutoscaler specSource. */ + public specSource?: (google.cloud.gaming.v1beta.ISpecSource|null); + + /** + * Creates a new TargetFleetAutoscaler instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetFleetAutoscaler instance + */ + public static create(properties?: google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler): google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler; + + /** + * Encodes the specified TargetFleetAutoscaler message. Does not implicitly {@link google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler.verify|verify} messages. + * @param message TargetFleetAutoscaler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetFleetAutoscaler message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler.verify|verify} messages. + * @param message TargetFleetAutoscaler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetFleetAutoscaler message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetFleetAutoscaler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler; + + /** + * Decodes a TargetFleetAutoscaler message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetFleetAutoscaler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler; + + /** + * Verifies a TargetFleetAutoscaler message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetFleetAutoscaler message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetFleetAutoscaler + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler; + + /** + * Creates a plain object from a TargetFleetAutoscaler message. Also converts values to other types if specified. + * @param message TargetFleetAutoscaler + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetFleetAutoscaler to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetFleetAutoscaler + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + + /** Properties of a TargetState. */ + interface ITargetState { + + /** TargetState details */ + details?: (google.cloud.gaming.v1beta.ITargetDetails[]|null); + } + + /** Represents a TargetState. */ + class TargetState implements ITargetState { + + /** + * Constructs a new TargetState. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.ITargetState); + + /** TargetState details. */ + public details: google.cloud.gaming.v1beta.ITargetDetails[]; + + /** + * Creates a new TargetState instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetState instance + */ + public static create(properties?: google.cloud.gaming.v1beta.ITargetState): google.cloud.gaming.v1beta.TargetState; + + /** + * Encodes the specified TargetState message. Does not implicitly {@link google.cloud.gaming.v1beta.TargetState.verify|verify} messages. + * @param message TargetState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.ITargetState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetState message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.TargetState.verify|verify} messages. + * @param message TargetState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.ITargetState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.TargetState; + + /** + * Decodes a TargetState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.TargetState; + + /** + * Verifies a TargetState message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetState + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.TargetState; + + /** + * Creates a plain object from a TargetState message. Also converts values to other types if specified. + * @param message TargetState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.TargetState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetState + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeployedFleetDetails. */ + interface IDeployedFleetDetails { + + /** DeployedFleetDetails deployedFleet */ + deployedFleet?: (google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleet|null); + + /** DeployedFleetDetails deployedAutoscaler */ + deployedAutoscaler?: (google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleetAutoscaler|null); + } + + /** Represents a DeployedFleetDetails. */ + class DeployedFleetDetails implements IDeployedFleetDetails { + + /** + * Constructs a new DeployedFleetDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IDeployedFleetDetails); + + /** DeployedFleetDetails deployedFleet. */ + public deployedFleet?: (google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleet|null); + + /** DeployedFleetDetails deployedAutoscaler. */ + public deployedAutoscaler?: (google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleetAutoscaler|null); + + /** + * Creates a new DeployedFleetDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployedFleetDetails instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IDeployedFleetDetails): google.cloud.gaming.v1beta.DeployedFleetDetails; + + /** + * Encodes the specified DeployedFleetDetails message. Does not implicitly {@link google.cloud.gaming.v1beta.DeployedFleetDetails.verify|verify} messages. + * @param message DeployedFleetDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IDeployedFleetDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployedFleetDetails message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.DeployedFleetDetails.verify|verify} messages. + * @param message DeployedFleetDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IDeployedFleetDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployedFleetDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployedFleetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.DeployedFleetDetails; + + /** + * Decodes a DeployedFleetDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployedFleetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.DeployedFleetDetails; + + /** + * Verifies a DeployedFleetDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployedFleetDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployedFleetDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.DeployedFleetDetails; + + /** + * Creates a plain object from a DeployedFleetDetails message. Also converts values to other types if specified. + * @param message DeployedFleetDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.DeployedFleetDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployedFleetDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployedFleetDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DeployedFleetDetails { + + /** Properties of a DeployedFleet. */ + interface IDeployedFleet { + + /** DeployedFleet fleet */ + fleet?: (string|null); + + /** DeployedFleet fleetSpec */ + fleetSpec?: (string|null); + + /** DeployedFleet specSource */ + specSource?: (google.cloud.gaming.v1beta.ISpecSource|null); + + /** DeployedFleet status */ + status?: (google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus|null); + } + + /** Represents a DeployedFleet. */ + class DeployedFleet implements IDeployedFleet { + + /** + * Constructs a new DeployedFleet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleet); + + /** DeployedFleet fleet. */ + public fleet: string; + + /** DeployedFleet fleetSpec. */ + public fleetSpec: string; + + /** DeployedFleet specSource. */ + public specSource?: (google.cloud.gaming.v1beta.ISpecSource|null); + + /** DeployedFleet status. */ + public status?: (google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus|null); + + /** + * Creates a new DeployedFleet instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployedFleet instance + */ + public static create(properties?: google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleet): google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet; + + /** + * Encodes the specified DeployedFleet message. Does not implicitly {@link google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.verify|verify} messages. + * @param message DeployedFleet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployedFleet message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.verify|verify} messages. + * @param message DeployedFleet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployedFleet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployedFleet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet; + + /** + * Decodes a DeployedFleet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployedFleet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet; + + /** + * Verifies a DeployedFleet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployedFleet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployedFleet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet; + + /** + * Creates a plain object from a DeployedFleet message. Also converts values to other types if specified. + * @param message DeployedFleet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployedFleet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployedFleet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DeployedFleet { + + /** Properties of a DeployedFleetStatus. */ + interface IDeployedFleetStatus { + + /** DeployedFleetStatus readyReplicas */ + readyReplicas?: (number|Long|string|null); + + /** DeployedFleetStatus allocatedReplicas */ + allocatedReplicas?: (number|Long|string|null); + + /** DeployedFleetStatus reservedReplicas */ + reservedReplicas?: (number|Long|string|null); + + /** DeployedFleetStatus replicas */ + replicas?: (number|Long|string|null); + } + + /** Represents a DeployedFleetStatus. */ + class DeployedFleetStatus implements IDeployedFleetStatus { + + /** + * Constructs a new DeployedFleetStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus); + + /** DeployedFleetStatus readyReplicas. */ + public readyReplicas: (number|Long|string); + + /** DeployedFleetStatus allocatedReplicas. */ + public allocatedReplicas: (number|Long|string); + + /** DeployedFleetStatus reservedReplicas. */ + public reservedReplicas: (number|Long|string); + + /** DeployedFleetStatus replicas. */ + public replicas: (number|Long|string); + + /** + * Creates a new DeployedFleetStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployedFleetStatus instance + */ + public static create(properties?: google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus): google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus; + + /** + * Encodes the specified DeployedFleetStatus message. Does not implicitly {@link google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus.verify|verify} messages. + * @param message DeployedFleetStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployedFleetStatus message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus.verify|verify} messages. + * @param message DeployedFleetStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployedFleetStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployedFleetStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus; + + /** + * Decodes a DeployedFleetStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployedFleetStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus; + + /** + * Verifies a DeployedFleetStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployedFleetStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployedFleetStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus; + + /** + * Creates a plain object from a DeployedFleetStatus message. Also converts values to other types if specified. + * @param message DeployedFleetStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployedFleetStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployedFleetStatus + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a DeployedFleetAutoscaler. */ + interface IDeployedFleetAutoscaler { + + /** DeployedFleetAutoscaler autoscaler */ + autoscaler?: (string|null); + + /** DeployedFleetAutoscaler specSource */ + specSource?: (google.cloud.gaming.v1beta.ISpecSource|null); + + /** DeployedFleetAutoscaler fleetAutoscalerSpec */ + fleetAutoscalerSpec?: (string|null); + } + + /** Represents a DeployedFleetAutoscaler. */ + class DeployedFleetAutoscaler implements IDeployedFleetAutoscaler { + + /** + * Constructs a new DeployedFleetAutoscaler. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleetAutoscaler); + + /** DeployedFleetAutoscaler autoscaler. */ + public autoscaler: string; + + /** DeployedFleetAutoscaler specSource. */ + public specSource?: (google.cloud.gaming.v1beta.ISpecSource|null); + + /** DeployedFleetAutoscaler fleetAutoscalerSpec. */ + public fleetAutoscalerSpec: string; + + /** + * Creates a new DeployedFleetAutoscaler instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployedFleetAutoscaler instance + */ + public static create(properties?: google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleetAutoscaler): google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler; + + /** + * Encodes the specified DeployedFleetAutoscaler message. Does not implicitly {@link google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler.verify|verify} messages. + * @param message DeployedFleetAutoscaler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleetAutoscaler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployedFleetAutoscaler message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler.verify|verify} messages. + * @param message DeployedFleetAutoscaler message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleetAutoscaler, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployedFleetAutoscaler message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployedFleetAutoscaler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler; + + /** + * Decodes a DeployedFleetAutoscaler message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployedFleetAutoscaler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler; + + /** + * Verifies a DeployedFleetAutoscaler message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployedFleetAutoscaler message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployedFleetAutoscaler + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler; + + /** + * Creates a plain object from a DeployedFleetAutoscaler message. Also converts values to other types if specified. + * @param message DeployedFleetAutoscaler + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployedFleetAutoscaler to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployedFleetAutoscaler + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ListGameServerClustersRequest. */ + interface IListGameServerClustersRequest { + + /** ListGameServerClustersRequest parent */ + parent?: (string|null); + + /** ListGameServerClustersRequest pageSize */ + pageSize?: (number|null); + + /** ListGameServerClustersRequest pageToken */ + pageToken?: (string|null); + + /** ListGameServerClustersRequest filter */ + filter?: (string|null); + + /** ListGameServerClustersRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListGameServerClustersRequest. */ + class ListGameServerClustersRequest implements IListGameServerClustersRequest { + + /** + * Constructs a new ListGameServerClustersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IListGameServerClustersRequest); + + /** ListGameServerClustersRequest parent. */ + public parent: string; + + /** ListGameServerClustersRequest pageSize. */ + public pageSize: number; + + /** ListGameServerClustersRequest pageToken. */ + public pageToken: string; + + /** ListGameServerClustersRequest filter. */ + public filter: string; + + /** ListGameServerClustersRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListGameServerClustersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGameServerClustersRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IListGameServerClustersRequest): google.cloud.gaming.v1beta.ListGameServerClustersRequest; + + /** + * Encodes the specified ListGameServerClustersRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerClustersRequest.verify|verify} messages. + * @param message ListGameServerClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IListGameServerClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGameServerClustersRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerClustersRequest.verify|verify} messages. + * @param message ListGameServerClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IListGameServerClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGameServerClustersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGameServerClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.ListGameServerClustersRequest; + + /** + * Decodes a ListGameServerClustersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGameServerClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.ListGameServerClustersRequest; + + /** + * Verifies a ListGameServerClustersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGameServerClustersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGameServerClustersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.ListGameServerClustersRequest; + + /** + * Creates a plain object from a ListGameServerClustersRequest message. Also converts values to other types if specified. + * @param message ListGameServerClustersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.ListGameServerClustersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGameServerClustersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGameServerClustersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGameServerClustersResponse. */ + interface IListGameServerClustersResponse { + + /** ListGameServerClustersResponse gameServerClusters */ + gameServerClusters?: (google.cloud.gaming.v1beta.IGameServerCluster[]|null); + + /** ListGameServerClustersResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListGameServerClustersResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListGameServerClustersResponse. */ + class ListGameServerClustersResponse implements IListGameServerClustersResponse { + + /** + * Constructs a new ListGameServerClustersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IListGameServerClustersResponse); + + /** ListGameServerClustersResponse gameServerClusters. */ + public gameServerClusters: google.cloud.gaming.v1beta.IGameServerCluster[]; + + /** ListGameServerClustersResponse nextPageToken. */ + public nextPageToken: string; + + /** ListGameServerClustersResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListGameServerClustersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGameServerClustersResponse instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IListGameServerClustersResponse): google.cloud.gaming.v1beta.ListGameServerClustersResponse; + + /** + * Encodes the specified ListGameServerClustersResponse message. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerClustersResponse.verify|verify} messages. + * @param message ListGameServerClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IListGameServerClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGameServerClustersResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerClustersResponse.verify|verify} messages. + * @param message ListGameServerClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IListGameServerClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGameServerClustersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGameServerClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.ListGameServerClustersResponse; + + /** + * Decodes a ListGameServerClustersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGameServerClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.ListGameServerClustersResponse; + + /** + * Verifies a ListGameServerClustersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGameServerClustersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGameServerClustersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.ListGameServerClustersResponse; + + /** + * Creates a plain object from a ListGameServerClustersResponse message. Also converts values to other types if specified. + * @param message ListGameServerClustersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.ListGameServerClustersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGameServerClustersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGameServerClustersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetGameServerClusterRequest. */ + interface IGetGameServerClusterRequest { + + /** GetGameServerClusterRequest name */ + name?: (string|null); + } + + /** Represents a GetGameServerClusterRequest. */ + class GetGameServerClusterRequest implements IGetGameServerClusterRequest { + + /** + * Constructs a new GetGameServerClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IGetGameServerClusterRequest); + + /** GetGameServerClusterRequest name. */ + public name: string; + + /** + * Creates a new GetGameServerClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGameServerClusterRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IGetGameServerClusterRequest): google.cloud.gaming.v1beta.GetGameServerClusterRequest; + + /** + * Encodes the specified GetGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.GetGameServerClusterRequest.verify|verify} messages. + * @param message GetGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IGetGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GetGameServerClusterRequest.verify|verify} messages. + * @param message GetGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IGetGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGameServerClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.GetGameServerClusterRequest; + + /** + * Decodes a GetGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.GetGameServerClusterRequest; + + /** + * Verifies a GetGameServerClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGameServerClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.GetGameServerClusterRequest; + + /** + * Creates a plain object from a GetGameServerClusterRequest message. Also converts values to other types if specified. + * @param message GetGameServerClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.GetGameServerClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGameServerClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGameServerClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateGameServerClusterRequest. */ + interface ICreateGameServerClusterRequest { + + /** CreateGameServerClusterRequest parent */ + parent?: (string|null); + + /** CreateGameServerClusterRequest gameServerClusterId */ + gameServerClusterId?: (string|null); + + /** CreateGameServerClusterRequest gameServerCluster */ + gameServerCluster?: (google.cloud.gaming.v1beta.IGameServerCluster|null); + } + + /** Represents a CreateGameServerClusterRequest. */ + class CreateGameServerClusterRequest implements ICreateGameServerClusterRequest { + + /** + * Constructs a new CreateGameServerClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.ICreateGameServerClusterRequest); + + /** CreateGameServerClusterRequest parent. */ + public parent: string; + + /** CreateGameServerClusterRequest gameServerClusterId. */ + public gameServerClusterId: string; + + /** CreateGameServerClusterRequest gameServerCluster. */ + public gameServerCluster?: (google.cloud.gaming.v1beta.IGameServerCluster|null); + + /** + * Creates a new CreateGameServerClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGameServerClusterRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.ICreateGameServerClusterRequest): google.cloud.gaming.v1beta.CreateGameServerClusterRequest; + + /** + * Encodes the specified CreateGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.CreateGameServerClusterRequest.verify|verify} messages. + * @param message CreateGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.CreateGameServerClusterRequest.verify|verify} messages. + * @param message CreateGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateGameServerClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.CreateGameServerClusterRequest; + + /** + * Decodes a CreateGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.CreateGameServerClusterRequest; + + /** + * Verifies a CreateGameServerClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateGameServerClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.CreateGameServerClusterRequest; + + /** + * Creates a plain object from a CreateGameServerClusterRequest message. Also converts values to other types if specified. + * @param message CreateGameServerClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.CreateGameServerClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateGameServerClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateGameServerClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PreviewCreateGameServerClusterRequest. */ + interface IPreviewCreateGameServerClusterRequest { + + /** PreviewCreateGameServerClusterRequest parent */ + parent?: (string|null); + + /** PreviewCreateGameServerClusterRequest gameServerClusterId */ + gameServerClusterId?: (string|null); + + /** PreviewCreateGameServerClusterRequest gameServerCluster */ + gameServerCluster?: (google.cloud.gaming.v1beta.IGameServerCluster|null); + + /** PreviewCreateGameServerClusterRequest previewTime */ + previewTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a PreviewCreateGameServerClusterRequest. */ + class PreviewCreateGameServerClusterRequest implements IPreviewCreateGameServerClusterRequest { + + /** + * Constructs a new PreviewCreateGameServerClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest); + + /** PreviewCreateGameServerClusterRequest parent. */ + public parent: string; + + /** PreviewCreateGameServerClusterRequest gameServerClusterId. */ + public gameServerClusterId: string; + + /** PreviewCreateGameServerClusterRequest gameServerCluster. */ + public gameServerCluster?: (google.cloud.gaming.v1beta.IGameServerCluster|null); + + /** PreviewCreateGameServerClusterRequest previewTime. */ + public previewTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new PreviewCreateGameServerClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PreviewCreateGameServerClusterRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest): google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest; + + /** + * Encodes the specified PreviewCreateGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest.verify|verify} messages. + * @param message PreviewCreateGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreviewCreateGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest.verify|verify} messages. + * @param message PreviewCreateGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreviewCreateGameServerClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreviewCreateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest; + + /** + * Decodes a PreviewCreateGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreviewCreateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest; + + /** + * Verifies a PreviewCreateGameServerClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreviewCreateGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreviewCreateGameServerClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest; + + /** + * Creates a plain object from a PreviewCreateGameServerClusterRequest message. Also converts values to other types if specified. + * @param message PreviewCreateGameServerClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreviewCreateGameServerClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PreviewCreateGameServerClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PreviewCreateGameServerClusterResponse. */ + interface IPreviewCreateGameServerClusterResponse { + + /** PreviewCreateGameServerClusterResponse etag */ + etag?: (string|null); + + /** PreviewCreateGameServerClusterResponse targetState */ + targetState?: (google.cloud.gaming.v1beta.ITargetState|null); + } + + /** Represents a PreviewCreateGameServerClusterResponse. */ + class PreviewCreateGameServerClusterResponse implements IPreviewCreateGameServerClusterResponse { + + /** + * Constructs a new PreviewCreateGameServerClusterResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse); + + /** PreviewCreateGameServerClusterResponse etag. */ + public etag: string; + + /** PreviewCreateGameServerClusterResponse targetState. */ + public targetState?: (google.cloud.gaming.v1beta.ITargetState|null); + + /** + * Creates a new PreviewCreateGameServerClusterResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PreviewCreateGameServerClusterResponse instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse): google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse; + + /** + * Encodes the specified PreviewCreateGameServerClusterResponse message. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse.verify|verify} messages. + * @param message PreviewCreateGameServerClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreviewCreateGameServerClusterResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse.verify|verify} messages. + * @param message PreviewCreateGameServerClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreviewCreateGameServerClusterResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreviewCreateGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse; + + /** + * Decodes a PreviewCreateGameServerClusterResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreviewCreateGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse; + + /** + * Verifies a PreviewCreateGameServerClusterResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreviewCreateGameServerClusterResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreviewCreateGameServerClusterResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse; + + /** + * Creates a plain object from a PreviewCreateGameServerClusterResponse message. Also converts values to other types if specified. + * @param message PreviewCreateGameServerClusterResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreviewCreateGameServerClusterResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PreviewCreateGameServerClusterResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteGameServerClusterRequest. */ + interface IDeleteGameServerClusterRequest { + + /** DeleteGameServerClusterRequest name */ + name?: (string|null); + } + + /** Represents a DeleteGameServerClusterRequest. */ + class DeleteGameServerClusterRequest implements IDeleteGameServerClusterRequest { + + /** + * Constructs a new DeleteGameServerClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest); + + /** DeleteGameServerClusterRequest name. */ + public name: string; + + /** + * Creates a new DeleteGameServerClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGameServerClusterRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest): google.cloud.gaming.v1beta.DeleteGameServerClusterRequest; + + /** + * Encodes the specified DeleteGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.DeleteGameServerClusterRequest.verify|verify} messages. + * @param message DeleteGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.DeleteGameServerClusterRequest.verify|verify} messages. + * @param message DeleteGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGameServerClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.DeleteGameServerClusterRequest; + + /** + * Decodes a DeleteGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.DeleteGameServerClusterRequest; + + /** + * Verifies a DeleteGameServerClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGameServerClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.DeleteGameServerClusterRequest; + + /** + * Creates a plain object from a DeleteGameServerClusterRequest message. Also converts values to other types if specified. + * @param message DeleteGameServerClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.DeleteGameServerClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGameServerClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteGameServerClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PreviewDeleteGameServerClusterRequest. */ + interface IPreviewDeleteGameServerClusterRequest { + + /** PreviewDeleteGameServerClusterRequest name */ + name?: (string|null); + + /** PreviewDeleteGameServerClusterRequest previewTime */ + previewTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a PreviewDeleteGameServerClusterRequest. */ + class PreviewDeleteGameServerClusterRequest implements IPreviewDeleteGameServerClusterRequest { + + /** + * Constructs a new PreviewDeleteGameServerClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest); + + /** PreviewDeleteGameServerClusterRequest name. */ + public name: string; + + /** PreviewDeleteGameServerClusterRequest previewTime. */ + public previewTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new PreviewDeleteGameServerClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PreviewDeleteGameServerClusterRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest): google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest; + + /** + * Encodes the specified PreviewDeleteGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest.verify|verify} messages. + * @param message PreviewDeleteGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreviewDeleteGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest.verify|verify} messages. + * @param message PreviewDeleteGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreviewDeleteGameServerClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreviewDeleteGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest; + + /** + * Decodes a PreviewDeleteGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreviewDeleteGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest; + + /** + * Verifies a PreviewDeleteGameServerClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreviewDeleteGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreviewDeleteGameServerClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest; + + /** + * Creates a plain object from a PreviewDeleteGameServerClusterRequest message. Also converts values to other types if specified. + * @param message PreviewDeleteGameServerClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreviewDeleteGameServerClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PreviewDeleteGameServerClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PreviewDeleteGameServerClusterResponse. */ + interface IPreviewDeleteGameServerClusterResponse { + + /** PreviewDeleteGameServerClusterResponse etag */ + etag?: (string|null); + + /** PreviewDeleteGameServerClusterResponse targetState */ + targetState?: (google.cloud.gaming.v1beta.ITargetState|null); + } + + /** Represents a PreviewDeleteGameServerClusterResponse. */ + class PreviewDeleteGameServerClusterResponse implements IPreviewDeleteGameServerClusterResponse { + + /** + * Constructs a new PreviewDeleteGameServerClusterResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse); + + /** PreviewDeleteGameServerClusterResponse etag. */ + public etag: string; + + /** PreviewDeleteGameServerClusterResponse targetState. */ + public targetState?: (google.cloud.gaming.v1beta.ITargetState|null); + + /** + * Creates a new PreviewDeleteGameServerClusterResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PreviewDeleteGameServerClusterResponse instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse): google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse; + + /** + * Encodes the specified PreviewDeleteGameServerClusterResponse message. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse.verify|verify} messages. + * @param message PreviewDeleteGameServerClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreviewDeleteGameServerClusterResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse.verify|verify} messages. + * @param message PreviewDeleteGameServerClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreviewDeleteGameServerClusterResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreviewDeleteGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse; + + /** + * Decodes a PreviewDeleteGameServerClusterResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreviewDeleteGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse; + + /** + * Verifies a PreviewDeleteGameServerClusterResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreviewDeleteGameServerClusterResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreviewDeleteGameServerClusterResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse; + + /** + * Creates a plain object from a PreviewDeleteGameServerClusterResponse message. Also converts values to other types if specified. + * @param message PreviewDeleteGameServerClusterResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreviewDeleteGameServerClusterResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PreviewDeleteGameServerClusterResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateGameServerClusterRequest. */ + interface IUpdateGameServerClusterRequest { + + /** UpdateGameServerClusterRequest gameServerCluster */ + gameServerCluster?: (google.cloud.gaming.v1beta.IGameServerCluster|null); + + /** UpdateGameServerClusterRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateGameServerClusterRequest. */ + class UpdateGameServerClusterRequest implements IUpdateGameServerClusterRequest { + + /** + * Constructs a new UpdateGameServerClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest); + + /** UpdateGameServerClusterRequest gameServerCluster. */ + public gameServerCluster?: (google.cloud.gaming.v1beta.IGameServerCluster|null); + + /** UpdateGameServerClusterRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateGameServerClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateGameServerClusterRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest): google.cloud.gaming.v1beta.UpdateGameServerClusterRequest; + + /** + * Encodes the specified UpdateGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.UpdateGameServerClusterRequest.verify|verify} messages. + * @param message UpdateGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.UpdateGameServerClusterRequest.verify|verify} messages. + * @param message UpdateGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateGameServerClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.UpdateGameServerClusterRequest; + + /** + * Decodes an UpdateGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.UpdateGameServerClusterRequest; + + /** + * Verifies an UpdateGameServerClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateGameServerClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.UpdateGameServerClusterRequest; + + /** + * Creates a plain object from an UpdateGameServerClusterRequest message. Also converts values to other types if specified. + * @param message UpdateGameServerClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.UpdateGameServerClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateGameServerClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateGameServerClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PreviewUpdateGameServerClusterRequest. */ + interface IPreviewUpdateGameServerClusterRequest { + + /** PreviewUpdateGameServerClusterRequest gameServerCluster */ + gameServerCluster?: (google.cloud.gaming.v1beta.IGameServerCluster|null); + + /** PreviewUpdateGameServerClusterRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** PreviewUpdateGameServerClusterRequest previewTime */ + previewTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a PreviewUpdateGameServerClusterRequest. */ + class PreviewUpdateGameServerClusterRequest implements IPreviewUpdateGameServerClusterRequest { + + /** + * Constructs a new PreviewUpdateGameServerClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest); + + /** PreviewUpdateGameServerClusterRequest gameServerCluster. */ + public gameServerCluster?: (google.cloud.gaming.v1beta.IGameServerCluster|null); + + /** PreviewUpdateGameServerClusterRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** PreviewUpdateGameServerClusterRequest previewTime. */ + public previewTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new PreviewUpdateGameServerClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PreviewUpdateGameServerClusterRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest): google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest; + + /** + * Encodes the specified PreviewUpdateGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest.verify|verify} messages. + * @param message PreviewUpdateGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreviewUpdateGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest.verify|verify} messages. + * @param message PreviewUpdateGameServerClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreviewUpdateGameServerClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreviewUpdateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest; + + /** + * Decodes a PreviewUpdateGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreviewUpdateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest; + + /** + * Verifies a PreviewUpdateGameServerClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreviewUpdateGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreviewUpdateGameServerClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest; + + /** + * Creates a plain object from a PreviewUpdateGameServerClusterRequest message. Also converts values to other types if specified. + * @param message PreviewUpdateGameServerClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreviewUpdateGameServerClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PreviewUpdateGameServerClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PreviewUpdateGameServerClusterResponse. */ + interface IPreviewUpdateGameServerClusterResponse { + + /** PreviewUpdateGameServerClusterResponse etag */ + etag?: (string|null); + + /** PreviewUpdateGameServerClusterResponse targetState */ + targetState?: (google.cloud.gaming.v1beta.ITargetState|null); + } + + /** Represents a PreviewUpdateGameServerClusterResponse. */ + class PreviewUpdateGameServerClusterResponse implements IPreviewUpdateGameServerClusterResponse { + + /** + * Constructs a new PreviewUpdateGameServerClusterResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse); + + /** PreviewUpdateGameServerClusterResponse etag. */ + public etag: string; + + /** PreviewUpdateGameServerClusterResponse targetState. */ + public targetState?: (google.cloud.gaming.v1beta.ITargetState|null); + + /** + * Creates a new PreviewUpdateGameServerClusterResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PreviewUpdateGameServerClusterResponse instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse): google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse; + + /** + * Encodes the specified PreviewUpdateGameServerClusterResponse message. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse.verify|verify} messages. + * @param message PreviewUpdateGameServerClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreviewUpdateGameServerClusterResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse.verify|verify} messages. + * @param message PreviewUpdateGameServerClusterResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreviewUpdateGameServerClusterResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreviewUpdateGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse; + + /** + * Decodes a PreviewUpdateGameServerClusterResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreviewUpdateGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse; + + /** + * Verifies a PreviewUpdateGameServerClusterResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreviewUpdateGameServerClusterResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreviewUpdateGameServerClusterResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse; + + /** + * Creates a plain object from a PreviewUpdateGameServerClusterResponse message. Also converts values to other types if specified. + * @param message PreviewUpdateGameServerClusterResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreviewUpdateGameServerClusterResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PreviewUpdateGameServerClusterResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GameServerClusterConnectionInfo. */ + interface IGameServerClusterConnectionInfo { + + /** GameServerClusterConnectionInfo gkeClusterReference */ + gkeClusterReference?: (google.cloud.gaming.v1beta.IGkeClusterReference|null); + + /** GameServerClusterConnectionInfo namespace */ + namespace?: (string|null); + } + + /** Represents a GameServerClusterConnectionInfo. */ + class GameServerClusterConnectionInfo implements IGameServerClusterConnectionInfo { + + /** + * Constructs a new GameServerClusterConnectionInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IGameServerClusterConnectionInfo); + + /** GameServerClusterConnectionInfo gkeClusterReference. */ + public gkeClusterReference?: (google.cloud.gaming.v1beta.IGkeClusterReference|null); + + /** GameServerClusterConnectionInfo namespace. */ + public namespace: string; + + /** GameServerClusterConnectionInfo clusterReference. */ + public clusterReference?: "gkeClusterReference"; + + /** + * Creates a new GameServerClusterConnectionInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GameServerClusterConnectionInfo instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IGameServerClusterConnectionInfo): google.cloud.gaming.v1beta.GameServerClusterConnectionInfo; + + /** + * Encodes the specified GameServerClusterConnectionInfo message. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerClusterConnectionInfo.verify|verify} messages. + * @param message GameServerClusterConnectionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IGameServerClusterConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GameServerClusterConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerClusterConnectionInfo.verify|verify} messages. + * @param message GameServerClusterConnectionInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IGameServerClusterConnectionInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GameServerClusterConnectionInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GameServerClusterConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.GameServerClusterConnectionInfo; + + /** + * Decodes a GameServerClusterConnectionInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GameServerClusterConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.GameServerClusterConnectionInfo; + + /** + * Verifies a GameServerClusterConnectionInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GameServerClusterConnectionInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GameServerClusterConnectionInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.GameServerClusterConnectionInfo; + + /** + * Creates a plain object from a GameServerClusterConnectionInfo message. Also converts values to other types if specified. + * @param message GameServerClusterConnectionInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.GameServerClusterConnectionInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GameServerClusterConnectionInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GameServerClusterConnectionInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GkeClusterReference. */ + interface IGkeClusterReference { + + /** GkeClusterReference cluster */ + cluster?: (string|null); + } + + /** Represents a GkeClusterReference. */ + class GkeClusterReference implements IGkeClusterReference { + + /** + * Constructs a new GkeClusterReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IGkeClusterReference); + + /** GkeClusterReference cluster. */ + public cluster: string; + + /** + * Creates a new GkeClusterReference instance using the specified properties. + * @param [properties] Properties to set + * @returns GkeClusterReference instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IGkeClusterReference): google.cloud.gaming.v1beta.GkeClusterReference; + + /** + * Encodes the specified GkeClusterReference message. Does not implicitly {@link google.cloud.gaming.v1beta.GkeClusterReference.verify|verify} messages. + * @param message GkeClusterReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IGkeClusterReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GkeClusterReference message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GkeClusterReference.verify|verify} messages. + * @param message GkeClusterReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IGkeClusterReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GkeClusterReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GkeClusterReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.GkeClusterReference; + + /** + * Decodes a GkeClusterReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GkeClusterReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.GkeClusterReference; + + /** + * Verifies a GkeClusterReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GkeClusterReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GkeClusterReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.GkeClusterReference; + + /** + * Creates a plain object from a GkeClusterReference message. Also converts values to other types if specified. + * @param message GkeClusterReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.GkeClusterReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GkeClusterReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GkeClusterReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GameServerCluster. */ + interface IGameServerCluster { + + /** GameServerCluster name */ + name?: (string|null); + + /** GameServerCluster createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** GameServerCluster updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** GameServerCluster labels */ + labels?: ({ [k: string]: string }|null); + + /** GameServerCluster connectionInfo */ + connectionInfo?: (google.cloud.gaming.v1beta.IGameServerClusterConnectionInfo|null); + + /** GameServerCluster etag */ + etag?: (string|null); + + /** GameServerCluster description */ + description?: (string|null); + } + + /** Represents a GameServerCluster. */ + class GameServerCluster implements IGameServerCluster { + + /** + * Constructs a new GameServerCluster. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IGameServerCluster); + + /** GameServerCluster name. */ + public name: string; + + /** GameServerCluster createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** GameServerCluster updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** GameServerCluster labels. */ + public labels: { [k: string]: string }; + + /** GameServerCluster connectionInfo. */ + public connectionInfo?: (google.cloud.gaming.v1beta.IGameServerClusterConnectionInfo|null); + + /** GameServerCluster etag. */ + public etag: string; + + /** GameServerCluster description. */ + public description: string; + + /** + * Creates a new GameServerCluster instance using the specified properties. + * @param [properties] Properties to set + * @returns GameServerCluster instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IGameServerCluster): google.cloud.gaming.v1beta.GameServerCluster; + + /** + * Encodes the specified GameServerCluster message. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerCluster.verify|verify} messages. + * @param message GameServerCluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IGameServerCluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GameServerCluster message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerCluster.verify|verify} messages. + * @param message GameServerCluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IGameServerCluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GameServerCluster message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GameServerCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.GameServerCluster; + + /** + * Decodes a GameServerCluster message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GameServerCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.GameServerCluster; + + /** + * Verifies a GameServerCluster message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GameServerCluster message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GameServerCluster + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.GameServerCluster; + + /** + * Creates a plain object from a GameServerCluster message. Also converts values to other types if specified. + * @param message GameServerCluster + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.GameServerCluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GameServerCluster to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GameServerCluster + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a GameServerClustersService */ + class GameServerClustersService extends $protobuf.rpc.Service { + + /** + * Constructs a new GameServerClustersService 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 GameServerClustersService 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): GameServerClustersService; + + /** + * Calls ListGameServerClusters. + * @param request ListGameServerClustersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListGameServerClustersResponse + */ + public listGameServerClusters(request: google.cloud.gaming.v1beta.IListGameServerClustersRequest, callback: google.cloud.gaming.v1beta.GameServerClustersService.ListGameServerClustersCallback): void; + + /** + * Calls ListGameServerClusters. + * @param request ListGameServerClustersRequest message or plain object + * @returns Promise + */ + public listGameServerClusters(request: google.cloud.gaming.v1beta.IListGameServerClustersRequest): Promise; + + /** + * Calls GetGameServerCluster. + * @param request GetGameServerClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GameServerCluster + */ + public getGameServerCluster(request: google.cloud.gaming.v1beta.IGetGameServerClusterRequest, callback: google.cloud.gaming.v1beta.GameServerClustersService.GetGameServerClusterCallback): void; + + /** + * Calls GetGameServerCluster. + * @param request GetGameServerClusterRequest message or plain object + * @returns Promise + */ + public getGameServerCluster(request: google.cloud.gaming.v1beta.IGetGameServerClusterRequest): Promise; + + /** + * Calls CreateGameServerCluster. + * @param request CreateGameServerClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createGameServerCluster(request: google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, callback: google.cloud.gaming.v1beta.GameServerClustersService.CreateGameServerClusterCallback): void; + + /** + * Calls CreateGameServerCluster. + * @param request CreateGameServerClusterRequest message or plain object + * @returns Promise + */ + public createGameServerCluster(request: google.cloud.gaming.v1beta.ICreateGameServerClusterRequest): Promise; + + /** + * Calls PreviewCreateGameServerCluster. + * @param request PreviewCreateGameServerClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PreviewCreateGameServerClusterResponse + */ + public previewCreateGameServerCluster(request: google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, callback: google.cloud.gaming.v1beta.GameServerClustersService.PreviewCreateGameServerClusterCallback): void; + + /** + * Calls PreviewCreateGameServerCluster. + * @param request PreviewCreateGameServerClusterRequest message or plain object + * @returns Promise + */ + public previewCreateGameServerCluster(request: google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest): Promise; + + /** + * Calls DeleteGameServerCluster. + * @param request DeleteGameServerClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteGameServerCluster(request: google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, callback: google.cloud.gaming.v1beta.GameServerClustersService.DeleteGameServerClusterCallback): void; + + /** + * Calls DeleteGameServerCluster. + * @param request DeleteGameServerClusterRequest message or plain object + * @returns Promise + */ + public deleteGameServerCluster(request: google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest): Promise; + + /** + * Calls PreviewDeleteGameServerCluster. + * @param request PreviewDeleteGameServerClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PreviewDeleteGameServerClusterResponse + */ + public previewDeleteGameServerCluster(request: google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, callback: google.cloud.gaming.v1beta.GameServerClustersService.PreviewDeleteGameServerClusterCallback): void; + + /** + * Calls PreviewDeleteGameServerCluster. + * @param request PreviewDeleteGameServerClusterRequest message or plain object + * @returns Promise + */ + public previewDeleteGameServerCluster(request: google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest): Promise; + + /** + * Calls UpdateGameServerCluster. + * @param request UpdateGameServerClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateGameServerCluster(request: google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, callback: google.cloud.gaming.v1beta.GameServerClustersService.UpdateGameServerClusterCallback): void; + + /** + * Calls UpdateGameServerCluster. + * @param request UpdateGameServerClusterRequest message or plain object + * @returns Promise + */ + public updateGameServerCluster(request: google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest): Promise; + + /** + * Calls PreviewUpdateGameServerCluster. + * @param request PreviewUpdateGameServerClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PreviewUpdateGameServerClusterResponse + */ + public previewUpdateGameServerCluster(request: google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, callback: google.cloud.gaming.v1beta.GameServerClustersService.PreviewUpdateGameServerClusterCallback): void; + + /** + * Calls PreviewUpdateGameServerCluster. + * @param request PreviewUpdateGameServerClusterRequest message or plain object + * @returns Promise + */ + public previewUpdateGameServerCluster(request: google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest): Promise; + } + + namespace GameServerClustersService { + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|listGameServerClusters}. + * @param error Error, if any + * @param [response] ListGameServerClustersResponse + */ + type ListGameServerClustersCallback = (error: (Error|null), response?: google.cloud.gaming.v1beta.ListGameServerClustersResponse) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|getGameServerCluster}. + * @param error Error, if any + * @param [response] GameServerCluster + */ + type GetGameServerClusterCallback = (error: (Error|null), response?: google.cloud.gaming.v1beta.GameServerCluster) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|createGameServerCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateGameServerClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|previewCreateGameServerCluster}. + * @param error Error, if any + * @param [response] PreviewCreateGameServerClusterResponse + */ + type PreviewCreateGameServerClusterCallback = (error: (Error|null), response?: google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|deleteGameServerCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteGameServerClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|previewDeleteGameServerCluster}. + * @param error Error, if any + * @param [response] PreviewDeleteGameServerClusterResponse + */ + type PreviewDeleteGameServerClusterCallback = (error: (Error|null), response?: google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|updateGameServerCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateGameServerClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|previewUpdateGameServerCluster}. + * @param error Error, if any + * @param [response] PreviewUpdateGameServerClusterResponse + */ + type PreviewUpdateGameServerClusterCallback = (error: (Error|null), response?: google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse) => void; + } + + /** Properties of a ListGameServerConfigsRequest. */ + interface IListGameServerConfigsRequest { + + /** ListGameServerConfigsRequest parent */ + parent?: (string|null); + + /** ListGameServerConfigsRequest pageSize */ + pageSize?: (number|null); + + /** ListGameServerConfigsRequest pageToken */ + pageToken?: (string|null); + + /** ListGameServerConfigsRequest filter */ + filter?: (string|null); + + /** ListGameServerConfigsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListGameServerConfigsRequest. */ + class ListGameServerConfigsRequest implements IListGameServerConfigsRequest { + + /** + * Constructs a new ListGameServerConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IListGameServerConfigsRequest); + + /** ListGameServerConfigsRequest parent. */ + public parent: string; + + /** ListGameServerConfigsRequest pageSize. */ + public pageSize: number; + + /** ListGameServerConfigsRequest pageToken. */ + public pageToken: string; + + /** ListGameServerConfigsRequest filter. */ + public filter: string; + + /** ListGameServerConfigsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListGameServerConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGameServerConfigsRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IListGameServerConfigsRequest): google.cloud.gaming.v1beta.ListGameServerConfigsRequest; + + /** + * Encodes the specified ListGameServerConfigsRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerConfigsRequest.verify|verify} messages. + * @param message ListGameServerConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IListGameServerConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGameServerConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerConfigsRequest.verify|verify} messages. + * @param message ListGameServerConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IListGameServerConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGameServerConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGameServerConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.ListGameServerConfigsRequest; + + /** + * Decodes a ListGameServerConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGameServerConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.ListGameServerConfigsRequest; + + /** + * Verifies a ListGameServerConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGameServerConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGameServerConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.ListGameServerConfigsRequest; + + /** + * Creates a plain object from a ListGameServerConfigsRequest message. Also converts values to other types if specified. + * @param message ListGameServerConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.ListGameServerConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGameServerConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGameServerConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGameServerConfigsResponse. */ + interface IListGameServerConfigsResponse { + + /** ListGameServerConfigsResponse gameServerConfigs */ + gameServerConfigs?: (google.cloud.gaming.v1beta.IGameServerConfig[]|null); + + /** ListGameServerConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListGameServerConfigsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListGameServerConfigsResponse. */ + class ListGameServerConfigsResponse implements IListGameServerConfigsResponse { + + /** + * Constructs a new ListGameServerConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IListGameServerConfigsResponse); + + /** ListGameServerConfigsResponse gameServerConfigs. */ + public gameServerConfigs: google.cloud.gaming.v1beta.IGameServerConfig[]; + + /** ListGameServerConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListGameServerConfigsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListGameServerConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGameServerConfigsResponse instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IListGameServerConfigsResponse): google.cloud.gaming.v1beta.ListGameServerConfigsResponse; + + /** + * Encodes the specified ListGameServerConfigsResponse message. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerConfigsResponse.verify|verify} messages. + * @param message ListGameServerConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IListGameServerConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGameServerConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerConfigsResponse.verify|verify} messages. + * @param message ListGameServerConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IListGameServerConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGameServerConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGameServerConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.ListGameServerConfigsResponse; + + /** + * Decodes a ListGameServerConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGameServerConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.ListGameServerConfigsResponse; + + /** + * Verifies a ListGameServerConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGameServerConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGameServerConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.ListGameServerConfigsResponse; + + /** + * Creates a plain object from a ListGameServerConfigsResponse message. Also converts values to other types if specified. + * @param message ListGameServerConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.ListGameServerConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGameServerConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGameServerConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetGameServerConfigRequest. */ + interface IGetGameServerConfigRequest { + + /** GetGameServerConfigRequest name */ + name?: (string|null); + } + + /** Represents a GetGameServerConfigRequest. */ + class GetGameServerConfigRequest implements IGetGameServerConfigRequest { + + /** + * Constructs a new GetGameServerConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IGetGameServerConfigRequest); + + /** GetGameServerConfigRequest name. */ + public name: string; + + /** + * Creates a new GetGameServerConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGameServerConfigRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IGetGameServerConfigRequest): google.cloud.gaming.v1beta.GetGameServerConfigRequest; + + /** + * Encodes the specified GetGameServerConfigRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.GetGameServerConfigRequest.verify|verify} messages. + * @param message GetGameServerConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IGetGameServerConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGameServerConfigRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GetGameServerConfigRequest.verify|verify} messages. + * @param message GetGameServerConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IGetGameServerConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGameServerConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.GetGameServerConfigRequest; + + /** + * Decodes a GetGameServerConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.GetGameServerConfigRequest; + + /** + * Verifies a GetGameServerConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGameServerConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGameServerConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.GetGameServerConfigRequest; + + /** + * Creates a plain object from a GetGameServerConfigRequest message. Also converts values to other types if specified. + * @param message GetGameServerConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.GetGameServerConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGameServerConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGameServerConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateGameServerConfigRequest. */ + interface ICreateGameServerConfigRequest { + + /** CreateGameServerConfigRequest parent */ + parent?: (string|null); + + /** CreateGameServerConfigRequest configId */ + configId?: (string|null); + + /** CreateGameServerConfigRequest gameServerConfig */ + gameServerConfig?: (google.cloud.gaming.v1beta.IGameServerConfig|null); + } + + /** Represents a CreateGameServerConfigRequest. */ + class CreateGameServerConfigRequest implements ICreateGameServerConfigRequest { + + /** + * Constructs a new CreateGameServerConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.ICreateGameServerConfigRequest); + + /** CreateGameServerConfigRequest parent. */ + public parent: string; + + /** CreateGameServerConfigRequest configId. */ + public configId: string; + + /** CreateGameServerConfigRequest gameServerConfig. */ + public gameServerConfig?: (google.cloud.gaming.v1beta.IGameServerConfig|null); + + /** + * Creates a new CreateGameServerConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGameServerConfigRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.ICreateGameServerConfigRequest): google.cloud.gaming.v1beta.CreateGameServerConfigRequest; + + /** + * Encodes the specified CreateGameServerConfigRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.CreateGameServerConfigRequest.verify|verify} messages. + * @param message CreateGameServerConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateGameServerConfigRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.CreateGameServerConfigRequest.verify|verify} messages. + * @param message CreateGameServerConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateGameServerConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.CreateGameServerConfigRequest; + + /** + * Decodes a CreateGameServerConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.CreateGameServerConfigRequest; + + /** + * Verifies a CreateGameServerConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateGameServerConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateGameServerConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.CreateGameServerConfigRequest; + + /** + * Creates a plain object from a CreateGameServerConfigRequest message. Also converts values to other types if specified. + * @param message CreateGameServerConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.CreateGameServerConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateGameServerConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateGameServerConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteGameServerConfigRequest. */ + interface IDeleteGameServerConfigRequest { + + /** DeleteGameServerConfigRequest name */ + name?: (string|null); + } + + /** Represents a DeleteGameServerConfigRequest. */ + class DeleteGameServerConfigRequest implements IDeleteGameServerConfigRequest { + + /** + * Constructs a new DeleteGameServerConfigRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest); + + /** DeleteGameServerConfigRequest name. */ + public name: string; + + /** + * Creates a new DeleteGameServerConfigRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGameServerConfigRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest): google.cloud.gaming.v1beta.DeleteGameServerConfigRequest; + + /** + * Encodes the specified DeleteGameServerConfigRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.DeleteGameServerConfigRequest.verify|verify} messages. + * @param message DeleteGameServerConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGameServerConfigRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.DeleteGameServerConfigRequest.verify|verify} messages. + * @param message DeleteGameServerConfigRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGameServerConfigRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.DeleteGameServerConfigRequest; + + /** + * Decodes a DeleteGameServerConfigRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.DeleteGameServerConfigRequest; + + /** + * Verifies a DeleteGameServerConfigRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGameServerConfigRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGameServerConfigRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.DeleteGameServerConfigRequest; + + /** + * Creates a plain object from a DeleteGameServerConfigRequest message. Also converts values to other types if specified. + * @param message DeleteGameServerConfigRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.DeleteGameServerConfigRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGameServerConfigRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteGameServerConfigRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ScalingConfig. */ + interface IScalingConfig { + + /** ScalingConfig name */ + name?: (string|null); + + /** ScalingConfig fleetAutoscalerSpec */ + fleetAutoscalerSpec?: (string|null); + + /** ScalingConfig selectors */ + selectors?: (google.cloud.gaming.v1beta.ILabelSelector[]|null); + + /** ScalingConfig schedules */ + schedules?: (google.cloud.gaming.v1beta.ISchedule[]|null); + } + + /** Represents a ScalingConfig. */ + class ScalingConfig implements IScalingConfig { + + /** + * Constructs a new ScalingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IScalingConfig); + + /** ScalingConfig name. */ + public name: string; + + /** ScalingConfig fleetAutoscalerSpec. */ + public fleetAutoscalerSpec: string; + + /** ScalingConfig selectors. */ + public selectors: google.cloud.gaming.v1beta.ILabelSelector[]; + + /** ScalingConfig schedules. */ + public schedules: google.cloud.gaming.v1beta.ISchedule[]; + + /** + * Creates a new ScalingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ScalingConfig instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IScalingConfig): google.cloud.gaming.v1beta.ScalingConfig; + + /** + * Encodes the specified ScalingConfig message. Does not implicitly {@link google.cloud.gaming.v1beta.ScalingConfig.verify|verify} messages. + * @param message ScalingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IScalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ScalingConfig message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.ScalingConfig.verify|verify} messages. + * @param message ScalingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IScalingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ScalingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ScalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.ScalingConfig; + + /** + * Decodes a ScalingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ScalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.ScalingConfig; + + /** + * Verifies a ScalingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ScalingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ScalingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.ScalingConfig; + + /** + * Creates a plain object from a ScalingConfig message. Also converts values to other types if specified. + * @param message ScalingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.ScalingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ScalingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ScalingConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FleetConfig. */ + interface IFleetConfig { + + /** FleetConfig fleetSpec */ + fleetSpec?: (string|null); + + /** FleetConfig name */ + name?: (string|null); + } + + /** Represents a FleetConfig. */ + class FleetConfig implements IFleetConfig { + + /** + * Constructs a new FleetConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IFleetConfig); + + /** FleetConfig fleetSpec. */ + public fleetSpec: string; + + /** FleetConfig name. */ + public name: string; + + /** + * Creates a new FleetConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns FleetConfig instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IFleetConfig): google.cloud.gaming.v1beta.FleetConfig; + + /** + * Encodes the specified FleetConfig message. Does not implicitly {@link google.cloud.gaming.v1beta.FleetConfig.verify|verify} messages. + * @param message FleetConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IFleetConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FleetConfig message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.FleetConfig.verify|verify} messages. + * @param message FleetConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IFleetConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FleetConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FleetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.FleetConfig; + + /** + * Decodes a FleetConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FleetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.FleetConfig; + + /** + * Verifies a FleetConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FleetConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FleetConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.FleetConfig; + + /** + * Creates a plain object from a FleetConfig message. Also converts values to other types if specified. + * @param message FleetConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.FleetConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FleetConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FleetConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GameServerConfig. */ + interface IGameServerConfig { + + /** GameServerConfig name */ + name?: (string|null); + + /** GameServerConfig createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** GameServerConfig updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** GameServerConfig labels */ + labels?: ({ [k: string]: string }|null); + + /** GameServerConfig fleetConfigs */ + fleetConfigs?: (google.cloud.gaming.v1beta.IFleetConfig[]|null); + + /** GameServerConfig scalingConfigs */ + scalingConfigs?: (google.cloud.gaming.v1beta.IScalingConfig[]|null); + + /** GameServerConfig description */ + description?: (string|null); + } + + /** Represents a GameServerConfig. */ + class GameServerConfig implements IGameServerConfig { + + /** + * Constructs a new GameServerConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IGameServerConfig); + + /** GameServerConfig name. */ + public name: string; + + /** GameServerConfig createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** GameServerConfig updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** GameServerConfig labels. */ + public labels: { [k: string]: string }; + + /** GameServerConfig fleetConfigs. */ + public fleetConfigs: google.cloud.gaming.v1beta.IFleetConfig[]; + + /** GameServerConfig scalingConfigs. */ + public scalingConfigs: google.cloud.gaming.v1beta.IScalingConfig[]; + + /** GameServerConfig description. */ + public description: string; + + /** + * Creates a new GameServerConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GameServerConfig instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IGameServerConfig): google.cloud.gaming.v1beta.GameServerConfig; + + /** + * Encodes the specified GameServerConfig message. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerConfig.verify|verify} messages. + * @param message GameServerConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IGameServerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GameServerConfig message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerConfig.verify|verify} messages. + * @param message GameServerConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IGameServerConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GameServerConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GameServerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.GameServerConfig; + + /** + * Decodes a GameServerConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GameServerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.GameServerConfig; + + /** + * Verifies a GameServerConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GameServerConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GameServerConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.GameServerConfig; + + /** + * Creates a plain object from a GameServerConfig message. Also converts values to other types if specified. + * @param message GameServerConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.GameServerConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GameServerConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GameServerConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a GameServerConfigsService */ + class GameServerConfigsService extends $protobuf.rpc.Service { + + /** + * Constructs a new GameServerConfigsService 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 GameServerConfigsService 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): GameServerConfigsService; + + /** + * Calls ListGameServerConfigs. + * @param request ListGameServerConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListGameServerConfigsResponse + */ + public listGameServerConfigs(request: google.cloud.gaming.v1beta.IListGameServerConfigsRequest, callback: google.cloud.gaming.v1beta.GameServerConfigsService.ListGameServerConfigsCallback): void; + + /** + * Calls ListGameServerConfigs. + * @param request ListGameServerConfigsRequest message or plain object + * @returns Promise + */ + public listGameServerConfigs(request: google.cloud.gaming.v1beta.IListGameServerConfigsRequest): Promise; + + /** + * Calls GetGameServerConfig. + * @param request GetGameServerConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GameServerConfig + */ + public getGameServerConfig(request: google.cloud.gaming.v1beta.IGetGameServerConfigRequest, callback: google.cloud.gaming.v1beta.GameServerConfigsService.GetGameServerConfigCallback): void; + + /** + * Calls GetGameServerConfig. + * @param request GetGameServerConfigRequest message or plain object + * @returns Promise + */ + public getGameServerConfig(request: google.cloud.gaming.v1beta.IGetGameServerConfigRequest): Promise; + + /** + * Calls CreateGameServerConfig. + * @param request CreateGameServerConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createGameServerConfig(request: google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, callback: google.cloud.gaming.v1beta.GameServerConfigsService.CreateGameServerConfigCallback): void; + + /** + * Calls CreateGameServerConfig. + * @param request CreateGameServerConfigRequest message or plain object + * @returns Promise + */ + public createGameServerConfig(request: google.cloud.gaming.v1beta.ICreateGameServerConfigRequest): Promise; + + /** + * Calls DeleteGameServerConfig. + * @param request DeleteGameServerConfigRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteGameServerConfig(request: google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, callback: google.cloud.gaming.v1beta.GameServerConfigsService.DeleteGameServerConfigCallback): void; + + /** + * Calls DeleteGameServerConfig. + * @param request DeleteGameServerConfigRequest message or plain object + * @returns Promise + */ + public deleteGameServerConfig(request: google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest): Promise; + } + + namespace GameServerConfigsService { + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerConfigsService|listGameServerConfigs}. + * @param error Error, if any + * @param [response] ListGameServerConfigsResponse + */ + type ListGameServerConfigsCallback = (error: (Error|null), response?: google.cloud.gaming.v1beta.ListGameServerConfigsResponse) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerConfigsService|getGameServerConfig}. + * @param error Error, if any + * @param [response] GameServerConfig + */ + type GetGameServerConfigCallback = (error: (Error|null), response?: google.cloud.gaming.v1beta.GameServerConfig) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerConfigsService|createGameServerConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateGameServerConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerConfigsService|deleteGameServerConfig}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteGameServerConfigCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a ListGameServerDeploymentsRequest. */ + interface IListGameServerDeploymentsRequest { + + /** ListGameServerDeploymentsRequest parent */ + parent?: (string|null); + + /** ListGameServerDeploymentsRequest pageSize */ + pageSize?: (number|null); + + /** ListGameServerDeploymentsRequest pageToken */ + pageToken?: (string|null); + + /** ListGameServerDeploymentsRequest filter */ + filter?: (string|null); + + /** ListGameServerDeploymentsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListGameServerDeploymentsRequest. */ + class ListGameServerDeploymentsRequest implements IListGameServerDeploymentsRequest { + + /** + * Constructs a new ListGameServerDeploymentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest); + + /** ListGameServerDeploymentsRequest parent. */ + public parent: string; + + /** ListGameServerDeploymentsRequest pageSize. */ + public pageSize: number; + + /** ListGameServerDeploymentsRequest pageToken. */ + public pageToken: string; + + /** ListGameServerDeploymentsRequest filter. */ + public filter: string; + + /** ListGameServerDeploymentsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListGameServerDeploymentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGameServerDeploymentsRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest): google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest; + + /** + * Encodes the specified ListGameServerDeploymentsRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest.verify|verify} messages. + * @param message ListGameServerDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGameServerDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest.verify|verify} messages. + * @param message ListGameServerDeploymentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGameServerDeploymentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGameServerDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest; + + /** + * Decodes a ListGameServerDeploymentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGameServerDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest; + + /** + * Verifies a ListGameServerDeploymentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGameServerDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGameServerDeploymentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest; + + /** + * Creates a plain object from a ListGameServerDeploymentsRequest message. Also converts values to other types if specified. + * @param message ListGameServerDeploymentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGameServerDeploymentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGameServerDeploymentsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGameServerDeploymentsResponse. */ + interface IListGameServerDeploymentsResponse { + + /** ListGameServerDeploymentsResponse gameServerDeployments */ + gameServerDeployments?: (google.cloud.gaming.v1beta.IGameServerDeployment[]|null); + + /** ListGameServerDeploymentsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListGameServerDeploymentsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListGameServerDeploymentsResponse. */ + class ListGameServerDeploymentsResponse implements IListGameServerDeploymentsResponse { + + /** + * Constructs a new ListGameServerDeploymentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse); + + /** ListGameServerDeploymentsResponse gameServerDeployments. */ + public gameServerDeployments: google.cloud.gaming.v1beta.IGameServerDeployment[]; + + /** ListGameServerDeploymentsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListGameServerDeploymentsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListGameServerDeploymentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGameServerDeploymentsResponse instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse): google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse; + + /** + * Encodes the specified ListGameServerDeploymentsResponse message. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse.verify|verify} messages. + * @param message ListGameServerDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGameServerDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse.verify|verify} messages. + * @param message ListGameServerDeploymentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGameServerDeploymentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGameServerDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse; + + /** + * Decodes a ListGameServerDeploymentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGameServerDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse; + + /** + * Verifies a ListGameServerDeploymentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListGameServerDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGameServerDeploymentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse; + + /** + * Creates a plain object from a ListGameServerDeploymentsResponse message. Also converts values to other types if specified. + * @param message ListGameServerDeploymentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGameServerDeploymentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGameServerDeploymentsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetGameServerDeploymentRequest. */ + interface IGetGameServerDeploymentRequest { + + /** GetGameServerDeploymentRequest name */ + name?: (string|null); + } + + /** Represents a GetGameServerDeploymentRequest. */ + class GetGameServerDeploymentRequest implements IGetGameServerDeploymentRequest { + + /** + * Constructs a new GetGameServerDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest); + + /** GetGameServerDeploymentRequest name. */ + public name: string; + + /** + * Creates a new GetGameServerDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGameServerDeploymentRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest): google.cloud.gaming.v1beta.GetGameServerDeploymentRequest; + + /** + * Encodes the specified GetGameServerDeploymentRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.GetGameServerDeploymentRequest.verify|verify} messages. + * @param message GetGameServerDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGameServerDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GetGameServerDeploymentRequest.verify|verify} messages. + * @param message GetGameServerDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGameServerDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.GetGameServerDeploymentRequest; + + /** + * Decodes a GetGameServerDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.GetGameServerDeploymentRequest; + + /** + * Verifies a GetGameServerDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGameServerDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGameServerDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.GetGameServerDeploymentRequest; + + /** + * Creates a plain object from a GetGameServerDeploymentRequest message. Also converts values to other types if specified. + * @param message GetGameServerDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.GetGameServerDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGameServerDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGameServerDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetGameServerDeploymentRolloutRequest. */ + interface IGetGameServerDeploymentRolloutRequest { + + /** GetGameServerDeploymentRolloutRequest name */ + name?: (string|null); + } + + /** Represents a GetGameServerDeploymentRolloutRequest. */ + class GetGameServerDeploymentRolloutRequest implements IGetGameServerDeploymentRolloutRequest { + + /** + * Constructs a new GetGameServerDeploymentRolloutRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest); + + /** GetGameServerDeploymentRolloutRequest name. */ + public name: string; + + /** + * Creates a new GetGameServerDeploymentRolloutRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGameServerDeploymentRolloutRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest): google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest; + + /** + * Encodes the specified GetGameServerDeploymentRolloutRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest.verify|verify} messages. + * @param message GetGameServerDeploymentRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGameServerDeploymentRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest.verify|verify} messages. + * @param message GetGameServerDeploymentRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGameServerDeploymentRolloutRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest; + + /** + * Decodes a GetGameServerDeploymentRolloutRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest; + + /** + * Verifies a GetGameServerDeploymentRolloutRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetGameServerDeploymentRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGameServerDeploymentRolloutRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest; + + /** + * Creates a plain object from a GetGameServerDeploymentRolloutRequest message. Also converts values to other types if specified. + * @param message GetGameServerDeploymentRolloutRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGameServerDeploymentRolloutRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGameServerDeploymentRolloutRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateGameServerDeploymentRequest. */ + interface ICreateGameServerDeploymentRequest { + + /** CreateGameServerDeploymentRequest parent */ + parent?: (string|null); + + /** CreateGameServerDeploymentRequest deploymentId */ + deploymentId?: (string|null); + + /** CreateGameServerDeploymentRequest gameServerDeployment */ + gameServerDeployment?: (google.cloud.gaming.v1beta.IGameServerDeployment|null); + } + + /** Represents a CreateGameServerDeploymentRequest. */ + class CreateGameServerDeploymentRequest implements ICreateGameServerDeploymentRequest { + + /** + * Constructs a new CreateGameServerDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest); + + /** CreateGameServerDeploymentRequest parent. */ + public parent: string; + + /** CreateGameServerDeploymentRequest deploymentId. */ + public deploymentId: string; + + /** CreateGameServerDeploymentRequest gameServerDeployment. */ + public gameServerDeployment?: (google.cloud.gaming.v1beta.IGameServerDeployment|null); + + /** + * Creates a new CreateGameServerDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateGameServerDeploymentRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest): google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest; + + /** + * Encodes the specified CreateGameServerDeploymentRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest.verify|verify} messages. + * @param message CreateGameServerDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateGameServerDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest.verify|verify} messages. + * @param message CreateGameServerDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateGameServerDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest; + + /** + * Decodes a CreateGameServerDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest; + + /** + * Verifies a CreateGameServerDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateGameServerDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateGameServerDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest; + + /** + * Creates a plain object from a CreateGameServerDeploymentRequest message. Also converts values to other types if specified. + * @param message CreateGameServerDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateGameServerDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateGameServerDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteGameServerDeploymentRequest. */ + interface IDeleteGameServerDeploymentRequest { + + /** DeleteGameServerDeploymentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteGameServerDeploymentRequest. */ + class DeleteGameServerDeploymentRequest implements IDeleteGameServerDeploymentRequest { + + /** + * Constructs a new DeleteGameServerDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest); + + /** DeleteGameServerDeploymentRequest name. */ + public name: string; + + /** + * Creates a new DeleteGameServerDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteGameServerDeploymentRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest): google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest; + + /** + * Encodes the specified DeleteGameServerDeploymentRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest.verify|verify} messages. + * @param message DeleteGameServerDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteGameServerDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest.verify|verify} messages. + * @param message DeleteGameServerDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteGameServerDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest; + + /** + * Decodes a DeleteGameServerDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest; + + /** + * Verifies a DeleteGameServerDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteGameServerDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteGameServerDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest; + + /** + * Creates a plain object from a DeleteGameServerDeploymentRequest message. Also converts values to other types if specified. + * @param message DeleteGameServerDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteGameServerDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteGameServerDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateGameServerDeploymentRequest. */ + interface IUpdateGameServerDeploymentRequest { + + /** UpdateGameServerDeploymentRequest gameServerDeployment */ + gameServerDeployment?: (google.cloud.gaming.v1beta.IGameServerDeployment|null); + + /** UpdateGameServerDeploymentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateGameServerDeploymentRequest. */ + class UpdateGameServerDeploymentRequest implements IUpdateGameServerDeploymentRequest { + + /** + * Constructs a new UpdateGameServerDeploymentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest); + + /** UpdateGameServerDeploymentRequest gameServerDeployment. */ + public gameServerDeployment?: (google.cloud.gaming.v1beta.IGameServerDeployment|null); + + /** UpdateGameServerDeploymentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateGameServerDeploymentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateGameServerDeploymentRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest): google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest; + + /** + * Encodes the specified UpdateGameServerDeploymentRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest.verify|verify} messages. + * @param message UpdateGameServerDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateGameServerDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest.verify|verify} messages. + * @param message UpdateGameServerDeploymentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateGameServerDeploymentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest; + + /** + * Decodes an UpdateGameServerDeploymentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest; + + /** + * Verifies an UpdateGameServerDeploymentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateGameServerDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateGameServerDeploymentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest; + + /** + * Creates a plain object from an UpdateGameServerDeploymentRequest message. Also converts values to other types if specified. + * @param message UpdateGameServerDeploymentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateGameServerDeploymentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateGameServerDeploymentRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateGameServerDeploymentRolloutRequest. */ + interface IUpdateGameServerDeploymentRolloutRequest { + + /** UpdateGameServerDeploymentRolloutRequest rollout */ + rollout?: (google.cloud.gaming.v1beta.IGameServerDeploymentRollout|null); + + /** UpdateGameServerDeploymentRolloutRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateGameServerDeploymentRolloutRequest. */ + class UpdateGameServerDeploymentRolloutRequest implements IUpdateGameServerDeploymentRolloutRequest { + + /** + * Constructs a new UpdateGameServerDeploymentRolloutRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest); + + /** UpdateGameServerDeploymentRolloutRequest rollout. */ + public rollout?: (google.cloud.gaming.v1beta.IGameServerDeploymentRollout|null); + + /** UpdateGameServerDeploymentRolloutRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateGameServerDeploymentRolloutRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateGameServerDeploymentRolloutRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest): google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest; + + /** + * Encodes the specified UpdateGameServerDeploymentRolloutRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest.verify|verify} messages. + * @param message UpdateGameServerDeploymentRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateGameServerDeploymentRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest.verify|verify} messages. + * @param message UpdateGameServerDeploymentRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateGameServerDeploymentRolloutRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest; + + /** + * Decodes an UpdateGameServerDeploymentRolloutRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest; + + /** + * Verifies an UpdateGameServerDeploymentRolloutRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateGameServerDeploymentRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateGameServerDeploymentRolloutRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest; + + /** + * Creates a plain object from an UpdateGameServerDeploymentRolloutRequest message. Also converts values to other types if specified. + * @param message UpdateGameServerDeploymentRolloutRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateGameServerDeploymentRolloutRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateGameServerDeploymentRolloutRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchDeploymentStateRequest. */ + interface IFetchDeploymentStateRequest { + + /** FetchDeploymentStateRequest name */ + name?: (string|null); + } + + /** Represents a FetchDeploymentStateRequest. */ + class FetchDeploymentStateRequest implements IFetchDeploymentStateRequest { + + /** + * Constructs a new FetchDeploymentStateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IFetchDeploymentStateRequest); + + /** FetchDeploymentStateRequest name. */ + public name: string; + + /** + * Creates a new FetchDeploymentStateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchDeploymentStateRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IFetchDeploymentStateRequest): google.cloud.gaming.v1beta.FetchDeploymentStateRequest; + + /** + * Encodes the specified FetchDeploymentStateRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.FetchDeploymentStateRequest.verify|verify} messages. + * @param message FetchDeploymentStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchDeploymentStateRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.FetchDeploymentStateRequest.verify|verify} messages. + * @param message FetchDeploymentStateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchDeploymentStateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchDeploymentStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.FetchDeploymentStateRequest; + + /** + * Decodes a FetchDeploymentStateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchDeploymentStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.FetchDeploymentStateRequest; + + /** + * Verifies a FetchDeploymentStateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchDeploymentStateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchDeploymentStateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.FetchDeploymentStateRequest; + + /** + * Creates a plain object from a FetchDeploymentStateRequest message. Also converts values to other types if specified. + * @param message FetchDeploymentStateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.FetchDeploymentStateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchDeploymentStateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchDeploymentStateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchDeploymentStateResponse. */ + interface IFetchDeploymentStateResponse { + + /** FetchDeploymentStateResponse clusterState */ + clusterState?: (google.cloud.gaming.v1beta.FetchDeploymentStateResponse.IDeployedClusterState[]|null); + + /** FetchDeploymentStateResponse unavailable */ + unavailable?: (string[]|null); + } + + /** Represents a FetchDeploymentStateResponse. */ + class FetchDeploymentStateResponse implements IFetchDeploymentStateResponse { + + /** + * Constructs a new FetchDeploymentStateResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IFetchDeploymentStateResponse); + + /** FetchDeploymentStateResponse clusterState. */ + public clusterState: google.cloud.gaming.v1beta.FetchDeploymentStateResponse.IDeployedClusterState[]; + + /** FetchDeploymentStateResponse unavailable. */ + public unavailable: string[]; + + /** + * Creates a new FetchDeploymentStateResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchDeploymentStateResponse instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IFetchDeploymentStateResponse): google.cloud.gaming.v1beta.FetchDeploymentStateResponse; + + /** + * Encodes the specified FetchDeploymentStateResponse message. Does not implicitly {@link google.cloud.gaming.v1beta.FetchDeploymentStateResponse.verify|verify} messages. + * @param message FetchDeploymentStateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchDeploymentStateResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.FetchDeploymentStateResponse.verify|verify} messages. + * @param message FetchDeploymentStateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchDeploymentStateResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchDeploymentStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.FetchDeploymentStateResponse; + + /** + * Decodes a FetchDeploymentStateResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchDeploymentStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.FetchDeploymentStateResponse; + + /** + * Verifies a FetchDeploymentStateResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchDeploymentStateResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchDeploymentStateResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.FetchDeploymentStateResponse; + + /** + * Creates a plain object from a FetchDeploymentStateResponse message. Also converts values to other types if specified. + * @param message FetchDeploymentStateResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.FetchDeploymentStateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchDeploymentStateResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchDeploymentStateResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FetchDeploymentStateResponse { + + /** Properties of a DeployedClusterState. */ + interface IDeployedClusterState { + + /** DeployedClusterState cluster */ + cluster?: (string|null); + + /** DeployedClusterState fleetDetails */ + fleetDetails?: (google.cloud.gaming.v1beta.IDeployedFleetDetails[]|null); + } + + /** Represents a DeployedClusterState. */ + class DeployedClusterState implements IDeployedClusterState { + + /** + * Constructs a new DeployedClusterState. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.FetchDeploymentStateResponse.IDeployedClusterState); + + /** DeployedClusterState cluster. */ + public cluster: string; + + /** DeployedClusterState fleetDetails. */ + public fleetDetails: google.cloud.gaming.v1beta.IDeployedFleetDetails[]; + + /** + * Creates a new DeployedClusterState instance using the specified properties. + * @param [properties] Properties to set + * @returns DeployedClusterState instance + */ + public static create(properties?: google.cloud.gaming.v1beta.FetchDeploymentStateResponse.IDeployedClusterState): google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState; + + /** + * Encodes the specified DeployedClusterState message. Does not implicitly {@link google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState.verify|verify} messages. + * @param message DeployedClusterState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.FetchDeploymentStateResponse.IDeployedClusterState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeployedClusterState message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState.verify|verify} messages. + * @param message DeployedClusterState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.FetchDeploymentStateResponse.IDeployedClusterState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeployedClusterState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeployedClusterState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState; + + /** + * Decodes a DeployedClusterState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeployedClusterState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState; + + /** + * Verifies a DeployedClusterState message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeployedClusterState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeployedClusterState + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState; + + /** + * Creates a plain object from a DeployedClusterState message. Also converts values to other types if specified. + * @param message DeployedClusterState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeployedClusterState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeployedClusterState + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GameServerDeployment. */ + interface IGameServerDeployment { + + /** GameServerDeployment name */ + name?: (string|null); + + /** GameServerDeployment createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** GameServerDeployment updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** GameServerDeployment labels */ + labels?: ({ [k: string]: string }|null); + + /** GameServerDeployment etag */ + etag?: (string|null); + + /** GameServerDeployment description */ + description?: (string|null); + } + + /** Represents a GameServerDeployment. */ + class GameServerDeployment implements IGameServerDeployment { + + /** + * Constructs a new GameServerDeployment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IGameServerDeployment); + + /** GameServerDeployment name. */ + public name: string; + + /** GameServerDeployment createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** GameServerDeployment updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** GameServerDeployment labels. */ + public labels: { [k: string]: string }; + + /** GameServerDeployment etag. */ + public etag: string; + + /** GameServerDeployment description. */ + public description: string; + + /** + * Creates a new GameServerDeployment instance using the specified properties. + * @param [properties] Properties to set + * @returns GameServerDeployment instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IGameServerDeployment): google.cloud.gaming.v1beta.GameServerDeployment; + + /** + * Encodes the specified GameServerDeployment message. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerDeployment.verify|verify} messages. + * @param message GameServerDeployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IGameServerDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GameServerDeployment message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerDeployment.verify|verify} messages. + * @param message GameServerDeployment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IGameServerDeployment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GameServerDeployment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GameServerDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.GameServerDeployment; + + /** + * Decodes a GameServerDeployment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GameServerDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.GameServerDeployment; + + /** + * Verifies a GameServerDeployment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GameServerDeployment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GameServerDeployment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.GameServerDeployment; + + /** + * Creates a plain object from a GameServerDeployment message. Also converts values to other types if specified. + * @param message GameServerDeployment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.GameServerDeployment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GameServerDeployment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GameServerDeployment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GameServerConfigOverride. */ + interface IGameServerConfigOverride { + + /** GameServerConfigOverride realmsSelector */ + realmsSelector?: (google.cloud.gaming.v1beta.IRealmSelector|null); + + /** GameServerConfigOverride configVersion */ + configVersion?: (string|null); + } + + /** Represents a GameServerConfigOverride. */ + class GameServerConfigOverride implements IGameServerConfigOverride { + + /** + * Constructs a new GameServerConfigOverride. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IGameServerConfigOverride); + + /** GameServerConfigOverride realmsSelector. */ + public realmsSelector?: (google.cloud.gaming.v1beta.IRealmSelector|null); + + /** GameServerConfigOverride configVersion. */ + public configVersion?: (string|null); + + /** GameServerConfigOverride selector. */ + public selector?: "realmsSelector"; + + /** GameServerConfigOverride change. */ + public change?: "configVersion"; + + /** + * Creates a new GameServerConfigOverride instance using the specified properties. + * @param [properties] Properties to set + * @returns GameServerConfigOverride instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IGameServerConfigOverride): google.cloud.gaming.v1beta.GameServerConfigOverride; + + /** + * Encodes the specified GameServerConfigOverride message. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerConfigOverride.verify|verify} messages. + * @param message GameServerConfigOverride message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IGameServerConfigOverride, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GameServerConfigOverride message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerConfigOverride.verify|verify} messages. + * @param message GameServerConfigOverride message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IGameServerConfigOverride, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GameServerConfigOverride message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GameServerConfigOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.GameServerConfigOverride; + + /** + * Decodes a GameServerConfigOverride message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GameServerConfigOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.GameServerConfigOverride; + + /** + * Verifies a GameServerConfigOverride message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GameServerConfigOverride message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GameServerConfigOverride + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.GameServerConfigOverride; + + /** + * Creates a plain object from a GameServerConfigOverride message. Also converts values to other types if specified. + * @param message GameServerConfigOverride + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.GameServerConfigOverride, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GameServerConfigOverride to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GameServerConfigOverride + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GameServerDeploymentRollout. */ + interface IGameServerDeploymentRollout { + + /** GameServerDeploymentRollout name */ + name?: (string|null); + + /** GameServerDeploymentRollout createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** GameServerDeploymentRollout updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** GameServerDeploymentRollout defaultGameServerConfig */ + defaultGameServerConfig?: (string|null); + + /** GameServerDeploymentRollout gameServerConfigOverrides */ + gameServerConfigOverrides?: (google.cloud.gaming.v1beta.IGameServerConfigOverride[]|null); + + /** GameServerDeploymentRollout etag */ + etag?: (string|null); + } + + /** Represents a GameServerDeploymentRollout. */ + class GameServerDeploymentRollout implements IGameServerDeploymentRollout { + + /** + * Constructs a new GameServerDeploymentRollout. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IGameServerDeploymentRollout); + + /** GameServerDeploymentRollout name. */ + public name: string; + + /** GameServerDeploymentRollout createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** GameServerDeploymentRollout updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** GameServerDeploymentRollout defaultGameServerConfig. */ + public defaultGameServerConfig: string; + + /** GameServerDeploymentRollout gameServerConfigOverrides. */ + public gameServerConfigOverrides: google.cloud.gaming.v1beta.IGameServerConfigOverride[]; + + /** GameServerDeploymentRollout etag. */ + public etag: string; + + /** + * Creates a new GameServerDeploymentRollout instance using the specified properties. + * @param [properties] Properties to set + * @returns GameServerDeploymentRollout instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IGameServerDeploymentRollout): google.cloud.gaming.v1beta.GameServerDeploymentRollout; + + /** + * Encodes the specified GameServerDeploymentRollout message. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerDeploymentRollout.verify|verify} messages. + * @param message GameServerDeploymentRollout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IGameServerDeploymentRollout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GameServerDeploymentRollout message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerDeploymentRollout.verify|verify} messages. + * @param message GameServerDeploymentRollout message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IGameServerDeploymentRollout, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GameServerDeploymentRollout message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GameServerDeploymentRollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.GameServerDeploymentRollout; + + /** + * Decodes a GameServerDeploymentRollout message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GameServerDeploymentRollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.GameServerDeploymentRollout; + + /** + * Verifies a GameServerDeploymentRollout message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GameServerDeploymentRollout message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GameServerDeploymentRollout + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.GameServerDeploymentRollout; + + /** + * Creates a plain object from a GameServerDeploymentRollout message. Also converts values to other types if specified. + * @param message GameServerDeploymentRollout + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.GameServerDeploymentRollout, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GameServerDeploymentRollout to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GameServerDeploymentRollout + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PreviewGameServerDeploymentRolloutRequest. */ + interface IPreviewGameServerDeploymentRolloutRequest { + + /** PreviewGameServerDeploymentRolloutRequest rollout */ + rollout?: (google.cloud.gaming.v1beta.IGameServerDeploymentRollout|null); + + /** PreviewGameServerDeploymentRolloutRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** PreviewGameServerDeploymentRolloutRequest previewTime */ + previewTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a PreviewGameServerDeploymentRolloutRequest. */ + class PreviewGameServerDeploymentRolloutRequest implements IPreviewGameServerDeploymentRolloutRequest { + + /** + * Constructs a new PreviewGameServerDeploymentRolloutRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest); + + /** PreviewGameServerDeploymentRolloutRequest rollout. */ + public rollout?: (google.cloud.gaming.v1beta.IGameServerDeploymentRollout|null); + + /** PreviewGameServerDeploymentRolloutRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** PreviewGameServerDeploymentRolloutRequest previewTime. */ + public previewTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new PreviewGameServerDeploymentRolloutRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PreviewGameServerDeploymentRolloutRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest): google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest; + + /** + * Encodes the specified PreviewGameServerDeploymentRolloutRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest.verify|verify} messages. + * @param message PreviewGameServerDeploymentRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreviewGameServerDeploymentRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest.verify|verify} messages. + * @param message PreviewGameServerDeploymentRolloutRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreviewGameServerDeploymentRolloutRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreviewGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest; + + /** + * Decodes a PreviewGameServerDeploymentRolloutRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreviewGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest; + + /** + * Verifies a PreviewGameServerDeploymentRolloutRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreviewGameServerDeploymentRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreviewGameServerDeploymentRolloutRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest; + + /** + * Creates a plain object from a PreviewGameServerDeploymentRolloutRequest message. Also converts values to other types if specified. + * @param message PreviewGameServerDeploymentRolloutRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreviewGameServerDeploymentRolloutRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PreviewGameServerDeploymentRolloutRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PreviewGameServerDeploymentRolloutResponse. */ + interface IPreviewGameServerDeploymentRolloutResponse { + + /** PreviewGameServerDeploymentRolloutResponse unavailable */ + unavailable?: (string[]|null); + + /** PreviewGameServerDeploymentRolloutResponse etag */ + etag?: (string|null); + + /** PreviewGameServerDeploymentRolloutResponse targetState */ + targetState?: (google.cloud.gaming.v1beta.ITargetState|null); + } + + /** Represents a PreviewGameServerDeploymentRolloutResponse. */ + class PreviewGameServerDeploymentRolloutResponse implements IPreviewGameServerDeploymentRolloutResponse { + + /** + * Constructs a new PreviewGameServerDeploymentRolloutResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse); + + /** PreviewGameServerDeploymentRolloutResponse unavailable. */ + public unavailable: string[]; + + /** PreviewGameServerDeploymentRolloutResponse etag. */ + public etag: string; + + /** PreviewGameServerDeploymentRolloutResponse targetState. */ + public targetState?: (google.cloud.gaming.v1beta.ITargetState|null); + + /** + * Creates a new PreviewGameServerDeploymentRolloutResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PreviewGameServerDeploymentRolloutResponse instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse): google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse; + + /** + * Encodes the specified PreviewGameServerDeploymentRolloutResponse message. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse.verify|verify} messages. + * @param message PreviewGameServerDeploymentRolloutResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreviewGameServerDeploymentRolloutResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse.verify|verify} messages. + * @param message PreviewGameServerDeploymentRolloutResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreviewGameServerDeploymentRolloutResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreviewGameServerDeploymentRolloutResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse; + + /** + * Decodes a PreviewGameServerDeploymentRolloutResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreviewGameServerDeploymentRolloutResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse; + + /** + * Verifies a PreviewGameServerDeploymentRolloutResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreviewGameServerDeploymentRolloutResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreviewGameServerDeploymentRolloutResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse; + + /** + * Creates a plain object from a PreviewGameServerDeploymentRolloutResponse message. Also converts values to other types if specified. + * @param message PreviewGameServerDeploymentRolloutResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreviewGameServerDeploymentRolloutResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PreviewGameServerDeploymentRolloutResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a GameServerDeploymentsService */ + class GameServerDeploymentsService extends $protobuf.rpc.Service { + + /** + * Constructs a new GameServerDeploymentsService 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 GameServerDeploymentsService 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): GameServerDeploymentsService; + + /** + * Calls ListGameServerDeployments. + * @param request ListGameServerDeploymentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListGameServerDeploymentsResponse + */ + public listGameServerDeployments(request: google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, callback: google.cloud.gaming.v1beta.GameServerDeploymentsService.ListGameServerDeploymentsCallback): void; + + /** + * Calls ListGameServerDeployments. + * @param request ListGameServerDeploymentsRequest message or plain object + * @returns Promise + */ + public listGameServerDeployments(request: google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest): Promise; + + /** + * Calls GetGameServerDeployment. + * @param request GetGameServerDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GameServerDeployment + */ + public getGameServerDeployment(request: google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, callback: google.cloud.gaming.v1beta.GameServerDeploymentsService.GetGameServerDeploymentCallback): void; + + /** + * Calls GetGameServerDeployment. + * @param request GetGameServerDeploymentRequest message or plain object + * @returns Promise + */ + public getGameServerDeployment(request: google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest): Promise; + + /** + * Calls CreateGameServerDeployment. + * @param request CreateGameServerDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createGameServerDeployment(request: google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, callback: google.cloud.gaming.v1beta.GameServerDeploymentsService.CreateGameServerDeploymentCallback): void; + + /** + * Calls CreateGameServerDeployment. + * @param request CreateGameServerDeploymentRequest message or plain object + * @returns Promise + */ + public createGameServerDeployment(request: google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest): Promise; + + /** + * Calls DeleteGameServerDeployment. + * @param request DeleteGameServerDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteGameServerDeployment(request: google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, callback: google.cloud.gaming.v1beta.GameServerDeploymentsService.DeleteGameServerDeploymentCallback): void; + + /** + * Calls DeleteGameServerDeployment. + * @param request DeleteGameServerDeploymentRequest message or plain object + * @returns Promise + */ + public deleteGameServerDeployment(request: google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest): Promise; + + /** + * Calls UpdateGameServerDeployment. + * @param request UpdateGameServerDeploymentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateGameServerDeployment(request: google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, callback: google.cloud.gaming.v1beta.GameServerDeploymentsService.UpdateGameServerDeploymentCallback): void; + + /** + * Calls UpdateGameServerDeployment. + * @param request UpdateGameServerDeploymentRequest message or plain object + * @returns Promise + */ + public updateGameServerDeployment(request: google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest): Promise; + + /** + * Calls GetGameServerDeploymentRollout. + * @param request GetGameServerDeploymentRolloutRequest message or plain object + * @param callback Node-style callback called with the error, if any, and GameServerDeploymentRollout + */ + public getGameServerDeploymentRollout(request: google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, callback: google.cloud.gaming.v1beta.GameServerDeploymentsService.GetGameServerDeploymentRolloutCallback): void; + + /** + * Calls GetGameServerDeploymentRollout. + * @param request GetGameServerDeploymentRolloutRequest message or plain object + * @returns Promise + */ + public getGameServerDeploymentRollout(request: google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest): Promise; + + /** + * Calls UpdateGameServerDeploymentRollout. + * @param request UpdateGameServerDeploymentRolloutRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateGameServerDeploymentRollout(request: google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, callback: google.cloud.gaming.v1beta.GameServerDeploymentsService.UpdateGameServerDeploymentRolloutCallback): void; + + /** + * Calls UpdateGameServerDeploymentRollout. + * @param request UpdateGameServerDeploymentRolloutRequest message or plain object + * @returns Promise + */ + public updateGameServerDeploymentRollout(request: google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest): Promise; + + /** + * Calls PreviewGameServerDeploymentRollout. + * @param request PreviewGameServerDeploymentRolloutRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PreviewGameServerDeploymentRolloutResponse + */ + public previewGameServerDeploymentRollout(request: google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, callback: google.cloud.gaming.v1beta.GameServerDeploymentsService.PreviewGameServerDeploymentRolloutCallback): void; + + /** + * Calls PreviewGameServerDeploymentRollout. + * @param request PreviewGameServerDeploymentRolloutRequest message or plain object + * @returns Promise + */ + public previewGameServerDeploymentRollout(request: google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest): Promise; + + /** + * Calls FetchDeploymentState. + * @param request FetchDeploymentStateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FetchDeploymentStateResponse + */ + public fetchDeploymentState(request: google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, callback: google.cloud.gaming.v1beta.GameServerDeploymentsService.FetchDeploymentStateCallback): void; + + /** + * Calls FetchDeploymentState. + * @param request FetchDeploymentStateRequest message or plain object + * @returns Promise + */ + public fetchDeploymentState(request: google.cloud.gaming.v1beta.IFetchDeploymentStateRequest): Promise; + } + + namespace GameServerDeploymentsService { + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|listGameServerDeployments}. + * @param error Error, if any + * @param [response] ListGameServerDeploymentsResponse + */ + type ListGameServerDeploymentsCallback = (error: (Error|null), response?: google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|getGameServerDeployment}. + * @param error Error, if any + * @param [response] GameServerDeployment + */ + type GetGameServerDeploymentCallback = (error: (Error|null), response?: google.cloud.gaming.v1beta.GameServerDeployment) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|createGameServerDeployment}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateGameServerDeploymentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|deleteGameServerDeployment}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteGameServerDeploymentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|updateGameServerDeployment}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateGameServerDeploymentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|getGameServerDeploymentRollout}. + * @param error Error, if any + * @param [response] GameServerDeploymentRollout + */ + type GetGameServerDeploymentRolloutCallback = (error: (Error|null), response?: google.cloud.gaming.v1beta.GameServerDeploymentRollout) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|updateGameServerDeploymentRollout}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateGameServerDeploymentRolloutCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|previewGameServerDeploymentRollout}. + * @param error Error, if any + * @param [response] PreviewGameServerDeploymentRolloutResponse + */ + type PreviewGameServerDeploymentRolloutCallback = (error: (Error|null), response?: google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|fetchDeploymentState}. + * @param error Error, if any + * @param [response] FetchDeploymentStateResponse + */ + type FetchDeploymentStateCallback = (error: (Error|null), response?: google.cloud.gaming.v1beta.FetchDeploymentStateResponse) => void; + } + + /** Properties of a ListRealmsRequest. */ + interface IListRealmsRequest { + + /** ListRealmsRequest parent */ + parent?: (string|null); + + /** ListRealmsRequest pageSize */ + pageSize?: (number|null); + + /** ListRealmsRequest pageToken */ + pageToken?: (string|null); + + /** ListRealmsRequest filter */ + filter?: (string|null); + + /** ListRealmsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListRealmsRequest. */ + class ListRealmsRequest implements IListRealmsRequest { + + /** + * Constructs a new ListRealmsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IListRealmsRequest); + + /** ListRealmsRequest parent. */ + public parent: string; + + /** ListRealmsRequest pageSize. */ + public pageSize: number; + + /** ListRealmsRequest pageToken. */ + public pageToken: string; + + /** ListRealmsRequest filter. */ + public filter: string; + + /** ListRealmsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListRealmsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRealmsRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IListRealmsRequest): google.cloud.gaming.v1beta.ListRealmsRequest; + + /** + * Encodes the specified ListRealmsRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.ListRealmsRequest.verify|verify} messages. + * @param message ListRealmsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IListRealmsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRealmsRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.ListRealmsRequest.verify|verify} messages. + * @param message ListRealmsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IListRealmsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRealmsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRealmsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.ListRealmsRequest; + + /** + * Decodes a ListRealmsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRealmsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.ListRealmsRequest; + + /** + * Verifies a ListRealmsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRealmsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRealmsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.ListRealmsRequest; + + /** + * Creates a plain object from a ListRealmsRequest message. Also converts values to other types if specified. + * @param message ListRealmsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.ListRealmsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRealmsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRealmsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRealmsResponse. */ + interface IListRealmsResponse { + + /** ListRealmsResponse realms */ + realms?: (google.cloud.gaming.v1beta.IRealm[]|null); + + /** ListRealmsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListRealmsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListRealmsResponse. */ + class ListRealmsResponse implements IListRealmsResponse { + + /** + * Constructs a new ListRealmsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IListRealmsResponse); + + /** ListRealmsResponse realms. */ + public realms: google.cloud.gaming.v1beta.IRealm[]; + + /** ListRealmsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListRealmsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListRealmsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRealmsResponse instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IListRealmsResponse): google.cloud.gaming.v1beta.ListRealmsResponse; + + /** + * Encodes the specified ListRealmsResponse message. Does not implicitly {@link google.cloud.gaming.v1beta.ListRealmsResponse.verify|verify} messages. + * @param message ListRealmsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IListRealmsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRealmsResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.ListRealmsResponse.verify|verify} messages. + * @param message ListRealmsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IListRealmsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRealmsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRealmsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.ListRealmsResponse; + + /** + * Decodes a ListRealmsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRealmsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.ListRealmsResponse; + + /** + * Verifies a ListRealmsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListRealmsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRealmsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.ListRealmsResponse; + + /** + * Creates a plain object from a ListRealmsResponse message. Also converts values to other types if specified. + * @param message ListRealmsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.ListRealmsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRealmsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRealmsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetRealmRequest. */ + interface IGetRealmRequest { + + /** GetRealmRequest name */ + name?: (string|null); + } + + /** Represents a GetRealmRequest. */ + class GetRealmRequest implements IGetRealmRequest { + + /** + * Constructs a new GetRealmRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IGetRealmRequest); + + /** GetRealmRequest name. */ + public name: string; + + /** + * Creates a new GetRealmRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRealmRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IGetRealmRequest): google.cloud.gaming.v1beta.GetRealmRequest; + + /** + * Encodes the specified GetRealmRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.GetRealmRequest.verify|verify} messages. + * @param message GetRealmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IGetRealmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRealmRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GetRealmRequest.verify|verify} messages. + * @param message GetRealmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IGetRealmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRealmRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.GetRealmRequest; + + /** + * Decodes a GetRealmRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.GetRealmRequest; + + /** + * Verifies a GetRealmRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetRealmRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRealmRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.GetRealmRequest; + + /** + * Creates a plain object from a GetRealmRequest message. Also converts values to other types if specified. + * @param message GetRealmRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.GetRealmRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRealmRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetRealmRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateRealmRequest. */ + interface ICreateRealmRequest { + + /** CreateRealmRequest parent */ + parent?: (string|null); + + /** CreateRealmRequest realmId */ + realmId?: (string|null); + + /** CreateRealmRequest realm */ + realm?: (google.cloud.gaming.v1beta.IRealm|null); + } + + /** Represents a CreateRealmRequest. */ + class CreateRealmRequest implements ICreateRealmRequest { + + /** + * Constructs a new CreateRealmRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.ICreateRealmRequest); + + /** CreateRealmRequest parent. */ + public parent: string; + + /** CreateRealmRequest realmId. */ + public realmId: string; + + /** CreateRealmRequest realm. */ + public realm?: (google.cloud.gaming.v1beta.IRealm|null); + + /** + * Creates a new CreateRealmRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateRealmRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.ICreateRealmRequest): google.cloud.gaming.v1beta.CreateRealmRequest; + + /** + * Encodes the specified CreateRealmRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.CreateRealmRequest.verify|verify} messages. + * @param message CreateRealmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.ICreateRealmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateRealmRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.CreateRealmRequest.verify|verify} messages. + * @param message CreateRealmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.ICreateRealmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateRealmRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.CreateRealmRequest; + + /** + * Decodes a CreateRealmRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.CreateRealmRequest; + + /** + * Verifies a CreateRealmRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateRealmRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateRealmRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.CreateRealmRequest; + + /** + * Creates a plain object from a CreateRealmRequest message. Also converts values to other types if specified. + * @param message CreateRealmRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.CreateRealmRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateRealmRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateRealmRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteRealmRequest. */ + interface IDeleteRealmRequest { + + /** DeleteRealmRequest name */ + name?: (string|null); + } + + /** Represents a DeleteRealmRequest. */ + class DeleteRealmRequest implements IDeleteRealmRequest { + + /** + * Constructs a new DeleteRealmRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IDeleteRealmRequest); + + /** DeleteRealmRequest name. */ + public name: string; + + /** + * Creates a new DeleteRealmRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteRealmRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IDeleteRealmRequest): google.cloud.gaming.v1beta.DeleteRealmRequest; + + /** + * Encodes the specified DeleteRealmRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.DeleteRealmRequest.verify|verify} messages. + * @param message DeleteRealmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IDeleteRealmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteRealmRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.DeleteRealmRequest.verify|verify} messages. + * @param message DeleteRealmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IDeleteRealmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteRealmRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.DeleteRealmRequest; + + /** + * Decodes a DeleteRealmRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.DeleteRealmRequest; + + /** + * Verifies a DeleteRealmRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteRealmRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteRealmRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.DeleteRealmRequest; + + /** + * Creates a plain object from a DeleteRealmRequest message. Also converts values to other types if specified. + * @param message DeleteRealmRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.DeleteRealmRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteRealmRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteRealmRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateRealmRequest. */ + interface IUpdateRealmRequest { + + /** UpdateRealmRequest realm */ + realm?: (google.cloud.gaming.v1beta.IRealm|null); + + /** UpdateRealmRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateRealmRequest. */ + class UpdateRealmRequest implements IUpdateRealmRequest { + + /** + * Constructs a new UpdateRealmRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IUpdateRealmRequest); + + /** UpdateRealmRequest realm. */ + public realm?: (google.cloud.gaming.v1beta.IRealm|null); + + /** UpdateRealmRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateRealmRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateRealmRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IUpdateRealmRequest): google.cloud.gaming.v1beta.UpdateRealmRequest; + + /** + * Encodes the specified UpdateRealmRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.UpdateRealmRequest.verify|verify} messages. + * @param message UpdateRealmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IUpdateRealmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateRealmRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.UpdateRealmRequest.verify|verify} messages. + * @param message UpdateRealmRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IUpdateRealmRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateRealmRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.UpdateRealmRequest; + + /** + * Decodes an UpdateRealmRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.UpdateRealmRequest; + + /** + * Verifies an UpdateRealmRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateRealmRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateRealmRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.UpdateRealmRequest; + + /** + * Creates a plain object from an UpdateRealmRequest message. Also converts values to other types if specified. + * @param message UpdateRealmRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.UpdateRealmRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateRealmRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateRealmRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PreviewRealmUpdateRequest. */ + interface IPreviewRealmUpdateRequest { + + /** PreviewRealmUpdateRequest realm */ + realm?: (google.cloud.gaming.v1beta.IRealm|null); + + /** PreviewRealmUpdateRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** PreviewRealmUpdateRequest previewTime */ + previewTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a PreviewRealmUpdateRequest. */ + class PreviewRealmUpdateRequest implements IPreviewRealmUpdateRequest { + + /** + * Constructs a new PreviewRealmUpdateRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest); + + /** PreviewRealmUpdateRequest realm. */ + public realm?: (google.cloud.gaming.v1beta.IRealm|null); + + /** PreviewRealmUpdateRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** PreviewRealmUpdateRequest previewTime. */ + public previewTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new PreviewRealmUpdateRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PreviewRealmUpdateRequest instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest): google.cloud.gaming.v1beta.PreviewRealmUpdateRequest; + + /** + * Encodes the specified PreviewRealmUpdateRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewRealmUpdateRequest.verify|verify} messages. + * @param message PreviewRealmUpdateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreviewRealmUpdateRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewRealmUpdateRequest.verify|verify} messages. + * @param message PreviewRealmUpdateRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreviewRealmUpdateRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreviewRealmUpdateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.PreviewRealmUpdateRequest; + + /** + * Decodes a PreviewRealmUpdateRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreviewRealmUpdateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.PreviewRealmUpdateRequest; + + /** + * Verifies a PreviewRealmUpdateRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreviewRealmUpdateRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreviewRealmUpdateRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.PreviewRealmUpdateRequest; + + /** + * Creates a plain object from a PreviewRealmUpdateRequest message. Also converts values to other types if specified. + * @param message PreviewRealmUpdateRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.PreviewRealmUpdateRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreviewRealmUpdateRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PreviewRealmUpdateRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PreviewRealmUpdateResponse. */ + interface IPreviewRealmUpdateResponse { + + /** PreviewRealmUpdateResponse etag */ + etag?: (string|null); + + /** PreviewRealmUpdateResponse targetState */ + targetState?: (google.cloud.gaming.v1beta.ITargetState|null); + } + + /** Represents a PreviewRealmUpdateResponse. */ + class PreviewRealmUpdateResponse implements IPreviewRealmUpdateResponse { + + /** + * Constructs a new PreviewRealmUpdateResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse); + + /** PreviewRealmUpdateResponse etag. */ + public etag: string; + + /** PreviewRealmUpdateResponse targetState. */ + public targetState?: (google.cloud.gaming.v1beta.ITargetState|null); + + /** + * Creates a new PreviewRealmUpdateResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PreviewRealmUpdateResponse instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse): google.cloud.gaming.v1beta.PreviewRealmUpdateResponse; + + /** + * Encodes the specified PreviewRealmUpdateResponse message. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewRealmUpdateResponse.verify|verify} messages. + * @param message PreviewRealmUpdateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PreviewRealmUpdateResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewRealmUpdateResponse.verify|verify} messages. + * @param message PreviewRealmUpdateResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PreviewRealmUpdateResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PreviewRealmUpdateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.PreviewRealmUpdateResponse; + + /** + * Decodes a PreviewRealmUpdateResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PreviewRealmUpdateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.PreviewRealmUpdateResponse; + + /** + * Verifies a PreviewRealmUpdateResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PreviewRealmUpdateResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PreviewRealmUpdateResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.PreviewRealmUpdateResponse; + + /** + * Creates a plain object from a PreviewRealmUpdateResponse message. Also converts values to other types if specified. + * @param message PreviewRealmUpdateResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.PreviewRealmUpdateResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PreviewRealmUpdateResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PreviewRealmUpdateResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Realm. */ + interface IRealm { + + /** Realm name */ + name?: (string|null); + + /** Realm createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Realm updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Realm labels */ + labels?: ({ [k: string]: string }|null); + + /** Realm timeZone */ + timeZone?: (string|null); + + /** Realm etag */ + etag?: (string|null); + + /** Realm description */ + description?: (string|null); + } + + /** Represents a Realm. */ + class Realm implements IRealm { + + /** + * Constructs a new Realm. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.gaming.v1beta.IRealm); + + /** Realm name. */ + public name: string; + + /** Realm createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Realm updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Realm labels. */ + public labels: { [k: string]: string }; + + /** Realm timeZone. */ + public timeZone: string; + + /** Realm etag. */ + public etag: string; + + /** Realm description. */ + public description: string; + + /** + * Creates a new Realm instance using the specified properties. + * @param [properties] Properties to set + * @returns Realm instance + */ + public static create(properties?: google.cloud.gaming.v1beta.IRealm): google.cloud.gaming.v1beta.Realm; + + /** + * Encodes the specified Realm message. Does not implicitly {@link google.cloud.gaming.v1beta.Realm.verify|verify} messages. + * @param message Realm message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.gaming.v1beta.IRealm, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Realm message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.Realm.verify|verify} messages. + * @param message Realm message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.gaming.v1beta.IRealm, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Realm message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Realm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.gaming.v1beta.Realm; + + /** + * Decodes a Realm message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Realm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.gaming.v1beta.Realm; + + /** + * Verifies a Realm message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Realm message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Realm + */ + public static fromObject(object: { [k: string]: any }): google.cloud.gaming.v1beta.Realm; + + /** + * Creates a plain object from a Realm message. Also converts values to other types if specified. + * @param message Realm + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.gaming.v1beta.Realm, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Realm to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Realm + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a RealmsService */ + class RealmsService extends $protobuf.rpc.Service { + + /** + * Constructs a new RealmsService 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 RealmsService 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): RealmsService; + + /** + * Calls ListRealms. + * @param request ListRealmsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRealmsResponse + */ + public listRealms(request: google.cloud.gaming.v1beta.IListRealmsRequest, callback: google.cloud.gaming.v1beta.RealmsService.ListRealmsCallback): void; + + /** + * Calls ListRealms. + * @param request ListRealmsRequest message or plain object + * @returns Promise + */ + public listRealms(request: google.cloud.gaming.v1beta.IListRealmsRequest): Promise; + + /** + * Calls GetRealm. + * @param request GetRealmRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Realm + */ + public getRealm(request: google.cloud.gaming.v1beta.IGetRealmRequest, callback: google.cloud.gaming.v1beta.RealmsService.GetRealmCallback): void; + + /** + * Calls GetRealm. + * @param request GetRealmRequest message or plain object + * @returns Promise + */ + public getRealm(request: google.cloud.gaming.v1beta.IGetRealmRequest): Promise; + + /** + * Calls CreateRealm. + * @param request CreateRealmRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createRealm(request: google.cloud.gaming.v1beta.ICreateRealmRequest, callback: google.cloud.gaming.v1beta.RealmsService.CreateRealmCallback): void; + + /** + * Calls CreateRealm. + * @param request CreateRealmRequest message or plain object + * @returns Promise + */ + public createRealm(request: google.cloud.gaming.v1beta.ICreateRealmRequest): Promise; + + /** + * Calls DeleteRealm. + * @param request DeleteRealmRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteRealm(request: google.cloud.gaming.v1beta.IDeleteRealmRequest, callback: google.cloud.gaming.v1beta.RealmsService.DeleteRealmCallback): void; + + /** + * Calls DeleteRealm. + * @param request DeleteRealmRequest message or plain object + * @returns Promise + */ + public deleteRealm(request: google.cloud.gaming.v1beta.IDeleteRealmRequest): Promise; + + /** + * Calls UpdateRealm. + * @param request UpdateRealmRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateRealm(request: google.cloud.gaming.v1beta.IUpdateRealmRequest, callback: google.cloud.gaming.v1beta.RealmsService.UpdateRealmCallback): void; + + /** + * Calls UpdateRealm. + * @param request UpdateRealmRequest message or plain object + * @returns Promise + */ + public updateRealm(request: google.cloud.gaming.v1beta.IUpdateRealmRequest): Promise; + + /** + * Calls PreviewRealmUpdate. + * @param request PreviewRealmUpdateRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PreviewRealmUpdateResponse + */ + public previewRealmUpdate(request: google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, callback: google.cloud.gaming.v1beta.RealmsService.PreviewRealmUpdateCallback): void; + + /** + * Calls PreviewRealmUpdate. + * @param request PreviewRealmUpdateRequest message or plain object + * @returns Promise + */ + public previewRealmUpdate(request: google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest): Promise; + } + + namespace RealmsService { + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService|listRealms}. + * @param error Error, if any + * @param [response] ListRealmsResponse + */ + type ListRealmsCallback = (error: (Error|null), response?: google.cloud.gaming.v1beta.ListRealmsResponse) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService|getRealm}. + * @param error Error, if any + * @param [response] Realm + */ + type GetRealmCallback = (error: (Error|null), response?: google.cloud.gaming.v1beta.Realm) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService|createRealm}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateRealmCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService|deleteRealm}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteRealmCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService|updateRealm}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateRealmCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService|previewRealmUpdate}. + * @param error Error, if any + * @param [response] PreviewRealmUpdateResponse + */ + type PreviewRealmUpdateCallback = (error: (Error|null), response?: google.cloud.gaming.v1beta.PreviewRealmUpdateResponse) => void; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** 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 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 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 FieldMask. */ + interface IFieldMask { + + /** FieldMask paths */ + paths?: (string[]|null); + } + + /** Represents a FieldMask. */ + class FieldMask implements IFieldMask { + + /** + * Constructs a new FieldMask. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldMask); + + /** FieldMask paths. */ + public paths: string[]; + + /** + * Creates a new FieldMask instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldMask instance + */ + public static create(properties?: google.protobuf.IFieldMask): google.protobuf.FieldMask; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @param message FieldMask message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldMask, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldMask; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldMask; + + /** + * Verifies a FieldMask message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldMask + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldMask; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @param message FieldMask + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldMask, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldMask to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldMask + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Any. */ + interface IAny { + + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Any; + + /** + * Verifies an Any message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Empty. */ + interface IEmpty { + } + + /** Represents an Empty. */ + class Empty implements IEmpty { + + /** + * Constructs a new Empty. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEmpty); + + /** + * Creates a new Empty instance using the specified properties. + * @param [properties] Properties to set + * @returns Empty instance + */ + public static create(properties?: google.protobuf.IEmpty): google.protobuf.Empty; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @param message Empty message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Empty; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Empty; + + /** + * Verifies an Empty message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Empty + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Empty; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @param message Empty + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Empty to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Empty + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace 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-gaming/protos/protos.js b/packages/google-cloud-gaming/protos/protos.js new file mode 100644 index 00000000000..acd1081dece --- /dev/null +++ b/packages/google-cloud-gaming/protos/protos.js @@ -0,0 +1,50548 @@ +// 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_game_servers_protos || ($protobuf.roots._google_cloud_game_servers_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.gaming = (function() { + + /** + * Namespace gaming. + * @memberof google.cloud + * @namespace + */ + var gaming = {}; + + gaming.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.gaming + * @namespace + */ + var v1 = {}; + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.gaming.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + * @property {Array.|null} [unreachable] OperationMetadata unreachable + * @property {Object.|null} [operationStatus] OperationMetadata operationStatus + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.gaming.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + this.unreachable = []; + this.operationStatus = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.gaming.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.gaming.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.gaming.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.gaming.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.gaming.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.gaming.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.gaming.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * OperationMetadata unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.gaming.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.unreachable = $util.emptyArray; + + /** + * OperationMetadata operationStatus. + * @member {Object.} operationStatus + * @memberof google.cloud.gaming.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.operationStatus = $util.emptyObject; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.OperationMetadata + * @static + * @param {google.cloud.gaming.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.gaming.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.OperationMetadata + * @static + * @param {google.cloud.gaming.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.unreachable[i]); + if (message.operationStatus != null && Object.hasOwnProperty.call(message, "operationStatus")) + for (var keys = Object.keys(message.operationStatus), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.gaming.v1.OperationStatus.encode(message.operationStatus[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.OperationMetadata + * @static + * @param {google.cloud.gaming.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.OperationMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + case 8: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + case 9: { + if (message.operationStatus === $util.emptyObject) + message.operationStatus = {}; + 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.gaming.v1.OperationStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.operationStatus[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.gaming.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + if (message.operationStatus != null && message.hasOwnProperty("operationStatus")) { + if (!$util.isObject(message.operationStatus)) + return "operationStatus: object expected"; + var key = Object.keys(message.operationStatus); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.gaming.v1.OperationStatus.verify(message.operationStatus[key[i]]); + if (error) + return "operationStatus." + error; + } + } + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.gaming.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.gaming.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.gaming.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.gaming.v1.OperationMetadata.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + if (object.operationStatus) { + if (typeof object.operationStatus !== "object") + throw TypeError(".google.cloud.gaming.v1.OperationMetadata.operationStatus: object expected"); + message.operationStatus = {}; + for (var keys = Object.keys(object.operationStatus), i = 0; i < keys.length; ++i) { + if (typeof object.operationStatus[keys[i]] !== "object") + throw TypeError(".google.cloud.gaming.v1.OperationMetadata.operationStatus: object expected"); + message.operationStatus[keys[i]] = $root.google.cloud.gaming.v1.OperationStatus.fromObject(object.operationStatus[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.OperationMetadata + * @static + * @param {google.cloud.gaming.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachable = []; + if (options.objects || options.defaults) + object.operationStatus = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + var keys2; + if (message.operationStatus && (keys2 = Object.keys(message.operationStatus)).length) { + object.operationStatus = {}; + for (var j = 0; j < keys2.length; ++j) + object.operationStatus[keys2[j]] = $root.google.cloud.gaming.v1.OperationStatus.toObject(message.operationStatus[keys2[j]], options); + } + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.OperationStatus = (function() { + + /** + * Properties of an OperationStatus. + * @memberof google.cloud.gaming.v1 + * @interface IOperationStatus + * @property {boolean|null} [done] OperationStatus done + * @property {google.cloud.gaming.v1.OperationStatus.ErrorCode|null} [errorCode] OperationStatus errorCode + * @property {string|null} [errorMessage] OperationStatus errorMessage + */ + + /** + * Constructs a new OperationStatus. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents an OperationStatus. + * @implements IOperationStatus + * @constructor + * @param {google.cloud.gaming.v1.IOperationStatus=} [properties] Properties to set + */ + function OperationStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationStatus done. + * @member {boolean} done + * @memberof google.cloud.gaming.v1.OperationStatus + * @instance + */ + OperationStatus.prototype.done = false; + + /** + * OperationStatus errorCode. + * @member {google.cloud.gaming.v1.OperationStatus.ErrorCode} errorCode + * @memberof google.cloud.gaming.v1.OperationStatus + * @instance + */ + OperationStatus.prototype.errorCode = 0; + + /** + * OperationStatus errorMessage. + * @member {string} errorMessage + * @memberof google.cloud.gaming.v1.OperationStatus + * @instance + */ + OperationStatus.prototype.errorMessage = ""; + + /** + * Creates a new OperationStatus instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.OperationStatus + * @static + * @param {google.cloud.gaming.v1.IOperationStatus=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.OperationStatus} OperationStatus instance + */ + OperationStatus.create = function create(properties) { + return new OperationStatus(properties); + }; + + /** + * Encodes the specified OperationStatus message. Does not implicitly {@link google.cloud.gaming.v1.OperationStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.OperationStatus + * @static + * @param {google.cloud.gaming.v1.IOperationStatus} message OperationStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.done); + if (message.errorCode != null && Object.hasOwnProperty.call(message, "errorCode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.errorCode); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.errorMessage); + return writer; + }; + + /** + * Encodes the specified OperationStatus message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.OperationStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.OperationStatus + * @static + * @param {google.cloud.gaming.v1.IOperationStatus} message OperationStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.OperationStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.OperationStatus} OperationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.OperationStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.done = reader.bool(); + break; + } + case 2: { + message.errorCode = reader.int32(); + break; + } + case 3: { + message.errorMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.OperationStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.OperationStatus} OperationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationStatus message. + * @function verify + * @memberof google.cloud.gaming.v1.OperationStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.errorCode != null && message.hasOwnProperty("errorCode")) + switch (message.errorCode) { + default: + return "errorCode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + return null; + }; + + /** + * Creates an OperationStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.OperationStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.OperationStatus} OperationStatus + */ + OperationStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.OperationStatus) + return object; + var message = new $root.google.cloud.gaming.v1.OperationStatus(); + if (object.done != null) + message.done = Boolean(object.done); + switch (object.errorCode) { + default: + if (typeof object.errorCode === "number") { + message.errorCode = object.errorCode; + break; + } + break; + case "ERROR_CODE_UNSPECIFIED": + case 0: + message.errorCode = 0; + break; + case "INTERNAL_ERROR": + case 1: + message.errorCode = 1; + break; + case "PERMISSION_DENIED": + case 2: + message.errorCode = 2; + break; + case "CLUSTER_CONNECTION": + case 3: + message.errorCode = 3; + break; + } + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); + return message; + }; + + /** + * Creates a plain object from an OperationStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.OperationStatus + * @static + * @param {google.cloud.gaming.v1.OperationStatus} message OperationStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.done = false; + object.errorCode = options.enums === String ? "ERROR_CODE_UNSPECIFIED" : 0; + object.errorMessage = ""; + } + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.errorCode != null && message.hasOwnProperty("errorCode")) + object.errorCode = options.enums === String ? $root.google.cloud.gaming.v1.OperationStatus.ErrorCode[message.errorCode] === undefined ? message.errorCode : $root.google.cloud.gaming.v1.OperationStatus.ErrorCode[message.errorCode] : message.errorCode; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; + return object; + }; + + /** + * Converts this OperationStatus to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.OperationStatus + * @instance + * @returns {Object.} JSON object + */ + OperationStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationStatus + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.OperationStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.OperationStatus"; + }; + + /** + * ErrorCode enum. + * @name google.cloud.gaming.v1.OperationStatus.ErrorCode + * @enum {number} + * @property {number} ERROR_CODE_UNSPECIFIED=0 ERROR_CODE_UNSPECIFIED value + * @property {number} INTERNAL_ERROR=1 INTERNAL_ERROR value + * @property {number} PERMISSION_DENIED=2 PERMISSION_DENIED value + * @property {number} CLUSTER_CONNECTION=3 CLUSTER_CONNECTION value + */ + OperationStatus.ErrorCode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ERROR_CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INTERNAL_ERROR"] = 1; + values[valuesById[2] = "PERMISSION_DENIED"] = 2; + values[valuesById[3] = "CLUSTER_CONNECTION"] = 3; + return values; + })(); + + return OperationStatus; + })(); + + v1.LabelSelector = (function() { + + /** + * Properties of a LabelSelector. + * @memberof google.cloud.gaming.v1 + * @interface ILabelSelector + * @property {Object.|null} [labels] LabelSelector labels + */ + + /** + * Constructs a new LabelSelector. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a LabelSelector. + * @implements ILabelSelector + * @constructor + * @param {google.cloud.gaming.v1.ILabelSelector=} [properties] Properties to set + */ + function LabelSelector(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]]; + } + + /** + * LabelSelector labels. + * @member {Object.} labels + * @memberof google.cloud.gaming.v1.LabelSelector + * @instance + */ + LabelSelector.prototype.labels = $util.emptyObject; + + /** + * Creates a new LabelSelector instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.LabelSelector + * @static + * @param {google.cloud.gaming.v1.ILabelSelector=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.LabelSelector} LabelSelector instance + */ + LabelSelector.create = function create(properties) { + return new LabelSelector(properties); + }; + + /** + * Encodes the specified LabelSelector message. Does not implicitly {@link google.cloud.gaming.v1.LabelSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.LabelSelector + * @static + * @param {google.cloud.gaming.v1.ILabelSelector} message LabelSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelSelector.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 LabelSelector message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.LabelSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.LabelSelector + * @static + * @param {google.cloud.gaming.v1.ILabelSelector} message LabelSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelSelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.LabelSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.LabelSelector} LabelSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelSelector.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.LabelSelector(), 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 LabelSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.LabelSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.LabelSelector} LabelSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelSelector message. + * @function verify + * @memberof google.cloud.gaming.v1.LabelSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelSelector.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 LabelSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.LabelSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.LabelSelector} LabelSelector + */ + LabelSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.LabelSelector) + return object; + var message = new $root.google.cloud.gaming.v1.LabelSelector(); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.gaming.v1.LabelSelector.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 LabelSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.LabelSelector + * @static + * @param {google.cloud.gaming.v1.LabelSelector} message LabelSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelSelector.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 LabelSelector to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.LabelSelector + * @instance + * @returns {Object.} JSON object + */ + LabelSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelSelector + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.LabelSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.LabelSelector"; + }; + + return LabelSelector; + })(); + + v1.RealmSelector = (function() { + + /** + * Properties of a RealmSelector. + * @memberof google.cloud.gaming.v1 + * @interface IRealmSelector + * @property {Array.|null} [realms] RealmSelector realms + */ + + /** + * Constructs a new RealmSelector. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a RealmSelector. + * @implements IRealmSelector + * @constructor + * @param {google.cloud.gaming.v1.IRealmSelector=} [properties] Properties to set + */ + function RealmSelector(properties) { + this.realms = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RealmSelector realms. + * @member {Array.} realms + * @memberof google.cloud.gaming.v1.RealmSelector + * @instance + */ + RealmSelector.prototype.realms = $util.emptyArray; + + /** + * Creates a new RealmSelector instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.RealmSelector + * @static + * @param {google.cloud.gaming.v1.IRealmSelector=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.RealmSelector} RealmSelector instance + */ + RealmSelector.create = function create(properties) { + return new RealmSelector(properties); + }; + + /** + * Encodes the specified RealmSelector message. Does not implicitly {@link google.cloud.gaming.v1.RealmSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.RealmSelector + * @static + * @param {google.cloud.gaming.v1.IRealmSelector} message RealmSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.realms != null && message.realms.length) + for (var i = 0; i < message.realms.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.realms[i]); + return writer; + }; + + /** + * Encodes the specified RealmSelector message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.RealmSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.RealmSelector + * @static + * @param {google.cloud.gaming.v1.IRealmSelector} message RealmSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RealmSelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.RealmSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.RealmSelector} RealmSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmSelector.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.RealmSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.realms && message.realms.length)) + message.realms = []; + message.realms.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RealmSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.RealmSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.RealmSelector} RealmSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RealmSelector message. + * @function verify + * @memberof google.cloud.gaming.v1.RealmSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RealmSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.realms != null && message.hasOwnProperty("realms")) { + if (!Array.isArray(message.realms)) + return "realms: array expected"; + for (var i = 0; i < message.realms.length; ++i) + if (!$util.isString(message.realms[i])) + return "realms: string[] expected"; + } + return null; + }; + + /** + * Creates a RealmSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.RealmSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.RealmSelector} RealmSelector + */ + RealmSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.RealmSelector) + return object; + var message = new $root.google.cloud.gaming.v1.RealmSelector(); + if (object.realms) { + if (!Array.isArray(object.realms)) + throw TypeError(".google.cloud.gaming.v1.RealmSelector.realms: array expected"); + message.realms = []; + for (var i = 0; i < object.realms.length; ++i) + message.realms[i] = String(object.realms[i]); + } + return message; + }; + + /** + * Creates a plain object from a RealmSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.RealmSelector + * @static + * @param {google.cloud.gaming.v1.RealmSelector} message RealmSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RealmSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.realms = []; + if (message.realms && message.realms.length) { + object.realms = []; + for (var j = 0; j < message.realms.length; ++j) + object.realms[j] = message.realms[j]; + } + return object; + }; + + /** + * Converts this RealmSelector to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.RealmSelector + * @instance + * @returns {Object.} JSON object + */ + RealmSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RealmSelector + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.RealmSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.RealmSelector"; + }; + + return RealmSelector; + })(); + + v1.Schedule = (function() { + + /** + * Properties of a Schedule. + * @memberof google.cloud.gaming.v1 + * @interface ISchedule + * @property {google.protobuf.ITimestamp|null} [startTime] Schedule startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Schedule endTime + * @property {google.protobuf.IDuration|null} [cronJobDuration] Schedule cronJobDuration + * @property {string|null} [cronSpec] Schedule cronSpec + */ + + /** + * Constructs a new Schedule. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a Schedule. + * @implements ISchedule + * @constructor + * @param {google.cloud.gaming.v1.ISchedule=} [properties] Properties to set + */ + function Schedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Schedule startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.gaming.v1.Schedule + * @instance + */ + Schedule.prototype.startTime = null; + + /** + * Schedule endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.gaming.v1.Schedule + * @instance + */ + Schedule.prototype.endTime = null; + + /** + * Schedule cronJobDuration. + * @member {google.protobuf.IDuration|null|undefined} cronJobDuration + * @memberof google.cloud.gaming.v1.Schedule + * @instance + */ + Schedule.prototype.cronJobDuration = null; + + /** + * Schedule cronSpec. + * @member {string} cronSpec + * @memberof google.cloud.gaming.v1.Schedule + * @instance + */ + Schedule.prototype.cronSpec = ""; + + /** + * Creates a new Schedule instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.Schedule + * @static + * @param {google.cloud.gaming.v1.ISchedule=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.Schedule} Schedule instance + */ + Schedule.create = function create(properties) { + return new Schedule(properties); + }; + + /** + * Encodes the specified Schedule message. Does not implicitly {@link google.cloud.gaming.v1.Schedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.Schedule + * @static + * @param {google.cloud.gaming.v1.ISchedule} message Schedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cronJobDuration != null && Object.hasOwnProperty.call(message, "cronJobDuration")) + $root.google.protobuf.Duration.encode(message.cronJobDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cronSpec != null && Object.hasOwnProperty.call(message, "cronSpec")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.cronSpec); + return writer; + }; + + /** + * Encodes the specified Schedule message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.Schedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.Schedule + * @static + * @param {google.cloud.gaming.v1.ISchedule} message Schedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Schedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.Schedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.Schedule} Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.Schedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cronJobDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.cronSpec = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Schedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.Schedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.Schedule} Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Schedule message. + * @function verify + * @memberof google.cloud.gaming.v1.Schedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Schedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + 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.cronJobDuration != null && message.hasOwnProperty("cronJobDuration")) { + var error = $root.google.protobuf.Duration.verify(message.cronJobDuration); + if (error) + return "cronJobDuration." + error; + } + if (message.cronSpec != null && message.hasOwnProperty("cronSpec")) + if (!$util.isString(message.cronSpec)) + return "cronSpec: string expected"; + return null; + }; + + /** + * Creates a Schedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.Schedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.Schedule} Schedule + */ + Schedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.Schedule) + return object; + var message = new $root.google.cloud.gaming.v1.Schedule(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.gaming.v1.Schedule.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.gaming.v1.Schedule.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.cronJobDuration != null) { + if (typeof object.cronJobDuration !== "object") + throw TypeError(".google.cloud.gaming.v1.Schedule.cronJobDuration: object expected"); + message.cronJobDuration = $root.google.protobuf.Duration.fromObject(object.cronJobDuration); + } + if (object.cronSpec != null) + message.cronSpec = String(object.cronSpec); + return message; + }; + + /** + * Creates a plain object from a Schedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.Schedule + * @static + * @param {google.cloud.gaming.v1.Schedule} message Schedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Schedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.cronJobDuration = null; + object.cronSpec = ""; + } + 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.cronJobDuration != null && message.hasOwnProperty("cronJobDuration")) + object.cronJobDuration = $root.google.protobuf.Duration.toObject(message.cronJobDuration, options); + if (message.cronSpec != null && message.hasOwnProperty("cronSpec")) + object.cronSpec = message.cronSpec; + return object; + }; + + /** + * Converts this Schedule to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.Schedule + * @instance + * @returns {Object.} JSON object + */ + Schedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Schedule + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.Schedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Schedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.Schedule"; + }; + + return Schedule; + })(); + + v1.SpecSource = (function() { + + /** + * Properties of a SpecSource. + * @memberof google.cloud.gaming.v1 + * @interface ISpecSource + * @property {string|null} [gameServerConfigName] SpecSource gameServerConfigName + * @property {string|null} [name] SpecSource name + */ + + /** + * Constructs a new SpecSource. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a SpecSource. + * @implements ISpecSource + * @constructor + * @param {google.cloud.gaming.v1.ISpecSource=} [properties] Properties to set + */ + function SpecSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpecSource gameServerConfigName. + * @member {string} gameServerConfigName + * @memberof google.cloud.gaming.v1.SpecSource + * @instance + */ + SpecSource.prototype.gameServerConfigName = ""; + + /** + * SpecSource name. + * @member {string} name + * @memberof google.cloud.gaming.v1.SpecSource + * @instance + */ + SpecSource.prototype.name = ""; + + /** + * Creates a new SpecSource instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.SpecSource + * @static + * @param {google.cloud.gaming.v1.ISpecSource=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.SpecSource} SpecSource instance + */ + SpecSource.create = function create(properties) { + return new SpecSource(properties); + }; + + /** + * Encodes the specified SpecSource message. Does not implicitly {@link google.cloud.gaming.v1.SpecSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.SpecSource + * @static + * @param {google.cloud.gaming.v1.ISpecSource} message SpecSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpecSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gameServerConfigName != null && Object.hasOwnProperty.call(message, "gameServerConfigName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gameServerConfigName); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + return writer; + }; + + /** + * Encodes the specified SpecSource message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.SpecSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.SpecSource + * @static + * @param {google.cloud.gaming.v1.ISpecSource} message SpecSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpecSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpecSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.SpecSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.SpecSource} SpecSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpecSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.SpecSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gameServerConfigName = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpecSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.SpecSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.SpecSource} SpecSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpecSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpecSource message. + * @function verify + * @memberof google.cloud.gaming.v1.SpecSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpecSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gameServerConfigName != null && message.hasOwnProperty("gameServerConfigName")) + if (!$util.isString(message.gameServerConfigName)) + return "gameServerConfigName: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a SpecSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.SpecSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.SpecSource} SpecSource + */ + SpecSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.SpecSource) + return object; + var message = new $root.google.cloud.gaming.v1.SpecSource(); + if (object.gameServerConfigName != null) + message.gameServerConfigName = String(object.gameServerConfigName); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a SpecSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.SpecSource + * @static + * @param {google.cloud.gaming.v1.SpecSource} message SpecSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpecSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gameServerConfigName = ""; + object.name = ""; + } + if (message.gameServerConfigName != null && message.hasOwnProperty("gameServerConfigName")) + object.gameServerConfigName = message.gameServerConfigName; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this SpecSource to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.SpecSource + * @instance + * @returns {Object.} JSON object + */ + SpecSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpecSource + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.SpecSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpecSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.SpecSource"; + }; + + return SpecSource; + })(); + + v1.TargetDetails = (function() { + + /** + * Properties of a TargetDetails. + * @memberof google.cloud.gaming.v1 + * @interface ITargetDetails + * @property {string|null} [gameServerClusterName] TargetDetails gameServerClusterName + * @property {string|null} [gameServerDeploymentName] TargetDetails gameServerDeploymentName + * @property {Array.|null} [fleetDetails] TargetDetails fleetDetails + */ + + /** + * Constructs a new TargetDetails. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a TargetDetails. + * @implements ITargetDetails + * @constructor + * @param {google.cloud.gaming.v1.ITargetDetails=} [properties] Properties to set + */ + function TargetDetails(properties) { + this.fleetDetails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetDetails gameServerClusterName. + * @member {string} gameServerClusterName + * @memberof google.cloud.gaming.v1.TargetDetails + * @instance + */ + TargetDetails.prototype.gameServerClusterName = ""; + + /** + * TargetDetails gameServerDeploymentName. + * @member {string} gameServerDeploymentName + * @memberof google.cloud.gaming.v1.TargetDetails + * @instance + */ + TargetDetails.prototype.gameServerDeploymentName = ""; + + /** + * TargetDetails fleetDetails. + * @member {Array.} fleetDetails + * @memberof google.cloud.gaming.v1.TargetDetails + * @instance + */ + TargetDetails.prototype.fleetDetails = $util.emptyArray; + + /** + * Creates a new TargetDetails instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.TargetDetails + * @static + * @param {google.cloud.gaming.v1.ITargetDetails=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.TargetDetails} TargetDetails instance + */ + TargetDetails.create = function create(properties) { + return new TargetDetails(properties); + }; + + /** + * Encodes the specified TargetDetails message. Does not implicitly {@link google.cloud.gaming.v1.TargetDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.TargetDetails + * @static + * @param {google.cloud.gaming.v1.ITargetDetails} message TargetDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gameServerClusterName != null && Object.hasOwnProperty.call(message, "gameServerClusterName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gameServerClusterName); + if (message.gameServerDeploymentName != null && Object.hasOwnProperty.call(message, "gameServerDeploymentName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gameServerDeploymentName); + if (message.fleetDetails != null && message.fleetDetails.length) + for (var i = 0; i < message.fleetDetails.length; ++i) + $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.encode(message.fleetDetails[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetDetails message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.TargetDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.TargetDetails + * @static + * @param {google.cloud.gaming.v1.ITargetDetails} message TargetDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.TargetDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.TargetDetails} TargetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.TargetDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gameServerClusterName = reader.string(); + break; + } + case 2: { + message.gameServerDeploymentName = reader.string(); + break; + } + case 3: { + if (!(message.fleetDetails && message.fleetDetails.length)) + message.fleetDetails = []; + message.fleetDetails.push($root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.TargetDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.TargetDetails} TargetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetDetails message. + * @function verify + * @memberof google.cloud.gaming.v1.TargetDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gameServerClusterName != null && message.hasOwnProperty("gameServerClusterName")) + if (!$util.isString(message.gameServerClusterName)) + return "gameServerClusterName: string expected"; + if (message.gameServerDeploymentName != null && message.hasOwnProperty("gameServerDeploymentName")) + if (!$util.isString(message.gameServerDeploymentName)) + return "gameServerDeploymentName: string expected"; + if (message.fleetDetails != null && message.hasOwnProperty("fleetDetails")) { + if (!Array.isArray(message.fleetDetails)) + return "fleetDetails: array expected"; + for (var i = 0; i < message.fleetDetails.length; ++i) { + var error = $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.verify(message.fleetDetails[i]); + if (error) + return "fleetDetails." + error; + } + } + return null; + }; + + /** + * Creates a TargetDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.TargetDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.TargetDetails} TargetDetails + */ + TargetDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.TargetDetails) + return object; + var message = new $root.google.cloud.gaming.v1.TargetDetails(); + if (object.gameServerClusterName != null) + message.gameServerClusterName = String(object.gameServerClusterName); + if (object.gameServerDeploymentName != null) + message.gameServerDeploymentName = String(object.gameServerDeploymentName); + if (object.fleetDetails) { + if (!Array.isArray(object.fleetDetails)) + throw TypeError(".google.cloud.gaming.v1.TargetDetails.fleetDetails: array expected"); + message.fleetDetails = []; + for (var i = 0; i < object.fleetDetails.length; ++i) { + if (typeof object.fleetDetails[i] !== "object") + throw TypeError(".google.cloud.gaming.v1.TargetDetails.fleetDetails: object expected"); + message.fleetDetails[i] = $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.fromObject(object.fleetDetails[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TargetDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.TargetDetails + * @static + * @param {google.cloud.gaming.v1.TargetDetails} message TargetDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fleetDetails = []; + if (options.defaults) { + object.gameServerClusterName = ""; + object.gameServerDeploymentName = ""; + } + if (message.gameServerClusterName != null && message.hasOwnProperty("gameServerClusterName")) + object.gameServerClusterName = message.gameServerClusterName; + if (message.gameServerDeploymentName != null && message.hasOwnProperty("gameServerDeploymentName")) + object.gameServerDeploymentName = message.gameServerDeploymentName; + if (message.fleetDetails && message.fleetDetails.length) { + object.fleetDetails = []; + for (var j = 0; j < message.fleetDetails.length; ++j) + object.fleetDetails[j] = $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.toObject(message.fleetDetails[j], options); + } + return object; + }; + + /** + * Converts this TargetDetails to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.TargetDetails + * @instance + * @returns {Object.} JSON object + */ + TargetDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetDetails + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.TargetDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.TargetDetails"; + }; + + TargetDetails.TargetFleetDetails = (function() { + + /** + * Properties of a TargetFleetDetails. + * @memberof google.cloud.gaming.v1.TargetDetails + * @interface ITargetFleetDetails + * @property {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleet|null} [fleet] TargetFleetDetails fleet + * @property {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler|null} [autoscaler] TargetFleetDetails autoscaler + */ + + /** + * Constructs a new TargetFleetDetails. + * @memberof google.cloud.gaming.v1.TargetDetails + * @classdesc Represents a TargetFleetDetails. + * @implements ITargetFleetDetails + * @constructor + * @param {google.cloud.gaming.v1.TargetDetails.ITargetFleetDetails=} [properties] Properties to set + */ + function TargetFleetDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetFleetDetails fleet. + * @member {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleet|null|undefined} fleet + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails + * @instance + */ + TargetFleetDetails.prototype.fleet = null; + + /** + * TargetFleetDetails autoscaler. + * @member {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler|null|undefined} autoscaler + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails + * @instance + */ + TargetFleetDetails.prototype.autoscaler = null; + + /** + * Creates a new TargetFleetDetails instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails + * @static + * @param {google.cloud.gaming.v1.TargetDetails.ITargetFleetDetails=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails} TargetFleetDetails instance + */ + TargetFleetDetails.create = function create(properties) { + return new TargetFleetDetails(properties); + }; + + /** + * Encodes the specified TargetFleetDetails message. Does not implicitly {@link google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails + * @static + * @param {google.cloud.gaming.v1.TargetDetails.ITargetFleetDetails} message TargetFleetDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetFleetDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fleet != null && Object.hasOwnProperty.call(message, "fleet")) + $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet.encode(message.fleet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.autoscaler != null && Object.hasOwnProperty.call(message, "autoscaler")) + $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler.encode(message.autoscaler, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetFleetDetails message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails + * @static + * @param {google.cloud.gaming.v1.TargetDetails.ITargetFleetDetails} message TargetFleetDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetFleetDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetFleetDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails} TargetFleetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetFleetDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fleet = $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet.decode(reader, reader.uint32()); + break; + } + case 2: { + message.autoscaler = $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetFleetDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails} TargetFleetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetFleetDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetFleetDetails message. + * @function verify + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetFleetDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fleet != null && message.hasOwnProperty("fleet")) { + var error = $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet.verify(message.fleet); + if (error) + return "fleet." + error; + } + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) { + var error = $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler.verify(message.autoscaler); + if (error) + return "autoscaler." + error; + } + return null; + }; + + /** + * Creates a TargetFleetDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails} TargetFleetDetails + */ + TargetFleetDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails) + return object; + var message = new $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails(); + if (object.fleet != null) { + if (typeof object.fleet !== "object") + throw TypeError(".google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.fleet: object expected"); + message.fleet = $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet.fromObject(object.fleet); + } + if (object.autoscaler != null) { + if (typeof object.autoscaler !== "object") + throw TypeError(".google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.autoscaler: object expected"); + message.autoscaler = $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler.fromObject(object.autoscaler); + } + return message; + }; + + /** + * Creates a plain object from a TargetFleetDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails + * @static + * @param {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails} message TargetFleetDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetFleetDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fleet = null; + object.autoscaler = null; + } + if (message.fleet != null && message.hasOwnProperty("fleet")) + object.fleet = $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet.toObject(message.fleet, options); + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) + object.autoscaler = $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler.toObject(message.autoscaler, options); + return object; + }; + + /** + * Converts this TargetFleetDetails to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails + * @instance + * @returns {Object.} JSON object + */ + TargetFleetDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetFleetDetails + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetFleetDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.TargetDetails.TargetFleetDetails"; + }; + + TargetFleetDetails.TargetFleet = (function() { + + /** + * Properties of a TargetFleet. + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails + * @interface ITargetFleet + * @property {string|null} [name] TargetFleet name + * @property {google.cloud.gaming.v1.ISpecSource|null} [specSource] TargetFleet specSource + */ + + /** + * Constructs a new TargetFleet. + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails + * @classdesc Represents a TargetFleet. + * @implements ITargetFleet + * @constructor + * @param {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleet=} [properties] Properties to set + */ + function TargetFleet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetFleet name. + * @member {string} name + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet + * @instance + */ + TargetFleet.prototype.name = ""; + + /** + * TargetFleet specSource. + * @member {google.cloud.gaming.v1.ISpecSource|null|undefined} specSource + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet + * @instance + */ + TargetFleet.prototype.specSource = null; + + /** + * Creates a new TargetFleet instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet + * @static + * @param {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleet=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet} TargetFleet instance + */ + TargetFleet.create = function create(properties) { + return new TargetFleet(properties); + }; + + /** + * Encodes the specified TargetFleet message. Does not implicitly {@link google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet + * @static + * @param {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleet} message TargetFleet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetFleet.encode = function encode(message, writer) { + 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.specSource != null && Object.hasOwnProperty.call(message, "specSource")) + $root.google.cloud.gaming.v1.SpecSource.encode(message.specSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetFleet message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet + * @static + * @param {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleet} message TargetFleet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetFleet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetFleet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet} TargetFleet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetFleet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.specSource = $root.google.cloud.gaming.v1.SpecSource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetFleet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet} TargetFleet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetFleet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetFleet message. + * @function verify + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetFleet.verify = function verify(message) { + if (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.specSource != null && message.hasOwnProperty("specSource")) { + var error = $root.google.cloud.gaming.v1.SpecSource.verify(message.specSource); + if (error) + return "specSource." + error; + } + return null; + }; + + /** + * Creates a TargetFleet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet} TargetFleet + */ + TargetFleet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet) + return object; + var message = new $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet(); + if (object.name != null) + message.name = String(object.name); + if (object.specSource != null) { + if (typeof object.specSource !== "object") + throw TypeError(".google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet.specSource: object expected"); + message.specSource = $root.google.cloud.gaming.v1.SpecSource.fromObject(object.specSource); + } + return message; + }; + + /** + * Creates a plain object from a TargetFleet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet + * @static + * @param {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet} message TargetFleet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetFleet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.specSource = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.specSource != null && message.hasOwnProperty("specSource")) + object.specSource = $root.google.cloud.gaming.v1.SpecSource.toObject(message.specSource, options); + return object; + }; + + /** + * Converts this TargetFleet to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet + * @instance + * @returns {Object.} JSON object + */ + TargetFleet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetFleet + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetFleet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleet"; + }; + + return TargetFleet; + })(); + + TargetFleetDetails.TargetFleetAutoscaler = (function() { + + /** + * Properties of a TargetFleetAutoscaler. + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails + * @interface ITargetFleetAutoscaler + * @property {string|null} [name] TargetFleetAutoscaler name + * @property {google.cloud.gaming.v1.ISpecSource|null} [specSource] TargetFleetAutoscaler specSource + */ + + /** + * Constructs a new TargetFleetAutoscaler. + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails + * @classdesc Represents a TargetFleetAutoscaler. + * @implements ITargetFleetAutoscaler + * @constructor + * @param {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler=} [properties] Properties to set + */ + function TargetFleetAutoscaler(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetFleetAutoscaler name. + * @member {string} name + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @instance + */ + TargetFleetAutoscaler.prototype.name = ""; + + /** + * TargetFleetAutoscaler specSource. + * @member {google.cloud.gaming.v1.ISpecSource|null|undefined} specSource + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @instance + */ + TargetFleetAutoscaler.prototype.specSource = null; + + /** + * Creates a new TargetFleetAutoscaler instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @static + * @param {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler} TargetFleetAutoscaler instance + */ + TargetFleetAutoscaler.create = function create(properties) { + return new TargetFleetAutoscaler(properties); + }; + + /** + * Encodes the specified TargetFleetAutoscaler message. Does not implicitly {@link google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @static + * @param {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler} message TargetFleetAutoscaler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetFleetAutoscaler.encode = function encode(message, writer) { + 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.specSource != null && Object.hasOwnProperty.call(message, "specSource")) + $root.google.cloud.gaming.v1.SpecSource.encode(message.specSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetFleetAutoscaler message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @static + * @param {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler} message TargetFleetAutoscaler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetFleetAutoscaler.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetFleetAutoscaler message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler} TargetFleetAutoscaler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetFleetAutoscaler.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.specSource = $root.google.cloud.gaming.v1.SpecSource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetFleetAutoscaler message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler} TargetFleetAutoscaler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetFleetAutoscaler.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetFleetAutoscaler message. + * @function verify + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetFleetAutoscaler.verify = function verify(message) { + if (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.specSource != null && message.hasOwnProperty("specSource")) { + var error = $root.google.cloud.gaming.v1.SpecSource.verify(message.specSource); + if (error) + return "specSource." + error; + } + return null; + }; + + /** + * Creates a TargetFleetAutoscaler message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler} TargetFleetAutoscaler + */ + TargetFleetAutoscaler.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler) + return object; + var message = new $root.google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler(); + if (object.name != null) + message.name = String(object.name); + if (object.specSource != null) { + if (typeof object.specSource !== "object") + throw TypeError(".google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler.specSource: object expected"); + message.specSource = $root.google.cloud.gaming.v1.SpecSource.fromObject(object.specSource); + } + return message; + }; + + /** + * Creates a plain object from a TargetFleetAutoscaler message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @static + * @param {google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler} message TargetFleetAutoscaler + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetFleetAutoscaler.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.specSource = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.specSource != null && message.hasOwnProperty("specSource")) + object.specSource = $root.google.cloud.gaming.v1.SpecSource.toObject(message.specSource, options); + return object; + }; + + /** + * Converts this TargetFleetAutoscaler to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @instance + * @returns {Object.} JSON object + */ + TargetFleetAutoscaler.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetFleetAutoscaler + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetFleetAutoscaler.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler"; + }; + + return TargetFleetAutoscaler; + })(); + + return TargetFleetDetails; + })(); + + return TargetDetails; + })(); + + v1.TargetState = (function() { + + /** + * Properties of a TargetState. + * @memberof google.cloud.gaming.v1 + * @interface ITargetState + * @property {Array.|null} [details] TargetState details + */ + + /** + * Constructs a new TargetState. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a TargetState. + * @implements ITargetState + * @constructor + * @param {google.cloud.gaming.v1.ITargetState=} [properties] Properties to set + */ + function TargetState(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]]; + } + + /** + * TargetState details. + * @member {Array.} details + * @memberof google.cloud.gaming.v1.TargetState + * @instance + */ + TargetState.prototype.details = $util.emptyArray; + + /** + * Creates a new TargetState instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.TargetState + * @static + * @param {google.cloud.gaming.v1.ITargetState=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.TargetState} TargetState instance + */ + TargetState.create = function create(properties) { + return new TargetState(properties); + }; + + /** + * Encodes the specified TargetState message. Does not implicitly {@link google.cloud.gaming.v1.TargetState.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.TargetState + * @static + * @param {google.cloud.gaming.v1.ITargetState} message TargetState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.cloud.gaming.v1.TargetDetails.encode(message.details[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetState message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.TargetState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.TargetState + * @static + * @param {google.cloud.gaming.v1.ITargetState} message TargetState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetState message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.TargetState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.TargetState} TargetState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.TargetState(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.cloud.gaming.v1.TargetDetails.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.TargetState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.TargetState} TargetState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetState message. + * @function verify + * @memberof google.cloud.gaming.v1.TargetState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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.cloud.gaming.v1.TargetDetails.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a TargetState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.TargetState + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.TargetState} TargetState + */ + TargetState.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.TargetState) + return object; + var message = new $root.google.cloud.gaming.v1.TargetState(); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.cloud.gaming.v1.TargetState.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.cloud.gaming.v1.TargetState.details: object expected"); + message.details[i] = $root.google.cloud.gaming.v1.TargetDetails.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TargetState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.TargetState + * @static + * @param {google.cloud.gaming.v1.TargetState} message TargetState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.cloud.gaming.v1.TargetDetails.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this TargetState to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.TargetState + * @instance + * @returns {Object.} JSON object + */ + TargetState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetState + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.TargetState + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.TargetState"; + }; + + return TargetState; + })(); + + v1.DeployedFleetDetails = (function() { + + /** + * Properties of a DeployedFleetDetails. + * @memberof google.cloud.gaming.v1 + * @interface IDeployedFleetDetails + * @property {google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleet|null} [deployedFleet] DeployedFleetDetails deployedFleet + * @property {google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleetAutoscaler|null} [deployedAutoscaler] DeployedFleetDetails deployedAutoscaler + */ + + /** + * Constructs a new DeployedFleetDetails. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a DeployedFleetDetails. + * @implements IDeployedFleetDetails + * @constructor + * @param {google.cloud.gaming.v1.IDeployedFleetDetails=} [properties] Properties to set + */ + function DeployedFleetDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployedFleetDetails deployedFleet. + * @member {google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleet|null|undefined} deployedFleet + * @memberof google.cloud.gaming.v1.DeployedFleetDetails + * @instance + */ + DeployedFleetDetails.prototype.deployedFleet = null; + + /** + * DeployedFleetDetails deployedAutoscaler. + * @member {google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleetAutoscaler|null|undefined} deployedAutoscaler + * @memberof google.cloud.gaming.v1.DeployedFleetDetails + * @instance + */ + DeployedFleetDetails.prototype.deployedAutoscaler = null; + + /** + * Creates a new DeployedFleetDetails instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.DeployedFleetDetails + * @static + * @param {google.cloud.gaming.v1.IDeployedFleetDetails=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.DeployedFleetDetails} DeployedFleetDetails instance + */ + DeployedFleetDetails.create = function create(properties) { + return new DeployedFleetDetails(properties); + }; + + /** + * Encodes the specified DeployedFleetDetails message. Does not implicitly {@link google.cloud.gaming.v1.DeployedFleetDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.DeployedFleetDetails + * @static + * @param {google.cloud.gaming.v1.IDeployedFleetDetails} message DeployedFleetDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployedFleetDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deployedFleet != null && Object.hasOwnProperty.call(message, "deployedFleet")) + $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.encode(message.deployedFleet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deployedAutoscaler != null && Object.hasOwnProperty.call(message, "deployedAutoscaler")) + $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler.encode(message.deployedAutoscaler, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployedFleetDetails message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.DeployedFleetDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.DeployedFleetDetails + * @static + * @param {google.cloud.gaming.v1.IDeployedFleetDetails} message DeployedFleetDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployedFleetDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployedFleetDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.DeployedFleetDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.DeployedFleetDetails} DeployedFleetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployedFleetDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.DeployedFleetDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deployedFleet = $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.decode(reader, reader.uint32()); + break; + } + case 2: { + message.deployedAutoscaler = $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployedFleetDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.DeployedFleetDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.DeployedFleetDetails} DeployedFleetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployedFleetDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployedFleetDetails message. + * @function verify + * @memberof google.cloud.gaming.v1.DeployedFleetDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployedFleetDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deployedFleet != null && message.hasOwnProperty("deployedFleet")) { + var error = $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.verify(message.deployedFleet); + if (error) + return "deployedFleet." + error; + } + if (message.deployedAutoscaler != null && message.hasOwnProperty("deployedAutoscaler")) { + var error = $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler.verify(message.deployedAutoscaler); + if (error) + return "deployedAutoscaler." + error; + } + return null; + }; + + /** + * Creates a DeployedFleetDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.DeployedFleetDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.DeployedFleetDetails} DeployedFleetDetails + */ + DeployedFleetDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.DeployedFleetDetails) + return object; + var message = new $root.google.cloud.gaming.v1.DeployedFleetDetails(); + if (object.deployedFleet != null) { + if (typeof object.deployedFleet !== "object") + throw TypeError(".google.cloud.gaming.v1.DeployedFleetDetails.deployedFleet: object expected"); + message.deployedFleet = $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.fromObject(object.deployedFleet); + } + if (object.deployedAutoscaler != null) { + if (typeof object.deployedAutoscaler !== "object") + throw TypeError(".google.cloud.gaming.v1.DeployedFleetDetails.deployedAutoscaler: object expected"); + message.deployedAutoscaler = $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler.fromObject(object.deployedAutoscaler); + } + return message; + }; + + /** + * Creates a plain object from a DeployedFleetDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.DeployedFleetDetails + * @static + * @param {google.cloud.gaming.v1.DeployedFleetDetails} message DeployedFleetDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployedFleetDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.deployedFleet = null; + object.deployedAutoscaler = null; + } + if (message.deployedFleet != null && message.hasOwnProperty("deployedFleet")) + object.deployedFleet = $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.toObject(message.deployedFleet, options); + if (message.deployedAutoscaler != null && message.hasOwnProperty("deployedAutoscaler")) + object.deployedAutoscaler = $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler.toObject(message.deployedAutoscaler, options); + return object; + }; + + /** + * Converts this DeployedFleetDetails to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.DeployedFleetDetails + * @instance + * @returns {Object.} JSON object + */ + DeployedFleetDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployedFleetDetails + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.DeployedFleetDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployedFleetDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.DeployedFleetDetails"; + }; + + DeployedFleetDetails.DeployedFleet = (function() { + + /** + * Properties of a DeployedFleet. + * @memberof google.cloud.gaming.v1.DeployedFleetDetails + * @interface IDeployedFleet + * @property {string|null} [fleet] DeployedFleet fleet + * @property {string|null} [fleetSpec] DeployedFleet fleetSpec + * @property {google.cloud.gaming.v1.ISpecSource|null} [specSource] DeployedFleet specSource + * @property {google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus|null} [status] DeployedFleet status + */ + + /** + * Constructs a new DeployedFleet. + * @memberof google.cloud.gaming.v1.DeployedFleetDetails + * @classdesc Represents a DeployedFleet. + * @implements IDeployedFleet + * @constructor + * @param {google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleet=} [properties] Properties to set + */ + function DeployedFleet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployedFleet fleet. + * @member {string} fleet + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet + * @instance + */ + DeployedFleet.prototype.fleet = ""; + + /** + * DeployedFleet fleetSpec. + * @member {string} fleetSpec + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet + * @instance + */ + DeployedFleet.prototype.fleetSpec = ""; + + /** + * DeployedFleet specSource. + * @member {google.cloud.gaming.v1.ISpecSource|null|undefined} specSource + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet + * @instance + */ + DeployedFleet.prototype.specSource = null; + + /** + * DeployedFleet status. + * @member {google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus|null|undefined} status + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet + * @instance + */ + DeployedFleet.prototype.status = null; + + /** + * Creates a new DeployedFleet instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet + * @static + * @param {google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleet=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet} DeployedFleet instance + */ + DeployedFleet.create = function create(properties) { + return new DeployedFleet(properties); + }; + + /** + * Encodes the specified DeployedFleet message. Does not implicitly {@link google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet + * @static + * @param {google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleet} message DeployedFleet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployedFleet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fleet != null && Object.hasOwnProperty.call(message, "fleet")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fleet); + if (message.fleetSpec != null && Object.hasOwnProperty.call(message, "fleetSpec")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fleetSpec); + if (message.specSource != null && Object.hasOwnProperty.call(message, "specSource")) + $root.google.cloud.gaming.v1.SpecSource.encode(message.specSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus.encode(message.status, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployedFleet message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet + * @static + * @param {google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleet} message DeployedFleet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployedFleet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployedFleet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet} DeployedFleet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployedFleet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fleet = reader.string(); + break; + } + case 2: { + message.fleetSpec = reader.string(); + break; + } + case 3: { + message.specSource = $root.google.cloud.gaming.v1.SpecSource.decode(reader, reader.uint32()); + break; + } + case 5: { + message.status = $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployedFleet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet} DeployedFleet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployedFleet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployedFleet message. + * @function verify + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployedFleet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fleet != null && message.hasOwnProperty("fleet")) + if (!$util.isString(message.fleet)) + return "fleet: string expected"; + if (message.fleetSpec != null && message.hasOwnProperty("fleetSpec")) + if (!$util.isString(message.fleetSpec)) + return "fleetSpec: string expected"; + if (message.specSource != null && message.hasOwnProperty("specSource")) { + var error = $root.google.cloud.gaming.v1.SpecSource.verify(message.specSource); + if (error) + return "specSource." + error; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus.verify(message.status); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates a DeployedFleet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet} DeployedFleet + */ + DeployedFleet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet) + return object; + var message = new $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet(); + if (object.fleet != null) + message.fleet = String(object.fleet); + if (object.fleetSpec != null) + message.fleetSpec = String(object.fleetSpec); + if (object.specSource != null) { + if (typeof object.specSource !== "object") + throw TypeError(".google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.specSource: object expected"); + message.specSource = $root.google.cloud.gaming.v1.SpecSource.fromObject(object.specSource); + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.status: object expected"); + message.status = $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from a DeployedFleet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet + * @static + * @param {google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet} message DeployedFleet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployedFleet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fleet = ""; + object.fleetSpec = ""; + object.specSource = null; + object.status = null; + } + if (message.fleet != null && message.hasOwnProperty("fleet")) + object.fleet = message.fleet; + if (message.fleetSpec != null && message.hasOwnProperty("fleetSpec")) + object.fleetSpec = message.fleetSpec; + if (message.specSource != null && message.hasOwnProperty("specSource")) + object.specSource = $root.google.cloud.gaming.v1.SpecSource.toObject(message.specSource, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus.toObject(message.status, options); + return object; + }; + + /** + * Converts this DeployedFleet to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet + * @instance + * @returns {Object.} JSON object + */ + DeployedFleet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployedFleet + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployedFleet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet"; + }; + + DeployedFleet.DeployedFleetStatus = (function() { + + /** + * Properties of a DeployedFleetStatus. + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet + * @interface IDeployedFleetStatus + * @property {number|Long|null} [readyReplicas] DeployedFleetStatus readyReplicas + * @property {number|Long|null} [allocatedReplicas] DeployedFleetStatus allocatedReplicas + * @property {number|Long|null} [reservedReplicas] DeployedFleetStatus reservedReplicas + * @property {number|Long|null} [replicas] DeployedFleetStatus replicas + */ + + /** + * Constructs a new DeployedFleetStatus. + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet + * @classdesc Represents a DeployedFleetStatus. + * @implements IDeployedFleetStatus + * @constructor + * @param {google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus=} [properties] Properties to set + */ + function DeployedFleetStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployedFleetStatus readyReplicas. + * @member {number|Long} readyReplicas + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @instance + */ + DeployedFleetStatus.prototype.readyReplicas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DeployedFleetStatus allocatedReplicas. + * @member {number|Long} allocatedReplicas + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @instance + */ + DeployedFleetStatus.prototype.allocatedReplicas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DeployedFleetStatus reservedReplicas. + * @member {number|Long} reservedReplicas + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @instance + */ + DeployedFleetStatus.prototype.reservedReplicas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DeployedFleetStatus replicas. + * @member {number|Long} replicas + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @instance + */ + DeployedFleetStatus.prototype.replicas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new DeployedFleetStatus instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @static + * @param {google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus} DeployedFleetStatus instance + */ + DeployedFleetStatus.create = function create(properties) { + return new DeployedFleetStatus(properties); + }; + + /** + * Encodes the specified DeployedFleetStatus message. Does not implicitly {@link google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @static + * @param {google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus} message DeployedFleetStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployedFleetStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readyReplicas != null && Object.hasOwnProperty.call(message, "readyReplicas")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.readyReplicas); + if (message.allocatedReplicas != null && Object.hasOwnProperty.call(message, "allocatedReplicas")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.allocatedReplicas); + if (message.reservedReplicas != null && Object.hasOwnProperty.call(message, "reservedReplicas")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.reservedReplicas); + if (message.replicas != null && Object.hasOwnProperty.call(message, "replicas")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.replicas); + return writer; + }; + + /** + * Encodes the specified DeployedFleetStatus message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @static + * @param {google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus} message DeployedFleetStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployedFleetStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployedFleetStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus} DeployedFleetStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployedFleetStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.readyReplicas = reader.int64(); + break; + } + case 2: { + message.allocatedReplicas = reader.int64(); + break; + } + case 3: { + message.reservedReplicas = reader.int64(); + break; + } + case 4: { + message.replicas = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployedFleetStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus} DeployedFleetStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployedFleetStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployedFleetStatus message. + * @function verify + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployedFleetStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readyReplicas != null && message.hasOwnProperty("readyReplicas")) + if (!$util.isInteger(message.readyReplicas) && !(message.readyReplicas && $util.isInteger(message.readyReplicas.low) && $util.isInteger(message.readyReplicas.high))) + return "readyReplicas: integer|Long expected"; + if (message.allocatedReplicas != null && message.hasOwnProperty("allocatedReplicas")) + if (!$util.isInteger(message.allocatedReplicas) && !(message.allocatedReplicas && $util.isInteger(message.allocatedReplicas.low) && $util.isInteger(message.allocatedReplicas.high))) + return "allocatedReplicas: integer|Long expected"; + if (message.reservedReplicas != null && message.hasOwnProperty("reservedReplicas")) + if (!$util.isInteger(message.reservedReplicas) && !(message.reservedReplicas && $util.isInteger(message.reservedReplicas.low) && $util.isInteger(message.reservedReplicas.high))) + return "reservedReplicas: integer|Long expected"; + if (message.replicas != null && message.hasOwnProperty("replicas")) + if (!$util.isInteger(message.replicas) && !(message.replicas && $util.isInteger(message.replicas.low) && $util.isInteger(message.replicas.high))) + return "replicas: integer|Long expected"; + return null; + }; + + /** + * Creates a DeployedFleetStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus} DeployedFleetStatus + */ + DeployedFleetStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus) + return object; + var message = new $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus(); + if (object.readyReplicas != null) + if ($util.Long) + (message.readyReplicas = $util.Long.fromValue(object.readyReplicas)).unsigned = false; + else if (typeof object.readyReplicas === "string") + message.readyReplicas = parseInt(object.readyReplicas, 10); + else if (typeof object.readyReplicas === "number") + message.readyReplicas = object.readyReplicas; + else if (typeof object.readyReplicas === "object") + message.readyReplicas = new $util.LongBits(object.readyReplicas.low >>> 0, object.readyReplicas.high >>> 0).toNumber(); + if (object.allocatedReplicas != null) + if ($util.Long) + (message.allocatedReplicas = $util.Long.fromValue(object.allocatedReplicas)).unsigned = false; + else if (typeof object.allocatedReplicas === "string") + message.allocatedReplicas = parseInt(object.allocatedReplicas, 10); + else if (typeof object.allocatedReplicas === "number") + message.allocatedReplicas = object.allocatedReplicas; + else if (typeof object.allocatedReplicas === "object") + message.allocatedReplicas = new $util.LongBits(object.allocatedReplicas.low >>> 0, object.allocatedReplicas.high >>> 0).toNumber(); + if (object.reservedReplicas != null) + if ($util.Long) + (message.reservedReplicas = $util.Long.fromValue(object.reservedReplicas)).unsigned = false; + else if (typeof object.reservedReplicas === "string") + message.reservedReplicas = parseInt(object.reservedReplicas, 10); + else if (typeof object.reservedReplicas === "number") + message.reservedReplicas = object.reservedReplicas; + else if (typeof object.reservedReplicas === "object") + message.reservedReplicas = new $util.LongBits(object.reservedReplicas.low >>> 0, object.reservedReplicas.high >>> 0).toNumber(); + if (object.replicas != null) + if ($util.Long) + (message.replicas = $util.Long.fromValue(object.replicas)).unsigned = false; + else if (typeof object.replicas === "string") + message.replicas = parseInt(object.replicas, 10); + else if (typeof object.replicas === "number") + message.replicas = object.replicas; + else if (typeof object.replicas === "object") + message.replicas = new $util.LongBits(object.replicas.low >>> 0, object.replicas.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a DeployedFleetStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @static + * @param {google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus} message DeployedFleetStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployedFleetStatus.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.readyReplicas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.readyReplicas = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.allocatedReplicas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.allocatedReplicas = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.reservedReplicas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.reservedReplicas = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.replicas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.replicas = options.longs === String ? "0" : 0; + } + if (message.readyReplicas != null && message.hasOwnProperty("readyReplicas")) + if (typeof message.readyReplicas === "number") + object.readyReplicas = options.longs === String ? String(message.readyReplicas) : message.readyReplicas; + else + object.readyReplicas = options.longs === String ? $util.Long.prototype.toString.call(message.readyReplicas) : options.longs === Number ? new $util.LongBits(message.readyReplicas.low >>> 0, message.readyReplicas.high >>> 0).toNumber() : message.readyReplicas; + if (message.allocatedReplicas != null && message.hasOwnProperty("allocatedReplicas")) + if (typeof message.allocatedReplicas === "number") + object.allocatedReplicas = options.longs === String ? String(message.allocatedReplicas) : message.allocatedReplicas; + else + object.allocatedReplicas = options.longs === String ? $util.Long.prototype.toString.call(message.allocatedReplicas) : options.longs === Number ? new $util.LongBits(message.allocatedReplicas.low >>> 0, message.allocatedReplicas.high >>> 0).toNumber() : message.allocatedReplicas; + if (message.reservedReplicas != null && message.hasOwnProperty("reservedReplicas")) + if (typeof message.reservedReplicas === "number") + object.reservedReplicas = options.longs === String ? String(message.reservedReplicas) : message.reservedReplicas; + else + object.reservedReplicas = options.longs === String ? $util.Long.prototype.toString.call(message.reservedReplicas) : options.longs === Number ? new $util.LongBits(message.reservedReplicas.low >>> 0, message.reservedReplicas.high >>> 0).toNumber() : message.reservedReplicas; + if (message.replicas != null && message.hasOwnProperty("replicas")) + if (typeof message.replicas === "number") + object.replicas = options.longs === String ? String(message.replicas) : message.replicas; + else + object.replicas = options.longs === String ? $util.Long.prototype.toString.call(message.replicas) : options.longs === Number ? new $util.LongBits(message.replicas.low >>> 0, message.replicas.high >>> 0).toNumber() : message.replicas; + return object; + }; + + /** + * Converts this DeployedFleetStatus to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @instance + * @returns {Object.} JSON object + */ + DeployedFleetStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployedFleetStatus + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployedFleetStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus"; + }; + + return DeployedFleetStatus; + })(); + + return DeployedFleet; + })(); + + DeployedFleetDetails.DeployedFleetAutoscaler = (function() { + + /** + * Properties of a DeployedFleetAutoscaler. + * @memberof google.cloud.gaming.v1.DeployedFleetDetails + * @interface IDeployedFleetAutoscaler + * @property {string|null} [autoscaler] DeployedFleetAutoscaler autoscaler + * @property {google.cloud.gaming.v1.ISpecSource|null} [specSource] DeployedFleetAutoscaler specSource + * @property {string|null} [fleetAutoscalerSpec] DeployedFleetAutoscaler fleetAutoscalerSpec + */ + + /** + * Constructs a new DeployedFleetAutoscaler. + * @memberof google.cloud.gaming.v1.DeployedFleetDetails + * @classdesc Represents a DeployedFleetAutoscaler. + * @implements IDeployedFleetAutoscaler + * @constructor + * @param {google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleetAutoscaler=} [properties] Properties to set + */ + function DeployedFleetAutoscaler(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployedFleetAutoscaler autoscaler. + * @member {string} autoscaler + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler + * @instance + */ + DeployedFleetAutoscaler.prototype.autoscaler = ""; + + /** + * DeployedFleetAutoscaler specSource. + * @member {google.cloud.gaming.v1.ISpecSource|null|undefined} specSource + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler + * @instance + */ + DeployedFleetAutoscaler.prototype.specSource = null; + + /** + * DeployedFleetAutoscaler fleetAutoscalerSpec. + * @member {string} fleetAutoscalerSpec + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler + * @instance + */ + DeployedFleetAutoscaler.prototype.fleetAutoscalerSpec = ""; + + /** + * Creates a new DeployedFleetAutoscaler instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler + * @static + * @param {google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleetAutoscaler=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler} DeployedFleetAutoscaler instance + */ + DeployedFleetAutoscaler.create = function create(properties) { + return new DeployedFleetAutoscaler(properties); + }; + + /** + * Encodes the specified DeployedFleetAutoscaler message. Does not implicitly {@link google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler + * @static + * @param {google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleetAutoscaler} message DeployedFleetAutoscaler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployedFleetAutoscaler.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.autoscaler != null && Object.hasOwnProperty.call(message, "autoscaler")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.autoscaler); + if (message.fleetAutoscalerSpec != null && Object.hasOwnProperty.call(message, "fleetAutoscalerSpec")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.fleetAutoscalerSpec); + if (message.specSource != null && Object.hasOwnProperty.call(message, "specSource")) + $root.google.cloud.gaming.v1.SpecSource.encode(message.specSource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployedFleetAutoscaler message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler + * @static + * @param {google.cloud.gaming.v1.DeployedFleetDetails.IDeployedFleetAutoscaler} message DeployedFleetAutoscaler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployedFleetAutoscaler.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployedFleetAutoscaler message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler} DeployedFleetAutoscaler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployedFleetAutoscaler.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.autoscaler = reader.string(); + break; + } + case 4: { + message.specSource = $root.google.cloud.gaming.v1.SpecSource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.fleetAutoscalerSpec = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployedFleetAutoscaler message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler} DeployedFleetAutoscaler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployedFleetAutoscaler.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployedFleetAutoscaler message. + * @function verify + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployedFleetAutoscaler.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) + if (!$util.isString(message.autoscaler)) + return "autoscaler: string expected"; + if (message.specSource != null && message.hasOwnProperty("specSource")) { + var error = $root.google.cloud.gaming.v1.SpecSource.verify(message.specSource); + if (error) + return "specSource." + error; + } + if (message.fleetAutoscalerSpec != null && message.hasOwnProperty("fleetAutoscalerSpec")) + if (!$util.isString(message.fleetAutoscalerSpec)) + return "fleetAutoscalerSpec: string expected"; + return null; + }; + + /** + * Creates a DeployedFleetAutoscaler message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler} DeployedFleetAutoscaler + */ + DeployedFleetAutoscaler.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler) + return object; + var message = new $root.google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler(); + if (object.autoscaler != null) + message.autoscaler = String(object.autoscaler); + if (object.specSource != null) { + if (typeof object.specSource !== "object") + throw TypeError(".google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler.specSource: object expected"); + message.specSource = $root.google.cloud.gaming.v1.SpecSource.fromObject(object.specSource); + } + if (object.fleetAutoscalerSpec != null) + message.fleetAutoscalerSpec = String(object.fleetAutoscalerSpec); + return message; + }; + + /** + * Creates a plain object from a DeployedFleetAutoscaler message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler + * @static + * @param {google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler} message DeployedFleetAutoscaler + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployedFleetAutoscaler.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.autoscaler = ""; + object.fleetAutoscalerSpec = ""; + object.specSource = null; + } + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) + object.autoscaler = message.autoscaler; + if (message.fleetAutoscalerSpec != null && message.hasOwnProperty("fleetAutoscalerSpec")) + object.fleetAutoscalerSpec = message.fleetAutoscalerSpec; + if (message.specSource != null && message.hasOwnProperty("specSource")) + object.specSource = $root.google.cloud.gaming.v1.SpecSource.toObject(message.specSource, options); + return object; + }; + + /** + * Converts this DeployedFleetAutoscaler to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler + * @instance + * @returns {Object.} JSON object + */ + DeployedFleetAutoscaler.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployedFleetAutoscaler + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployedFleetAutoscaler.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.DeployedFleetDetails.DeployedFleetAutoscaler"; + }; + + return DeployedFleetAutoscaler; + })(); + + return DeployedFleetDetails; + })(); + + /** + * GameServerClusterView enum. + * @name google.cloud.gaming.v1.GameServerClusterView + * @enum {number} + * @property {number} GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED=0 GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED value + * @property {number} BASIC=1 BASIC value + * @property {number} FULL=2 FULL value + */ + v1.GameServerClusterView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC"] = 1; + values[valuesById[2] = "FULL"] = 2; + return values; + })(); + + v1.ListGameServerClustersRequest = (function() { + + /** + * Properties of a ListGameServerClustersRequest. + * @memberof google.cloud.gaming.v1 + * @interface IListGameServerClustersRequest + * @property {string|null} [parent] ListGameServerClustersRequest parent + * @property {number|null} [pageSize] ListGameServerClustersRequest pageSize + * @property {string|null} [pageToken] ListGameServerClustersRequest pageToken + * @property {string|null} [filter] ListGameServerClustersRequest filter + * @property {string|null} [orderBy] ListGameServerClustersRequest orderBy + * @property {google.cloud.gaming.v1.GameServerClusterView|null} [view] ListGameServerClustersRequest view + */ + + /** + * Constructs a new ListGameServerClustersRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a ListGameServerClustersRequest. + * @implements IListGameServerClustersRequest + * @constructor + * @param {google.cloud.gaming.v1.IListGameServerClustersRequest=} [properties] Properties to set + */ + function ListGameServerClustersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGameServerClustersRequest parent. + * @member {string} parent + * @memberof google.cloud.gaming.v1.ListGameServerClustersRequest + * @instance + */ + ListGameServerClustersRequest.prototype.parent = ""; + + /** + * ListGameServerClustersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.gaming.v1.ListGameServerClustersRequest + * @instance + */ + ListGameServerClustersRequest.prototype.pageSize = 0; + + /** + * ListGameServerClustersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.gaming.v1.ListGameServerClustersRequest + * @instance + */ + ListGameServerClustersRequest.prototype.pageToken = ""; + + /** + * ListGameServerClustersRequest filter. + * @member {string} filter + * @memberof google.cloud.gaming.v1.ListGameServerClustersRequest + * @instance + */ + ListGameServerClustersRequest.prototype.filter = ""; + + /** + * ListGameServerClustersRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.gaming.v1.ListGameServerClustersRequest + * @instance + */ + ListGameServerClustersRequest.prototype.orderBy = ""; + + /** + * ListGameServerClustersRequest view. + * @member {google.cloud.gaming.v1.GameServerClusterView} view + * @memberof google.cloud.gaming.v1.ListGameServerClustersRequest + * @instance + */ + ListGameServerClustersRequest.prototype.view = 0; + + /** + * Creates a new ListGameServerClustersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.ListGameServerClustersRequest + * @static + * @param {google.cloud.gaming.v1.IListGameServerClustersRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.ListGameServerClustersRequest} ListGameServerClustersRequest instance + */ + ListGameServerClustersRequest.create = function create(properties) { + return new ListGameServerClustersRequest(properties); + }; + + /** + * Encodes the specified ListGameServerClustersRequest message. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerClustersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.ListGameServerClustersRequest + * @static + * @param {google.cloud.gaming.v1.IListGameServerClustersRequest} message ListGameServerClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerClustersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.view); + return writer; + }; + + /** + * Encodes the specified ListGameServerClustersRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerClustersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.ListGameServerClustersRequest + * @static + * @param {google.cloud.gaming.v1.IListGameServerClustersRequest} message ListGameServerClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGameServerClustersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.ListGameServerClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.ListGameServerClustersRequest} ListGameServerClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerClustersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.ListGameServerClustersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + case 6: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGameServerClustersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.ListGameServerClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.ListGameServerClustersRequest} ListGameServerClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerClustersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGameServerClustersRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.ListGameServerClustersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGameServerClustersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ListGameServerClustersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.ListGameServerClustersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.ListGameServerClustersRequest} ListGameServerClustersRequest + */ + ListGameServerClustersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.ListGameServerClustersRequest) + return object; + var message = new $root.google.cloud.gaming.v1.ListGameServerClustersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "GAME_SERVER_CLUSTER_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 ListGameServerClustersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.ListGameServerClustersRequest + * @static + * @param {google.cloud.gaming.v1.ListGameServerClustersRequest} message ListGameServerClustersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGameServerClustersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + object.view = options.enums === String ? "GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.gaming.v1.GameServerClusterView[message.view] === undefined ? message.view : $root.google.cloud.gaming.v1.GameServerClusterView[message.view] : message.view; + return object; + }; + + /** + * Converts this ListGameServerClustersRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.ListGameServerClustersRequest + * @instance + * @returns {Object.} JSON object + */ + ListGameServerClustersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGameServerClustersRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.ListGameServerClustersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGameServerClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.ListGameServerClustersRequest"; + }; + + return ListGameServerClustersRequest; + })(); + + v1.ListGameServerClustersResponse = (function() { + + /** + * Properties of a ListGameServerClustersResponse. + * @memberof google.cloud.gaming.v1 + * @interface IListGameServerClustersResponse + * @property {Array.|null} [gameServerClusters] ListGameServerClustersResponse gameServerClusters + * @property {string|null} [nextPageToken] ListGameServerClustersResponse nextPageToken + * @property {Array.|null} [unreachable] ListGameServerClustersResponse unreachable + */ + + /** + * Constructs a new ListGameServerClustersResponse. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a ListGameServerClustersResponse. + * @implements IListGameServerClustersResponse + * @constructor + * @param {google.cloud.gaming.v1.IListGameServerClustersResponse=} [properties] Properties to set + */ + function ListGameServerClustersResponse(properties) { + this.gameServerClusters = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGameServerClustersResponse gameServerClusters. + * @member {Array.} gameServerClusters + * @memberof google.cloud.gaming.v1.ListGameServerClustersResponse + * @instance + */ + ListGameServerClustersResponse.prototype.gameServerClusters = $util.emptyArray; + + /** + * ListGameServerClustersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.gaming.v1.ListGameServerClustersResponse + * @instance + */ + ListGameServerClustersResponse.prototype.nextPageToken = ""; + + /** + * ListGameServerClustersResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.gaming.v1.ListGameServerClustersResponse + * @instance + */ + ListGameServerClustersResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListGameServerClustersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.ListGameServerClustersResponse + * @static + * @param {google.cloud.gaming.v1.IListGameServerClustersResponse=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.ListGameServerClustersResponse} ListGameServerClustersResponse instance + */ + ListGameServerClustersResponse.create = function create(properties) { + return new ListGameServerClustersResponse(properties); + }; + + /** + * Encodes the specified ListGameServerClustersResponse message. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerClustersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.ListGameServerClustersResponse + * @static + * @param {google.cloud.gaming.v1.IListGameServerClustersResponse} message ListGameServerClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerClustersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gameServerClusters != null && message.gameServerClusters.length) + for (var i = 0; i < message.gameServerClusters.length; ++i) + $root.google.cloud.gaming.v1.GameServerCluster.encode(message.gameServerClusters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListGameServerClustersResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerClustersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.ListGameServerClustersResponse + * @static + * @param {google.cloud.gaming.v1.IListGameServerClustersResponse} message ListGameServerClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGameServerClustersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.ListGameServerClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.ListGameServerClustersResponse} ListGameServerClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerClustersResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.ListGameServerClustersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.gameServerClusters && message.gameServerClusters.length)) + message.gameServerClusters = []; + message.gameServerClusters.push($root.google.cloud.gaming.v1.GameServerCluster.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGameServerClustersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.ListGameServerClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.ListGameServerClustersResponse} ListGameServerClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerClustersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGameServerClustersResponse message. + * @function verify + * @memberof google.cloud.gaming.v1.ListGameServerClustersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGameServerClustersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gameServerClusters != null && message.hasOwnProperty("gameServerClusters")) { + if (!Array.isArray(message.gameServerClusters)) + return "gameServerClusters: array expected"; + for (var i = 0; i < message.gameServerClusters.length; ++i) { + var error = $root.google.cloud.gaming.v1.GameServerCluster.verify(message.gameServerClusters[i]); + if (error) + return "gameServerClusters." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListGameServerClustersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.ListGameServerClustersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.ListGameServerClustersResponse} ListGameServerClustersResponse + */ + ListGameServerClustersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.ListGameServerClustersResponse) + return object; + var message = new $root.google.cloud.gaming.v1.ListGameServerClustersResponse(); + if (object.gameServerClusters) { + if (!Array.isArray(object.gameServerClusters)) + throw TypeError(".google.cloud.gaming.v1.ListGameServerClustersResponse.gameServerClusters: array expected"); + message.gameServerClusters = []; + for (var i = 0; i < object.gameServerClusters.length; ++i) { + if (typeof object.gameServerClusters[i] !== "object") + throw TypeError(".google.cloud.gaming.v1.ListGameServerClustersResponse.gameServerClusters: object expected"); + message.gameServerClusters[i] = $root.google.cloud.gaming.v1.GameServerCluster.fromObject(object.gameServerClusters[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.gaming.v1.ListGameServerClustersResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListGameServerClustersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.ListGameServerClustersResponse + * @static + * @param {google.cloud.gaming.v1.ListGameServerClustersResponse} message ListGameServerClustersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGameServerClustersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.gameServerClusters = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.gameServerClusters && message.gameServerClusters.length) { + object.gameServerClusters = []; + for (var j = 0; j < message.gameServerClusters.length; ++j) + object.gameServerClusters[j] = $root.google.cloud.gaming.v1.GameServerCluster.toObject(message.gameServerClusters[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListGameServerClustersResponse to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.ListGameServerClustersResponse + * @instance + * @returns {Object.} JSON object + */ + ListGameServerClustersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGameServerClustersResponse + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.ListGameServerClustersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGameServerClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.ListGameServerClustersResponse"; + }; + + return ListGameServerClustersResponse; + })(); + + v1.GetGameServerClusterRequest = (function() { + + /** + * Properties of a GetGameServerClusterRequest. + * @memberof google.cloud.gaming.v1 + * @interface IGetGameServerClusterRequest + * @property {string|null} [name] GetGameServerClusterRequest name + * @property {google.cloud.gaming.v1.GameServerClusterView|null} [view] GetGameServerClusterRequest view + */ + + /** + * Constructs a new GetGameServerClusterRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a GetGameServerClusterRequest. + * @implements IGetGameServerClusterRequest + * @constructor + * @param {google.cloud.gaming.v1.IGetGameServerClusterRequest=} [properties] Properties to set + */ + function GetGameServerClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGameServerClusterRequest name. + * @member {string} name + * @memberof google.cloud.gaming.v1.GetGameServerClusterRequest + * @instance + */ + GetGameServerClusterRequest.prototype.name = ""; + + /** + * GetGameServerClusterRequest view. + * @member {google.cloud.gaming.v1.GameServerClusterView} view + * @memberof google.cloud.gaming.v1.GetGameServerClusterRequest + * @instance + */ + GetGameServerClusterRequest.prototype.view = 0; + + /** + * Creates a new GetGameServerClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.GetGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.IGetGameServerClusterRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.GetGameServerClusterRequest} GetGameServerClusterRequest instance + */ + GetGameServerClusterRequest.create = function create(properties) { + return new GetGameServerClusterRequest(properties); + }; + + /** + * Encodes the specified GetGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1.GetGameServerClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.GetGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.IGetGameServerClusterRequest} message GetGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGameServerClusterRequest.encode = function encode(message, writer) { + 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 6, wireType 0 =*/48).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GetGameServerClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.GetGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.IGetGameServerClusterRequest} message GetGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGameServerClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGameServerClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.GetGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.GetGameServerClusterRequest} GetGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGameServerClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.GetGameServerClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 6: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.GetGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.GetGameServerClusterRequest} GetGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGameServerClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGameServerClusterRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.GetGameServerClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGameServerClusterRequest.verify = function verify(message) { + if (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 GetGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.GetGameServerClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.GetGameServerClusterRequest} GetGameServerClusterRequest + */ + GetGameServerClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.GetGameServerClusterRequest) + return object; + var message = new $root.google.cloud.gaming.v1.GetGameServerClusterRequest(); + 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 "GAME_SERVER_CLUSTER_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 GetGameServerClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.GetGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.GetGameServerClusterRequest} message GetGameServerClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGameServerClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "GAME_SERVER_CLUSTER_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.gaming.v1.GameServerClusterView[message.view] === undefined ? message.view : $root.google.cloud.gaming.v1.GameServerClusterView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetGameServerClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.GetGameServerClusterRequest + * @instance + * @returns {Object.} JSON object + */ + GetGameServerClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGameServerClusterRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.GetGameServerClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGameServerClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.GetGameServerClusterRequest"; + }; + + return GetGameServerClusterRequest; + })(); + + v1.CreateGameServerClusterRequest = (function() { + + /** + * Properties of a CreateGameServerClusterRequest. + * @memberof google.cloud.gaming.v1 + * @interface ICreateGameServerClusterRequest + * @property {string|null} [parent] CreateGameServerClusterRequest parent + * @property {string|null} [gameServerClusterId] CreateGameServerClusterRequest gameServerClusterId + * @property {google.cloud.gaming.v1.IGameServerCluster|null} [gameServerCluster] CreateGameServerClusterRequest gameServerCluster + */ + + /** + * Constructs a new CreateGameServerClusterRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a CreateGameServerClusterRequest. + * @implements ICreateGameServerClusterRequest + * @constructor + * @param {google.cloud.gaming.v1.ICreateGameServerClusterRequest=} [properties] Properties to set + */ + function CreateGameServerClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateGameServerClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.gaming.v1.CreateGameServerClusterRequest + * @instance + */ + CreateGameServerClusterRequest.prototype.parent = ""; + + /** + * CreateGameServerClusterRequest gameServerClusterId. + * @member {string} gameServerClusterId + * @memberof google.cloud.gaming.v1.CreateGameServerClusterRequest + * @instance + */ + CreateGameServerClusterRequest.prototype.gameServerClusterId = ""; + + /** + * CreateGameServerClusterRequest gameServerCluster. + * @member {google.cloud.gaming.v1.IGameServerCluster|null|undefined} gameServerCluster + * @memberof google.cloud.gaming.v1.CreateGameServerClusterRequest + * @instance + */ + CreateGameServerClusterRequest.prototype.gameServerCluster = null; + + /** + * Creates a new CreateGameServerClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.CreateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.ICreateGameServerClusterRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.CreateGameServerClusterRequest} CreateGameServerClusterRequest instance + */ + CreateGameServerClusterRequest.create = function create(properties) { + return new CreateGameServerClusterRequest(properties); + }; + + /** + * Encodes the specified CreateGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1.CreateGameServerClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.CreateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.ICreateGameServerClusterRequest} message CreateGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGameServerClusterRequest.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.gameServerClusterId != null && Object.hasOwnProperty.call(message, "gameServerClusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gameServerClusterId); + if (message.gameServerCluster != null && Object.hasOwnProperty.call(message, "gameServerCluster")) + $root.google.cloud.gaming.v1.GameServerCluster.encode(message.gameServerCluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.CreateGameServerClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.CreateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.ICreateGameServerClusterRequest} message CreateGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGameServerClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateGameServerClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.CreateGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.CreateGameServerClusterRequest} CreateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGameServerClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.CreateGameServerClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.gameServerClusterId = reader.string(); + break; + } + case 3: { + message.gameServerCluster = $root.google.cloud.gaming.v1.GameServerCluster.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.CreateGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.CreateGameServerClusterRequest} CreateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGameServerClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateGameServerClusterRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.CreateGameServerClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateGameServerClusterRequest.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.gameServerClusterId != null && message.hasOwnProperty("gameServerClusterId")) + if (!$util.isString(message.gameServerClusterId)) + return "gameServerClusterId: string expected"; + if (message.gameServerCluster != null && message.hasOwnProperty("gameServerCluster")) { + var error = $root.google.cloud.gaming.v1.GameServerCluster.verify(message.gameServerCluster); + if (error) + return "gameServerCluster." + error; + } + return null; + }; + + /** + * Creates a CreateGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.CreateGameServerClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.CreateGameServerClusterRequest} CreateGameServerClusterRequest + */ + CreateGameServerClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.CreateGameServerClusterRequest) + return object; + var message = new $root.google.cloud.gaming.v1.CreateGameServerClusterRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.gameServerClusterId != null) + message.gameServerClusterId = String(object.gameServerClusterId); + if (object.gameServerCluster != null) { + if (typeof object.gameServerCluster !== "object") + throw TypeError(".google.cloud.gaming.v1.CreateGameServerClusterRequest.gameServerCluster: object expected"); + message.gameServerCluster = $root.google.cloud.gaming.v1.GameServerCluster.fromObject(object.gameServerCluster); + } + return message; + }; + + /** + * Creates a plain object from a CreateGameServerClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.CreateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.CreateGameServerClusterRequest} message CreateGameServerClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateGameServerClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.gameServerClusterId = ""; + object.gameServerCluster = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.gameServerClusterId != null && message.hasOwnProperty("gameServerClusterId")) + object.gameServerClusterId = message.gameServerClusterId; + if (message.gameServerCluster != null && message.hasOwnProperty("gameServerCluster")) + object.gameServerCluster = $root.google.cloud.gaming.v1.GameServerCluster.toObject(message.gameServerCluster, options); + return object; + }; + + /** + * Converts this CreateGameServerClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.CreateGameServerClusterRequest + * @instance + * @returns {Object.} JSON object + */ + CreateGameServerClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateGameServerClusterRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.CreateGameServerClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateGameServerClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.CreateGameServerClusterRequest"; + }; + + return CreateGameServerClusterRequest; + })(); + + v1.PreviewCreateGameServerClusterRequest = (function() { + + /** + * Properties of a PreviewCreateGameServerClusterRequest. + * @memberof google.cloud.gaming.v1 + * @interface IPreviewCreateGameServerClusterRequest + * @property {string|null} [parent] PreviewCreateGameServerClusterRequest parent + * @property {string|null} [gameServerClusterId] PreviewCreateGameServerClusterRequest gameServerClusterId + * @property {google.cloud.gaming.v1.IGameServerCluster|null} [gameServerCluster] PreviewCreateGameServerClusterRequest gameServerCluster + * @property {google.protobuf.ITimestamp|null} [previewTime] PreviewCreateGameServerClusterRequest previewTime + * @property {google.cloud.gaming.v1.GameServerClusterView|null} [view] PreviewCreateGameServerClusterRequest view + */ + + /** + * Constructs a new PreviewCreateGameServerClusterRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a PreviewCreateGameServerClusterRequest. + * @implements IPreviewCreateGameServerClusterRequest + * @constructor + * @param {google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest=} [properties] Properties to set + */ + function PreviewCreateGameServerClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreviewCreateGameServerClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest + * @instance + */ + PreviewCreateGameServerClusterRequest.prototype.parent = ""; + + /** + * PreviewCreateGameServerClusterRequest gameServerClusterId. + * @member {string} gameServerClusterId + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest + * @instance + */ + PreviewCreateGameServerClusterRequest.prototype.gameServerClusterId = ""; + + /** + * PreviewCreateGameServerClusterRequest gameServerCluster. + * @member {google.cloud.gaming.v1.IGameServerCluster|null|undefined} gameServerCluster + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest + * @instance + */ + PreviewCreateGameServerClusterRequest.prototype.gameServerCluster = null; + + /** + * PreviewCreateGameServerClusterRequest previewTime. + * @member {google.protobuf.ITimestamp|null|undefined} previewTime + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest + * @instance + */ + PreviewCreateGameServerClusterRequest.prototype.previewTime = null; + + /** + * PreviewCreateGameServerClusterRequest view. + * @member {google.cloud.gaming.v1.GameServerClusterView} view + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest + * @instance + */ + PreviewCreateGameServerClusterRequest.prototype.view = 0; + + /** + * Creates a new PreviewCreateGameServerClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest} PreviewCreateGameServerClusterRequest instance + */ + PreviewCreateGameServerClusterRequest.create = function create(properties) { + return new PreviewCreateGameServerClusterRequest(properties); + }; + + /** + * Encodes the specified PreviewCreateGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest} message PreviewCreateGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewCreateGameServerClusterRequest.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.gameServerClusterId != null && Object.hasOwnProperty.call(message, "gameServerClusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gameServerClusterId); + if (message.gameServerCluster != null && Object.hasOwnProperty.call(message, "gameServerCluster")) + $root.google.cloud.gaming.v1.GameServerCluster.encode(message.gameServerCluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.previewTime != null && Object.hasOwnProperty.call(message, "previewTime")) + $root.google.protobuf.Timestamp.encode(message.previewTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.view); + return writer; + }; + + /** + * Encodes the specified PreviewCreateGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest} message PreviewCreateGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewCreateGameServerClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreviewCreateGameServerClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest} PreviewCreateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewCreateGameServerClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.gameServerClusterId = reader.string(); + break; + } + case 3: { + message.gameServerCluster = $root.google.cloud.gaming.v1.GameServerCluster.decode(reader, reader.uint32()); + break; + } + case 4: { + message.previewTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreviewCreateGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest} PreviewCreateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewCreateGameServerClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreviewCreateGameServerClusterRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreviewCreateGameServerClusterRequest.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.gameServerClusterId != null && message.hasOwnProperty("gameServerClusterId")) + if (!$util.isString(message.gameServerClusterId)) + return "gameServerClusterId: string expected"; + if (message.gameServerCluster != null && message.hasOwnProperty("gameServerCluster")) { + var error = $root.google.cloud.gaming.v1.GameServerCluster.verify(message.gameServerCluster); + if (error) + return "gameServerCluster." + error; + } + if (message.previewTime != null && message.hasOwnProperty("previewTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.previewTime); + if (error) + return "previewTime." + error; + } + 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 PreviewCreateGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest} PreviewCreateGameServerClusterRequest + */ + PreviewCreateGameServerClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest) + return object; + var message = new $root.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.gameServerClusterId != null) + message.gameServerClusterId = String(object.gameServerClusterId); + if (object.gameServerCluster != null) { + if (typeof object.gameServerCluster !== "object") + throw TypeError(".google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest.gameServerCluster: object expected"); + message.gameServerCluster = $root.google.cloud.gaming.v1.GameServerCluster.fromObject(object.gameServerCluster); + } + if (object.previewTime != null) { + if (typeof object.previewTime !== "object") + throw TypeError(".google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest.previewTime: object expected"); + message.previewTime = $root.google.protobuf.Timestamp.fromObject(object.previewTime); + } + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "GAME_SERVER_CLUSTER_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 PreviewCreateGameServerClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest} message PreviewCreateGameServerClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreviewCreateGameServerClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.gameServerClusterId = ""; + object.gameServerCluster = null; + object.previewTime = null; + object.view = options.enums === String ? "GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.gameServerClusterId != null && message.hasOwnProperty("gameServerClusterId")) + object.gameServerClusterId = message.gameServerClusterId; + if (message.gameServerCluster != null && message.hasOwnProperty("gameServerCluster")) + object.gameServerCluster = $root.google.cloud.gaming.v1.GameServerCluster.toObject(message.gameServerCluster, options); + if (message.previewTime != null && message.hasOwnProperty("previewTime")) + object.previewTime = $root.google.protobuf.Timestamp.toObject(message.previewTime, options); + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.gaming.v1.GameServerClusterView[message.view] === undefined ? message.view : $root.google.cloud.gaming.v1.GameServerClusterView[message.view] : message.view; + return object; + }; + + /** + * Converts this PreviewCreateGameServerClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest + * @instance + * @returns {Object.} JSON object + */ + PreviewCreateGameServerClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PreviewCreateGameServerClusterRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PreviewCreateGameServerClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest"; + }; + + return PreviewCreateGameServerClusterRequest; + })(); + + v1.PreviewCreateGameServerClusterResponse = (function() { + + /** + * Properties of a PreviewCreateGameServerClusterResponse. + * @memberof google.cloud.gaming.v1 + * @interface IPreviewCreateGameServerClusterResponse + * @property {string|null} [etag] PreviewCreateGameServerClusterResponse etag + * @property {google.cloud.gaming.v1.ITargetState|null} [targetState] PreviewCreateGameServerClusterResponse targetState + * @property {google.cloud.gaming.v1.IKubernetesClusterState|null} [clusterState] PreviewCreateGameServerClusterResponse clusterState + */ + + /** + * Constructs a new PreviewCreateGameServerClusterResponse. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a PreviewCreateGameServerClusterResponse. + * @implements IPreviewCreateGameServerClusterResponse + * @constructor + * @param {google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse=} [properties] Properties to set + */ + function PreviewCreateGameServerClusterResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreviewCreateGameServerClusterResponse etag. + * @member {string} etag + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse + * @instance + */ + PreviewCreateGameServerClusterResponse.prototype.etag = ""; + + /** + * PreviewCreateGameServerClusterResponse targetState. + * @member {google.cloud.gaming.v1.ITargetState|null|undefined} targetState + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse + * @instance + */ + PreviewCreateGameServerClusterResponse.prototype.targetState = null; + + /** + * PreviewCreateGameServerClusterResponse clusterState. + * @member {google.cloud.gaming.v1.IKubernetesClusterState|null|undefined} clusterState + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse + * @instance + */ + PreviewCreateGameServerClusterResponse.prototype.clusterState = null; + + /** + * Creates a new PreviewCreateGameServerClusterResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse} PreviewCreateGameServerClusterResponse instance + */ + PreviewCreateGameServerClusterResponse.create = function create(properties) { + return new PreviewCreateGameServerClusterResponse(properties); + }; + + /** + * Encodes the specified PreviewCreateGameServerClusterResponse message. Does not implicitly {@link google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse} message PreviewCreateGameServerClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewCreateGameServerClusterResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.targetState != null && Object.hasOwnProperty.call(message, "targetState")) + $root.google.cloud.gaming.v1.TargetState.encode(message.targetState, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.clusterState != null && Object.hasOwnProperty.call(message, "clusterState")) + $root.google.cloud.gaming.v1.KubernetesClusterState.encode(message.clusterState, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreviewCreateGameServerClusterResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse} message PreviewCreateGameServerClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewCreateGameServerClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreviewCreateGameServerClusterResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse} PreviewCreateGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewCreateGameServerClusterResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.etag = reader.string(); + break; + } + case 3: { + message.targetState = $root.google.cloud.gaming.v1.TargetState.decode(reader, reader.uint32()); + break; + } + case 4: { + message.clusterState = $root.google.cloud.gaming.v1.KubernetesClusterState.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreviewCreateGameServerClusterResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse} PreviewCreateGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewCreateGameServerClusterResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreviewCreateGameServerClusterResponse message. + * @function verify + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreviewCreateGameServerClusterResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.targetState != null && message.hasOwnProperty("targetState")) { + var error = $root.google.cloud.gaming.v1.TargetState.verify(message.targetState); + if (error) + return "targetState." + error; + } + if (message.clusterState != null && message.hasOwnProperty("clusterState")) { + var error = $root.google.cloud.gaming.v1.KubernetesClusterState.verify(message.clusterState); + if (error) + return "clusterState." + error; + } + return null; + }; + + /** + * Creates a PreviewCreateGameServerClusterResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse} PreviewCreateGameServerClusterResponse + */ + PreviewCreateGameServerClusterResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse) + return object; + var message = new $root.google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse(); + if (object.etag != null) + message.etag = String(object.etag); + if (object.targetState != null) { + if (typeof object.targetState !== "object") + throw TypeError(".google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse.targetState: object expected"); + message.targetState = $root.google.cloud.gaming.v1.TargetState.fromObject(object.targetState); + } + if (object.clusterState != null) { + if (typeof object.clusterState !== "object") + throw TypeError(".google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse.clusterState: object expected"); + message.clusterState = $root.google.cloud.gaming.v1.KubernetesClusterState.fromObject(object.clusterState); + } + return message; + }; + + /** + * Creates a plain object from a PreviewCreateGameServerClusterResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse} message PreviewCreateGameServerClusterResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreviewCreateGameServerClusterResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.etag = ""; + object.targetState = null; + object.clusterState = null; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.targetState != null && message.hasOwnProperty("targetState")) + object.targetState = $root.google.cloud.gaming.v1.TargetState.toObject(message.targetState, options); + if (message.clusterState != null && message.hasOwnProperty("clusterState")) + object.clusterState = $root.google.cloud.gaming.v1.KubernetesClusterState.toObject(message.clusterState, options); + return object; + }; + + /** + * Converts this PreviewCreateGameServerClusterResponse to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse + * @instance + * @returns {Object.} JSON object + */ + PreviewCreateGameServerClusterResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PreviewCreateGameServerClusterResponse + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PreviewCreateGameServerClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse"; + }; + + return PreviewCreateGameServerClusterResponse; + })(); + + v1.DeleteGameServerClusterRequest = (function() { + + /** + * Properties of a DeleteGameServerClusterRequest. + * @memberof google.cloud.gaming.v1 + * @interface IDeleteGameServerClusterRequest + * @property {string|null} [name] DeleteGameServerClusterRequest name + */ + + /** + * Constructs a new DeleteGameServerClusterRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a DeleteGameServerClusterRequest. + * @implements IDeleteGameServerClusterRequest + * @constructor + * @param {google.cloud.gaming.v1.IDeleteGameServerClusterRequest=} [properties] Properties to set + */ + function DeleteGameServerClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGameServerClusterRequest name. + * @member {string} name + * @memberof google.cloud.gaming.v1.DeleteGameServerClusterRequest + * @instance + */ + DeleteGameServerClusterRequest.prototype.name = ""; + + /** + * Creates a new DeleteGameServerClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.DeleteGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.IDeleteGameServerClusterRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.DeleteGameServerClusterRequest} DeleteGameServerClusterRequest instance + */ + DeleteGameServerClusterRequest.create = function create(properties) { + return new DeleteGameServerClusterRequest(properties); + }; + + /** + * Encodes the specified DeleteGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1.DeleteGameServerClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.DeleteGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.IDeleteGameServerClusterRequest} message DeleteGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGameServerClusterRequest.encode = function encode(message, writer) { + 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 DeleteGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.DeleteGameServerClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.DeleteGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.IDeleteGameServerClusterRequest} message DeleteGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGameServerClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGameServerClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.DeleteGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.DeleteGameServerClusterRequest} DeleteGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGameServerClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.DeleteGameServerClusterRequest(); + 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 DeleteGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.DeleteGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.DeleteGameServerClusterRequest} DeleteGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGameServerClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGameServerClusterRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.DeleteGameServerClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGameServerClusterRequest.verify = function verify(message) { + if (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 DeleteGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.DeleteGameServerClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.DeleteGameServerClusterRequest} DeleteGameServerClusterRequest + */ + DeleteGameServerClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.DeleteGameServerClusterRequest) + return object; + var message = new $root.google.cloud.gaming.v1.DeleteGameServerClusterRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteGameServerClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.DeleteGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.DeleteGameServerClusterRequest} message DeleteGameServerClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGameServerClusterRequest.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 DeleteGameServerClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.DeleteGameServerClusterRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGameServerClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteGameServerClusterRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.DeleteGameServerClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteGameServerClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.DeleteGameServerClusterRequest"; + }; + + return DeleteGameServerClusterRequest; + })(); + + v1.PreviewDeleteGameServerClusterRequest = (function() { + + /** + * Properties of a PreviewDeleteGameServerClusterRequest. + * @memberof google.cloud.gaming.v1 + * @interface IPreviewDeleteGameServerClusterRequest + * @property {string|null} [name] PreviewDeleteGameServerClusterRequest name + * @property {google.protobuf.ITimestamp|null} [previewTime] PreviewDeleteGameServerClusterRequest previewTime + */ + + /** + * Constructs a new PreviewDeleteGameServerClusterRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a PreviewDeleteGameServerClusterRequest. + * @implements IPreviewDeleteGameServerClusterRequest + * @constructor + * @param {google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest=} [properties] Properties to set + */ + function PreviewDeleteGameServerClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreviewDeleteGameServerClusterRequest name. + * @member {string} name + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest + * @instance + */ + PreviewDeleteGameServerClusterRequest.prototype.name = ""; + + /** + * PreviewDeleteGameServerClusterRequest previewTime. + * @member {google.protobuf.ITimestamp|null|undefined} previewTime + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest + * @instance + */ + PreviewDeleteGameServerClusterRequest.prototype.previewTime = null; + + /** + * Creates a new PreviewDeleteGameServerClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest} PreviewDeleteGameServerClusterRequest instance + */ + PreviewDeleteGameServerClusterRequest.create = function create(properties) { + return new PreviewDeleteGameServerClusterRequest(properties); + }; + + /** + * Encodes the specified PreviewDeleteGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest} message PreviewDeleteGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewDeleteGameServerClusterRequest.encode = function encode(message, writer) { + 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.previewTime != null && Object.hasOwnProperty.call(message, "previewTime")) + $root.google.protobuf.Timestamp.encode(message.previewTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreviewDeleteGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest} message PreviewDeleteGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewDeleteGameServerClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreviewDeleteGameServerClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest} PreviewDeleteGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewDeleteGameServerClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.previewTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreviewDeleteGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest} PreviewDeleteGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewDeleteGameServerClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreviewDeleteGameServerClusterRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreviewDeleteGameServerClusterRequest.verify = function verify(message) { + if (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.previewTime != null && message.hasOwnProperty("previewTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.previewTime); + if (error) + return "previewTime." + error; + } + return null; + }; + + /** + * Creates a PreviewDeleteGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest} PreviewDeleteGameServerClusterRequest + */ + PreviewDeleteGameServerClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest) + return object; + var message = new $root.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.previewTime != null) { + if (typeof object.previewTime !== "object") + throw TypeError(".google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest.previewTime: object expected"); + message.previewTime = $root.google.protobuf.Timestamp.fromObject(object.previewTime); + } + return message; + }; + + /** + * Creates a plain object from a PreviewDeleteGameServerClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest} message PreviewDeleteGameServerClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreviewDeleteGameServerClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.previewTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.previewTime != null && message.hasOwnProperty("previewTime")) + object.previewTime = $root.google.protobuf.Timestamp.toObject(message.previewTime, options); + return object; + }; + + /** + * Converts this PreviewDeleteGameServerClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest + * @instance + * @returns {Object.} JSON object + */ + PreviewDeleteGameServerClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PreviewDeleteGameServerClusterRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PreviewDeleteGameServerClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest"; + }; + + return PreviewDeleteGameServerClusterRequest; + })(); + + v1.PreviewDeleteGameServerClusterResponse = (function() { + + /** + * Properties of a PreviewDeleteGameServerClusterResponse. + * @memberof google.cloud.gaming.v1 + * @interface IPreviewDeleteGameServerClusterResponse + * @property {string|null} [etag] PreviewDeleteGameServerClusterResponse etag + * @property {google.cloud.gaming.v1.ITargetState|null} [targetState] PreviewDeleteGameServerClusterResponse targetState + */ + + /** + * Constructs a new PreviewDeleteGameServerClusterResponse. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a PreviewDeleteGameServerClusterResponse. + * @implements IPreviewDeleteGameServerClusterResponse + * @constructor + * @param {google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse=} [properties] Properties to set + */ + function PreviewDeleteGameServerClusterResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreviewDeleteGameServerClusterResponse etag. + * @member {string} etag + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse + * @instance + */ + PreviewDeleteGameServerClusterResponse.prototype.etag = ""; + + /** + * PreviewDeleteGameServerClusterResponse targetState. + * @member {google.cloud.gaming.v1.ITargetState|null|undefined} targetState + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse + * @instance + */ + PreviewDeleteGameServerClusterResponse.prototype.targetState = null; + + /** + * Creates a new PreviewDeleteGameServerClusterResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse} PreviewDeleteGameServerClusterResponse instance + */ + PreviewDeleteGameServerClusterResponse.create = function create(properties) { + return new PreviewDeleteGameServerClusterResponse(properties); + }; + + /** + * Encodes the specified PreviewDeleteGameServerClusterResponse message. Does not implicitly {@link google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse} message PreviewDeleteGameServerClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewDeleteGameServerClusterResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.targetState != null && Object.hasOwnProperty.call(message, "targetState")) + $root.google.cloud.gaming.v1.TargetState.encode(message.targetState, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreviewDeleteGameServerClusterResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse} message PreviewDeleteGameServerClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewDeleteGameServerClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreviewDeleteGameServerClusterResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse} PreviewDeleteGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewDeleteGameServerClusterResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.etag = reader.string(); + break; + } + case 3: { + message.targetState = $root.google.cloud.gaming.v1.TargetState.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreviewDeleteGameServerClusterResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse} PreviewDeleteGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewDeleteGameServerClusterResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreviewDeleteGameServerClusterResponse message. + * @function verify + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreviewDeleteGameServerClusterResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.targetState != null && message.hasOwnProperty("targetState")) { + var error = $root.google.cloud.gaming.v1.TargetState.verify(message.targetState); + if (error) + return "targetState." + error; + } + return null; + }; + + /** + * Creates a PreviewDeleteGameServerClusterResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse} PreviewDeleteGameServerClusterResponse + */ + PreviewDeleteGameServerClusterResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse) + return object; + var message = new $root.google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse(); + if (object.etag != null) + message.etag = String(object.etag); + if (object.targetState != null) { + if (typeof object.targetState !== "object") + throw TypeError(".google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse.targetState: object expected"); + message.targetState = $root.google.cloud.gaming.v1.TargetState.fromObject(object.targetState); + } + return message; + }; + + /** + * Creates a plain object from a PreviewDeleteGameServerClusterResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse} message PreviewDeleteGameServerClusterResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreviewDeleteGameServerClusterResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.etag = ""; + object.targetState = null; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.targetState != null && message.hasOwnProperty("targetState")) + object.targetState = $root.google.cloud.gaming.v1.TargetState.toObject(message.targetState, options); + return object; + }; + + /** + * Converts this PreviewDeleteGameServerClusterResponse to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse + * @instance + * @returns {Object.} JSON object + */ + PreviewDeleteGameServerClusterResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PreviewDeleteGameServerClusterResponse + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PreviewDeleteGameServerClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse"; + }; + + return PreviewDeleteGameServerClusterResponse; + })(); + + v1.UpdateGameServerClusterRequest = (function() { + + /** + * Properties of an UpdateGameServerClusterRequest. + * @memberof google.cloud.gaming.v1 + * @interface IUpdateGameServerClusterRequest + * @property {google.cloud.gaming.v1.IGameServerCluster|null} [gameServerCluster] UpdateGameServerClusterRequest gameServerCluster + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateGameServerClusterRequest updateMask + */ + + /** + * Constructs a new UpdateGameServerClusterRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents an UpdateGameServerClusterRequest. + * @implements IUpdateGameServerClusterRequest + * @constructor + * @param {google.cloud.gaming.v1.IUpdateGameServerClusterRequest=} [properties] Properties to set + */ + function UpdateGameServerClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateGameServerClusterRequest gameServerCluster. + * @member {google.cloud.gaming.v1.IGameServerCluster|null|undefined} gameServerCluster + * @memberof google.cloud.gaming.v1.UpdateGameServerClusterRequest + * @instance + */ + UpdateGameServerClusterRequest.prototype.gameServerCluster = null; + + /** + * UpdateGameServerClusterRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.gaming.v1.UpdateGameServerClusterRequest + * @instance + */ + UpdateGameServerClusterRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateGameServerClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.UpdateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.IUpdateGameServerClusterRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.UpdateGameServerClusterRequest} UpdateGameServerClusterRequest instance + */ + UpdateGameServerClusterRequest.create = function create(properties) { + return new UpdateGameServerClusterRequest(properties); + }; + + /** + * Encodes the specified UpdateGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1.UpdateGameServerClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.UpdateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.IUpdateGameServerClusterRequest} message UpdateGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGameServerClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gameServerCluster != null && Object.hasOwnProperty.call(message, "gameServerCluster")) + $root.google.cloud.gaming.v1.GameServerCluster.encode(message.gameServerCluster, 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 UpdateGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.UpdateGameServerClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.UpdateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.IUpdateGameServerClusterRequest} message UpdateGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGameServerClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateGameServerClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.UpdateGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.UpdateGameServerClusterRequest} UpdateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGameServerClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.UpdateGameServerClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gameServerCluster = $root.google.cloud.gaming.v1.GameServerCluster.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 UpdateGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.UpdateGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.UpdateGameServerClusterRequest} UpdateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGameServerClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateGameServerClusterRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.UpdateGameServerClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateGameServerClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gameServerCluster != null && message.hasOwnProperty("gameServerCluster")) { + var error = $root.google.cloud.gaming.v1.GameServerCluster.verify(message.gameServerCluster); + if (error) + return "gameServerCluster." + 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 UpdateGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.UpdateGameServerClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.UpdateGameServerClusterRequest} UpdateGameServerClusterRequest + */ + UpdateGameServerClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.UpdateGameServerClusterRequest) + return object; + var message = new $root.google.cloud.gaming.v1.UpdateGameServerClusterRequest(); + if (object.gameServerCluster != null) { + if (typeof object.gameServerCluster !== "object") + throw TypeError(".google.cloud.gaming.v1.UpdateGameServerClusterRequest.gameServerCluster: object expected"); + message.gameServerCluster = $root.google.cloud.gaming.v1.GameServerCluster.fromObject(object.gameServerCluster); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.gaming.v1.UpdateGameServerClusterRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateGameServerClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.UpdateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.UpdateGameServerClusterRequest} message UpdateGameServerClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateGameServerClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gameServerCluster = null; + object.updateMask = null; + } + if (message.gameServerCluster != null && message.hasOwnProperty("gameServerCluster")) + object.gameServerCluster = $root.google.cloud.gaming.v1.GameServerCluster.toObject(message.gameServerCluster, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateGameServerClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.UpdateGameServerClusterRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateGameServerClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateGameServerClusterRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.UpdateGameServerClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateGameServerClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.UpdateGameServerClusterRequest"; + }; + + return UpdateGameServerClusterRequest; + })(); + + v1.PreviewUpdateGameServerClusterRequest = (function() { + + /** + * Properties of a PreviewUpdateGameServerClusterRequest. + * @memberof google.cloud.gaming.v1 + * @interface IPreviewUpdateGameServerClusterRequest + * @property {google.cloud.gaming.v1.IGameServerCluster|null} [gameServerCluster] PreviewUpdateGameServerClusterRequest gameServerCluster + * @property {google.protobuf.IFieldMask|null} [updateMask] PreviewUpdateGameServerClusterRequest updateMask + * @property {google.protobuf.ITimestamp|null} [previewTime] PreviewUpdateGameServerClusterRequest previewTime + */ + + /** + * Constructs a new PreviewUpdateGameServerClusterRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a PreviewUpdateGameServerClusterRequest. + * @implements IPreviewUpdateGameServerClusterRequest + * @constructor + * @param {google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest=} [properties] Properties to set + */ + function PreviewUpdateGameServerClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreviewUpdateGameServerClusterRequest gameServerCluster. + * @member {google.cloud.gaming.v1.IGameServerCluster|null|undefined} gameServerCluster + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest + * @instance + */ + PreviewUpdateGameServerClusterRequest.prototype.gameServerCluster = null; + + /** + * PreviewUpdateGameServerClusterRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest + * @instance + */ + PreviewUpdateGameServerClusterRequest.prototype.updateMask = null; + + /** + * PreviewUpdateGameServerClusterRequest previewTime. + * @member {google.protobuf.ITimestamp|null|undefined} previewTime + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest + * @instance + */ + PreviewUpdateGameServerClusterRequest.prototype.previewTime = null; + + /** + * Creates a new PreviewUpdateGameServerClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest} PreviewUpdateGameServerClusterRequest instance + */ + PreviewUpdateGameServerClusterRequest.create = function create(properties) { + return new PreviewUpdateGameServerClusterRequest(properties); + }; + + /** + * Encodes the specified PreviewUpdateGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest} message PreviewUpdateGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewUpdateGameServerClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gameServerCluster != null && Object.hasOwnProperty.call(message, "gameServerCluster")) + $root.google.cloud.gaming.v1.GameServerCluster.encode(message.gameServerCluster, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.previewTime != null && Object.hasOwnProperty.call(message, "previewTime")) + $root.google.protobuf.Timestamp.encode(message.previewTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreviewUpdateGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest} message PreviewUpdateGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewUpdateGameServerClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreviewUpdateGameServerClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest} PreviewUpdateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewUpdateGameServerClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gameServerCluster = $root.google.cloud.gaming.v1.GameServerCluster.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.previewTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreviewUpdateGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest} PreviewUpdateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewUpdateGameServerClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreviewUpdateGameServerClusterRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreviewUpdateGameServerClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gameServerCluster != null && message.hasOwnProperty("gameServerCluster")) { + var error = $root.google.cloud.gaming.v1.GameServerCluster.verify(message.gameServerCluster); + if (error) + return "gameServerCluster." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.previewTime != null && message.hasOwnProperty("previewTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.previewTime); + if (error) + return "previewTime." + error; + } + return null; + }; + + /** + * Creates a PreviewUpdateGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest} PreviewUpdateGameServerClusterRequest + */ + PreviewUpdateGameServerClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest) + return object; + var message = new $root.google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest(); + if (object.gameServerCluster != null) { + if (typeof object.gameServerCluster !== "object") + throw TypeError(".google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest.gameServerCluster: object expected"); + message.gameServerCluster = $root.google.cloud.gaming.v1.GameServerCluster.fromObject(object.gameServerCluster); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.previewTime != null) { + if (typeof object.previewTime !== "object") + throw TypeError(".google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest.previewTime: object expected"); + message.previewTime = $root.google.protobuf.Timestamp.fromObject(object.previewTime); + } + return message; + }; + + /** + * Creates a plain object from a PreviewUpdateGameServerClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest} message PreviewUpdateGameServerClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreviewUpdateGameServerClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gameServerCluster = null; + object.updateMask = null; + object.previewTime = null; + } + if (message.gameServerCluster != null && message.hasOwnProperty("gameServerCluster")) + object.gameServerCluster = $root.google.cloud.gaming.v1.GameServerCluster.toObject(message.gameServerCluster, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.previewTime != null && message.hasOwnProperty("previewTime")) + object.previewTime = $root.google.protobuf.Timestamp.toObject(message.previewTime, options); + return object; + }; + + /** + * Converts this PreviewUpdateGameServerClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest + * @instance + * @returns {Object.} JSON object + */ + PreviewUpdateGameServerClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PreviewUpdateGameServerClusterRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PreviewUpdateGameServerClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest"; + }; + + return PreviewUpdateGameServerClusterRequest; + })(); + + v1.PreviewUpdateGameServerClusterResponse = (function() { + + /** + * Properties of a PreviewUpdateGameServerClusterResponse. + * @memberof google.cloud.gaming.v1 + * @interface IPreviewUpdateGameServerClusterResponse + * @property {string|null} [etag] PreviewUpdateGameServerClusterResponse etag + * @property {google.cloud.gaming.v1.ITargetState|null} [targetState] PreviewUpdateGameServerClusterResponse targetState + */ + + /** + * Constructs a new PreviewUpdateGameServerClusterResponse. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a PreviewUpdateGameServerClusterResponse. + * @implements IPreviewUpdateGameServerClusterResponse + * @constructor + * @param {google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse=} [properties] Properties to set + */ + function PreviewUpdateGameServerClusterResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreviewUpdateGameServerClusterResponse etag. + * @member {string} etag + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse + * @instance + */ + PreviewUpdateGameServerClusterResponse.prototype.etag = ""; + + /** + * PreviewUpdateGameServerClusterResponse targetState. + * @member {google.cloud.gaming.v1.ITargetState|null|undefined} targetState + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse + * @instance + */ + PreviewUpdateGameServerClusterResponse.prototype.targetState = null; + + /** + * Creates a new PreviewUpdateGameServerClusterResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse} PreviewUpdateGameServerClusterResponse instance + */ + PreviewUpdateGameServerClusterResponse.create = function create(properties) { + return new PreviewUpdateGameServerClusterResponse(properties); + }; + + /** + * Encodes the specified PreviewUpdateGameServerClusterResponse message. Does not implicitly {@link google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse} message PreviewUpdateGameServerClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewUpdateGameServerClusterResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.targetState != null && Object.hasOwnProperty.call(message, "targetState")) + $root.google.cloud.gaming.v1.TargetState.encode(message.targetState, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreviewUpdateGameServerClusterResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse} message PreviewUpdateGameServerClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewUpdateGameServerClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreviewUpdateGameServerClusterResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse} PreviewUpdateGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewUpdateGameServerClusterResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.etag = reader.string(); + break; + } + case 3: { + message.targetState = $root.google.cloud.gaming.v1.TargetState.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreviewUpdateGameServerClusterResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse} PreviewUpdateGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewUpdateGameServerClusterResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreviewUpdateGameServerClusterResponse message. + * @function verify + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreviewUpdateGameServerClusterResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.targetState != null && message.hasOwnProperty("targetState")) { + var error = $root.google.cloud.gaming.v1.TargetState.verify(message.targetState); + if (error) + return "targetState." + error; + } + return null; + }; + + /** + * Creates a PreviewUpdateGameServerClusterResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse} PreviewUpdateGameServerClusterResponse + */ + PreviewUpdateGameServerClusterResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse) + return object; + var message = new $root.google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse(); + if (object.etag != null) + message.etag = String(object.etag); + if (object.targetState != null) { + if (typeof object.targetState !== "object") + throw TypeError(".google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse.targetState: object expected"); + message.targetState = $root.google.cloud.gaming.v1.TargetState.fromObject(object.targetState); + } + return message; + }; + + /** + * Creates a plain object from a PreviewUpdateGameServerClusterResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse} message PreviewUpdateGameServerClusterResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreviewUpdateGameServerClusterResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.etag = ""; + object.targetState = null; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.targetState != null && message.hasOwnProperty("targetState")) + object.targetState = $root.google.cloud.gaming.v1.TargetState.toObject(message.targetState, options); + return object; + }; + + /** + * Converts this PreviewUpdateGameServerClusterResponse to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse + * @instance + * @returns {Object.} JSON object + */ + PreviewUpdateGameServerClusterResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PreviewUpdateGameServerClusterResponse + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PreviewUpdateGameServerClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse"; + }; + + return PreviewUpdateGameServerClusterResponse; + })(); + + v1.GameServerClusterConnectionInfo = (function() { + + /** + * Properties of a GameServerClusterConnectionInfo. + * @memberof google.cloud.gaming.v1 + * @interface IGameServerClusterConnectionInfo + * @property {google.cloud.gaming.v1.IGkeClusterReference|null} [gkeClusterReference] GameServerClusterConnectionInfo gkeClusterReference + * @property {string|null} [namespace] GameServerClusterConnectionInfo namespace + */ + + /** + * Constructs a new GameServerClusterConnectionInfo. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a GameServerClusterConnectionInfo. + * @implements IGameServerClusterConnectionInfo + * @constructor + * @param {google.cloud.gaming.v1.IGameServerClusterConnectionInfo=} [properties] Properties to set + */ + function GameServerClusterConnectionInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GameServerClusterConnectionInfo gkeClusterReference. + * @member {google.cloud.gaming.v1.IGkeClusterReference|null|undefined} gkeClusterReference + * @memberof google.cloud.gaming.v1.GameServerClusterConnectionInfo + * @instance + */ + GameServerClusterConnectionInfo.prototype.gkeClusterReference = null; + + /** + * GameServerClusterConnectionInfo namespace. + * @member {string} namespace + * @memberof google.cloud.gaming.v1.GameServerClusterConnectionInfo + * @instance + */ + GameServerClusterConnectionInfo.prototype.namespace = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GameServerClusterConnectionInfo clusterReference. + * @member {"gkeClusterReference"|undefined} clusterReference + * @memberof google.cloud.gaming.v1.GameServerClusterConnectionInfo + * @instance + */ + Object.defineProperty(GameServerClusterConnectionInfo.prototype, "clusterReference", { + get: $util.oneOfGetter($oneOfFields = ["gkeClusterReference"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GameServerClusterConnectionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.GameServerClusterConnectionInfo + * @static + * @param {google.cloud.gaming.v1.IGameServerClusterConnectionInfo=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.GameServerClusterConnectionInfo} GameServerClusterConnectionInfo instance + */ + GameServerClusterConnectionInfo.create = function create(properties) { + return new GameServerClusterConnectionInfo(properties); + }; + + /** + * Encodes the specified GameServerClusterConnectionInfo message. Does not implicitly {@link google.cloud.gaming.v1.GameServerClusterConnectionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.GameServerClusterConnectionInfo + * @static + * @param {google.cloud.gaming.v1.IGameServerClusterConnectionInfo} message GameServerClusterConnectionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerClusterConnectionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.namespace != null && Object.hasOwnProperty.call(message, "namespace")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.namespace); + if (message.gkeClusterReference != null && Object.hasOwnProperty.call(message, "gkeClusterReference")) + $root.google.cloud.gaming.v1.GkeClusterReference.encode(message.gkeClusterReference, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GameServerClusterConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GameServerClusterConnectionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.GameServerClusterConnectionInfo + * @static + * @param {google.cloud.gaming.v1.IGameServerClusterConnectionInfo} message GameServerClusterConnectionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerClusterConnectionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GameServerClusterConnectionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.GameServerClusterConnectionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.GameServerClusterConnectionInfo} GameServerClusterConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerClusterConnectionInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.GameServerClusterConnectionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 7: { + message.gkeClusterReference = $root.google.cloud.gaming.v1.GkeClusterReference.decode(reader, reader.uint32()); + break; + } + case 5: { + message.namespace = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GameServerClusterConnectionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.GameServerClusterConnectionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.GameServerClusterConnectionInfo} GameServerClusterConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerClusterConnectionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GameServerClusterConnectionInfo message. + * @function verify + * @memberof google.cloud.gaming.v1.GameServerClusterConnectionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GameServerClusterConnectionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gkeClusterReference != null && message.hasOwnProperty("gkeClusterReference")) { + properties.clusterReference = 1; + { + var error = $root.google.cloud.gaming.v1.GkeClusterReference.verify(message.gkeClusterReference); + if (error) + return "gkeClusterReference." + error; + } + } + if (message.namespace != null && message.hasOwnProperty("namespace")) + if (!$util.isString(message.namespace)) + return "namespace: string expected"; + return null; + }; + + /** + * Creates a GameServerClusterConnectionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.GameServerClusterConnectionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.GameServerClusterConnectionInfo} GameServerClusterConnectionInfo + */ + GameServerClusterConnectionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.GameServerClusterConnectionInfo) + return object; + var message = new $root.google.cloud.gaming.v1.GameServerClusterConnectionInfo(); + if (object.gkeClusterReference != null) { + if (typeof object.gkeClusterReference !== "object") + throw TypeError(".google.cloud.gaming.v1.GameServerClusterConnectionInfo.gkeClusterReference: object expected"); + message.gkeClusterReference = $root.google.cloud.gaming.v1.GkeClusterReference.fromObject(object.gkeClusterReference); + } + if (object.namespace != null) + message.namespace = String(object.namespace); + return message; + }; + + /** + * Creates a plain object from a GameServerClusterConnectionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.GameServerClusterConnectionInfo + * @static + * @param {google.cloud.gaming.v1.GameServerClusterConnectionInfo} message GameServerClusterConnectionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GameServerClusterConnectionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.namespace = ""; + if (message.namespace != null && message.hasOwnProperty("namespace")) + object.namespace = message.namespace; + if (message.gkeClusterReference != null && message.hasOwnProperty("gkeClusterReference")) { + object.gkeClusterReference = $root.google.cloud.gaming.v1.GkeClusterReference.toObject(message.gkeClusterReference, options); + if (options.oneofs) + object.clusterReference = "gkeClusterReference"; + } + return object; + }; + + /** + * Converts this GameServerClusterConnectionInfo to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.GameServerClusterConnectionInfo + * @instance + * @returns {Object.} JSON object + */ + GameServerClusterConnectionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GameServerClusterConnectionInfo + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.GameServerClusterConnectionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GameServerClusterConnectionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.GameServerClusterConnectionInfo"; + }; + + return GameServerClusterConnectionInfo; + })(); + + v1.GkeClusterReference = (function() { + + /** + * Properties of a GkeClusterReference. + * @memberof google.cloud.gaming.v1 + * @interface IGkeClusterReference + * @property {string|null} [cluster] GkeClusterReference cluster + */ + + /** + * Constructs a new GkeClusterReference. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a GkeClusterReference. + * @implements IGkeClusterReference + * @constructor + * @param {google.cloud.gaming.v1.IGkeClusterReference=} [properties] Properties to set + */ + function GkeClusterReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GkeClusterReference cluster. + * @member {string} cluster + * @memberof google.cloud.gaming.v1.GkeClusterReference + * @instance + */ + GkeClusterReference.prototype.cluster = ""; + + /** + * Creates a new GkeClusterReference instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.GkeClusterReference + * @static + * @param {google.cloud.gaming.v1.IGkeClusterReference=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.GkeClusterReference} GkeClusterReference instance + */ + GkeClusterReference.create = function create(properties) { + return new GkeClusterReference(properties); + }; + + /** + * Encodes the specified GkeClusterReference message. Does not implicitly {@link google.cloud.gaming.v1.GkeClusterReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.GkeClusterReference + * @static + * @param {google.cloud.gaming.v1.IGkeClusterReference} message GkeClusterReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GkeClusterReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cluster); + return writer; + }; + + /** + * Encodes the specified GkeClusterReference message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GkeClusterReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.GkeClusterReference + * @static + * @param {google.cloud.gaming.v1.IGkeClusterReference} message GkeClusterReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GkeClusterReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GkeClusterReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.GkeClusterReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.GkeClusterReference} GkeClusterReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GkeClusterReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.GkeClusterReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cluster = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GkeClusterReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.GkeClusterReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.GkeClusterReference} GkeClusterReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GkeClusterReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GkeClusterReference message. + * @function verify + * @memberof google.cloud.gaming.v1.GkeClusterReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GkeClusterReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) + if (!$util.isString(message.cluster)) + return "cluster: string expected"; + return null; + }; + + /** + * Creates a GkeClusterReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.GkeClusterReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.GkeClusterReference} GkeClusterReference + */ + GkeClusterReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.GkeClusterReference) + return object; + var message = new $root.google.cloud.gaming.v1.GkeClusterReference(); + if (object.cluster != null) + message.cluster = String(object.cluster); + return message; + }; + + /** + * Creates a plain object from a GkeClusterReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.GkeClusterReference + * @static + * @param {google.cloud.gaming.v1.GkeClusterReference} message GkeClusterReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GkeClusterReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cluster = ""; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = message.cluster; + return object; + }; + + /** + * Converts this GkeClusterReference to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.GkeClusterReference + * @instance + * @returns {Object.} JSON object + */ + GkeClusterReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GkeClusterReference + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.GkeClusterReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GkeClusterReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.GkeClusterReference"; + }; + + return GkeClusterReference; + })(); + + v1.GameServerCluster = (function() { + + /** + * Properties of a GameServerCluster. + * @memberof google.cloud.gaming.v1 + * @interface IGameServerCluster + * @property {string|null} [name] GameServerCluster name + * @property {google.protobuf.ITimestamp|null} [createTime] GameServerCluster createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] GameServerCluster updateTime + * @property {Object.|null} [labels] GameServerCluster labels + * @property {google.cloud.gaming.v1.IGameServerClusterConnectionInfo|null} [connectionInfo] GameServerCluster connectionInfo + * @property {string|null} [etag] GameServerCluster etag + * @property {string|null} [description] GameServerCluster description + * @property {google.cloud.gaming.v1.IKubernetesClusterState|null} [clusterState] GameServerCluster clusterState + */ + + /** + * Constructs a new GameServerCluster. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a GameServerCluster. + * @implements IGameServerCluster + * @constructor + * @param {google.cloud.gaming.v1.IGameServerCluster=} [properties] Properties to set + */ + function GameServerCluster(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]]; + } + + /** + * GameServerCluster name. + * @member {string} name + * @memberof google.cloud.gaming.v1.GameServerCluster + * @instance + */ + GameServerCluster.prototype.name = ""; + + /** + * GameServerCluster createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.gaming.v1.GameServerCluster + * @instance + */ + GameServerCluster.prototype.createTime = null; + + /** + * GameServerCluster updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.gaming.v1.GameServerCluster + * @instance + */ + GameServerCluster.prototype.updateTime = null; + + /** + * GameServerCluster labels. + * @member {Object.} labels + * @memberof google.cloud.gaming.v1.GameServerCluster + * @instance + */ + GameServerCluster.prototype.labels = $util.emptyObject; + + /** + * GameServerCluster connectionInfo. + * @member {google.cloud.gaming.v1.IGameServerClusterConnectionInfo|null|undefined} connectionInfo + * @memberof google.cloud.gaming.v1.GameServerCluster + * @instance + */ + GameServerCluster.prototype.connectionInfo = null; + + /** + * GameServerCluster etag. + * @member {string} etag + * @memberof google.cloud.gaming.v1.GameServerCluster + * @instance + */ + GameServerCluster.prototype.etag = ""; + + /** + * GameServerCluster description. + * @member {string} description + * @memberof google.cloud.gaming.v1.GameServerCluster + * @instance + */ + GameServerCluster.prototype.description = ""; + + /** + * GameServerCluster clusterState. + * @member {google.cloud.gaming.v1.IKubernetesClusterState|null|undefined} clusterState + * @memberof google.cloud.gaming.v1.GameServerCluster + * @instance + */ + GameServerCluster.prototype.clusterState = null; + + /** + * Creates a new GameServerCluster instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.GameServerCluster + * @static + * @param {google.cloud.gaming.v1.IGameServerCluster=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.GameServerCluster} GameServerCluster instance + */ + GameServerCluster.create = function create(properties) { + return new GameServerCluster(properties); + }; + + /** + * Encodes the specified GameServerCluster message. Does not implicitly {@link google.cloud.gaming.v1.GameServerCluster.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.GameServerCluster + * @static + * @param {google.cloud.gaming.v1.IGameServerCluster} message GameServerCluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerCluster.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.connectionInfo != null && Object.hasOwnProperty.call(message, "connectionInfo")) + $root.google.cloud.gaming.v1.GameServerClusterConnectionInfo.encode(message.connectionInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); + if (message.clusterState != null && Object.hasOwnProperty.call(message, "clusterState")) + $root.google.cloud.gaming.v1.KubernetesClusterState.encode(message.clusterState, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GameServerCluster message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GameServerCluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.GameServerCluster + * @static + * @param {google.cloud.gaming.v1.IGameServerCluster} message GameServerCluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerCluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GameServerCluster message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.GameServerCluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.GameServerCluster} GameServerCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerCluster.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.GameServerCluster(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + message.connectionInfo = $root.google.cloud.gaming.v1.GameServerClusterConnectionInfo.decode(reader, reader.uint32()); + break; + } + case 6: { + message.etag = reader.string(); + break; + } + case 7: { + message.description = reader.string(); + break; + } + case 11: { + message.clusterState = $root.google.cloud.gaming.v1.KubernetesClusterState.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GameServerCluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.GameServerCluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.GameServerCluster} GameServerCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerCluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GameServerCluster message. + * @function verify + * @memberof google.cloud.gaming.v1.GameServerCluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GameServerCluster.verify = function verify(message) { + if (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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.connectionInfo != null && message.hasOwnProperty("connectionInfo")) { + var error = $root.google.cloud.gaming.v1.GameServerClusterConnectionInfo.verify(message.connectionInfo); + if (error) + return "connectionInfo." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.clusterState != null && message.hasOwnProperty("clusterState")) { + var error = $root.google.cloud.gaming.v1.KubernetesClusterState.verify(message.clusterState); + if (error) + return "clusterState." + error; + } + return null; + }; + + /** + * Creates a GameServerCluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.GameServerCluster + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.GameServerCluster} GameServerCluster + */ + GameServerCluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.GameServerCluster) + return object; + var message = new $root.google.cloud.gaming.v1.GameServerCluster(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.gaming.v1.GameServerCluster.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.gaming.v1.GameServerCluster.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.gaming.v1.GameServerCluster.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.connectionInfo != null) { + if (typeof object.connectionInfo !== "object") + throw TypeError(".google.cloud.gaming.v1.GameServerCluster.connectionInfo: object expected"); + message.connectionInfo = $root.google.cloud.gaming.v1.GameServerClusterConnectionInfo.fromObject(object.connectionInfo); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.description != null) + message.description = String(object.description); + if (object.clusterState != null) { + if (typeof object.clusterState !== "object") + throw TypeError(".google.cloud.gaming.v1.GameServerCluster.clusterState: object expected"); + message.clusterState = $root.google.cloud.gaming.v1.KubernetesClusterState.fromObject(object.clusterState); + } + return message; + }; + + /** + * Creates a plain object from a GameServerCluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.GameServerCluster + * @static + * @param {google.cloud.gaming.v1.GameServerCluster} message GameServerCluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GameServerCluster.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.connectionInfo = null; + object.etag = ""; + object.description = ""; + object.clusterState = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.connectionInfo != null && message.hasOwnProperty("connectionInfo")) + object.connectionInfo = $root.google.cloud.gaming.v1.GameServerClusterConnectionInfo.toObject(message.connectionInfo, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.clusterState != null && message.hasOwnProperty("clusterState")) + object.clusterState = $root.google.cloud.gaming.v1.KubernetesClusterState.toObject(message.clusterState, options); + return object; + }; + + /** + * Converts this GameServerCluster to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.GameServerCluster + * @instance + * @returns {Object.} JSON object + */ + GameServerCluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GameServerCluster + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.GameServerCluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GameServerCluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.GameServerCluster"; + }; + + return GameServerCluster; + })(); + + v1.KubernetesClusterState = (function() { + + /** + * Properties of a KubernetesClusterState. + * @memberof google.cloud.gaming.v1 + * @interface IKubernetesClusterState + * @property {string|null} [agonesVersionInstalled] KubernetesClusterState agonesVersionInstalled + * @property {string|null} [kubernetesVersionInstalled] KubernetesClusterState kubernetesVersionInstalled + * @property {google.cloud.gaming.v1.KubernetesClusterState.InstallationState|null} [installationState] KubernetesClusterState installationState + * @property {string|null} [versionInstalledErrorMessage] KubernetesClusterState versionInstalledErrorMessage + * @property {string|null} [provider] KubernetesClusterState provider + * @property {string|null} [agonesVersionTargeted] KubernetesClusterState agonesVersionTargeted + */ + + /** + * Constructs a new KubernetesClusterState. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a KubernetesClusterState. + * @implements IKubernetesClusterState + * @constructor + * @param {google.cloud.gaming.v1.IKubernetesClusterState=} [properties] Properties to set + */ + function KubernetesClusterState(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KubernetesClusterState agonesVersionInstalled. + * @member {string} agonesVersionInstalled + * @memberof google.cloud.gaming.v1.KubernetesClusterState + * @instance + */ + KubernetesClusterState.prototype.agonesVersionInstalled = ""; + + /** + * KubernetesClusterState kubernetesVersionInstalled. + * @member {string} kubernetesVersionInstalled + * @memberof google.cloud.gaming.v1.KubernetesClusterState + * @instance + */ + KubernetesClusterState.prototype.kubernetesVersionInstalled = ""; + + /** + * KubernetesClusterState installationState. + * @member {google.cloud.gaming.v1.KubernetesClusterState.InstallationState} installationState + * @memberof google.cloud.gaming.v1.KubernetesClusterState + * @instance + */ + KubernetesClusterState.prototype.installationState = 0; + + /** + * KubernetesClusterState versionInstalledErrorMessage. + * @member {string} versionInstalledErrorMessage + * @memberof google.cloud.gaming.v1.KubernetesClusterState + * @instance + */ + KubernetesClusterState.prototype.versionInstalledErrorMessage = ""; + + /** + * KubernetesClusterState provider. + * @member {string} provider + * @memberof google.cloud.gaming.v1.KubernetesClusterState + * @instance + */ + KubernetesClusterState.prototype.provider = ""; + + /** + * KubernetesClusterState agonesVersionTargeted. + * @member {string} agonesVersionTargeted + * @memberof google.cloud.gaming.v1.KubernetesClusterState + * @instance + */ + KubernetesClusterState.prototype.agonesVersionTargeted = ""; + + /** + * Creates a new KubernetesClusterState instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.KubernetesClusterState + * @static + * @param {google.cloud.gaming.v1.IKubernetesClusterState=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.KubernetesClusterState} KubernetesClusterState instance + */ + KubernetesClusterState.create = function create(properties) { + return new KubernetesClusterState(properties); + }; + + /** + * Encodes the specified KubernetesClusterState message. Does not implicitly {@link google.cloud.gaming.v1.KubernetesClusterState.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.KubernetesClusterState + * @static + * @param {google.cloud.gaming.v1.IKubernetesClusterState} message KubernetesClusterState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KubernetesClusterState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agonesVersionInstalled != null && Object.hasOwnProperty.call(message, "agonesVersionInstalled")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.agonesVersionInstalled); + if (message.kubernetesVersionInstalled != null && Object.hasOwnProperty.call(message, "kubernetesVersionInstalled")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.kubernetesVersionInstalled); + if (message.installationState != null && Object.hasOwnProperty.call(message, "installationState")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.installationState); + if (message.versionInstalledErrorMessage != null && Object.hasOwnProperty.call(message, "versionInstalledErrorMessage")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.versionInstalledErrorMessage); + if (message.provider != null && Object.hasOwnProperty.call(message, "provider")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.provider); + if (message.agonesVersionTargeted != null && Object.hasOwnProperty.call(message, "agonesVersionTargeted")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.agonesVersionTargeted); + return writer; + }; + + /** + * Encodes the specified KubernetesClusterState message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.KubernetesClusterState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.KubernetesClusterState + * @static + * @param {google.cloud.gaming.v1.IKubernetesClusterState} message KubernetesClusterState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KubernetesClusterState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KubernetesClusterState message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.KubernetesClusterState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.KubernetesClusterState} KubernetesClusterState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KubernetesClusterState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.KubernetesClusterState(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.agonesVersionInstalled = reader.string(); + break; + } + case 2: { + message.kubernetesVersionInstalled = reader.string(); + break; + } + case 3: { + message.installationState = reader.int32(); + break; + } + case 4: { + message.versionInstalledErrorMessage = reader.string(); + break; + } + case 5: { + message.provider = reader.string(); + break; + } + case 6: { + message.agonesVersionTargeted = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KubernetesClusterState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.KubernetesClusterState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.KubernetesClusterState} KubernetesClusterState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KubernetesClusterState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KubernetesClusterState message. + * @function verify + * @memberof google.cloud.gaming.v1.KubernetesClusterState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KubernetesClusterState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.agonesVersionInstalled != null && message.hasOwnProperty("agonesVersionInstalled")) + if (!$util.isString(message.agonesVersionInstalled)) + return "agonesVersionInstalled: string expected"; + if (message.kubernetesVersionInstalled != null && message.hasOwnProperty("kubernetesVersionInstalled")) + if (!$util.isString(message.kubernetesVersionInstalled)) + return "kubernetesVersionInstalled: string expected"; + if (message.installationState != null && message.hasOwnProperty("installationState")) + switch (message.installationState) { + default: + return "installationState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.versionInstalledErrorMessage != null && message.hasOwnProperty("versionInstalledErrorMessage")) + if (!$util.isString(message.versionInstalledErrorMessage)) + return "versionInstalledErrorMessage: string expected"; + if (message.provider != null && message.hasOwnProperty("provider")) + if (!$util.isString(message.provider)) + return "provider: string expected"; + if (message.agonesVersionTargeted != null && message.hasOwnProperty("agonesVersionTargeted")) + if (!$util.isString(message.agonesVersionTargeted)) + return "agonesVersionTargeted: string expected"; + return null; + }; + + /** + * Creates a KubernetesClusterState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.KubernetesClusterState + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.KubernetesClusterState} KubernetesClusterState + */ + KubernetesClusterState.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.KubernetesClusterState) + return object; + var message = new $root.google.cloud.gaming.v1.KubernetesClusterState(); + if (object.agonesVersionInstalled != null) + message.agonesVersionInstalled = String(object.agonesVersionInstalled); + if (object.kubernetesVersionInstalled != null) + message.kubernetesVersionInstalled = String(object.kubernetesVersionInstalled); + switch (object.installationState) { + default: + if (typeof object.installationState === "number") { + message.installationState = object.installationState; + break; + } + break; + case "INSTALLATION_STATE_UNSPECIFIED": + case 0: + message.installationState = 0; + break; + case "AGONES_KUBERNETES_VERSION_SUPPORTED": + case 1: + message.installationState = 1; + break; + case "AGONES_VERSION_UNSUPPORTED": + case 2: + message.installationState = 2; + break; + case "AGONES_KUBERNETES_VERSION_UNSUPPORTED": + case 3: + message.installationState = 3; + break; + case "AGONES_VERSION_UNRECOGNIZED": + case 4: + message.installationState = 4; + break; + case "KUBERNETES_VERSION_UNRECOGNIZED": + case 5: + message.installationState = 5; + break; + case "VERSION_VERIFICATION_FAILED": + case 6: + message.installationState = 6; + break; + case "AGONES_NOT_INSTALLED": + case 7: + message.installationState = 7; + break; + } + if (object.versionInstalledErrorMessage != null) + message.versionInstalledErrorMessage = String(object.versionInstalledErrorMessage); + if (object.provider != null) + message.provider = String(object.provider); + if (object.agonesVersionTargeted != null) + message.agonesVersionTargeted = String(object.agonesVersionTargeted); + return message; + }; + + /** + * Creates a plain object from a KubernetesClusterState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.KubernetesClusterState + * @static + * @param {google.cloud.gaming.v1.KubernetesClusterState} message KubernetesClusterState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KubernetesClusterState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.agonesVersionInstalled = ""; + object.kubernetesVersionInstalled = ""; + object.installationState = options.enums === String ? "INSTALLATION_STATE_UNSPECIFIED" : 0; + object.versionInstalledErrorMessage = ""; + object.provider = ""; + object.agonesVersionTargeted = ""; + } + if (message.agonesVersionInstalled != null && message.hasOwnProperty("agonesVersionInstalled")) + object.agonesVersionInstalled = message.agonesVersionInstalled; + if (message.kubernetesVersionInstalled != null && message.hasOwnProperty("kubernetesVersionInstalled")) + object.kubernetesVersionInstalled = message.kubernetesVersionInstalled; + if (message.installationState != null && message.hasOwnProperty("installationState")) + object.installationState = options.enums === String ? $root.google.cloud.gaming.v1.KubernetesClusterState.InstallationState[message.installationState] === undefined ? message.installationState : $root.google.cloud.gaming.v1.KubernetesClusterState.InstallationState[message.installationState] : message.installationState; + if (message.versionInstalledErrorMessage != null && message.hasOwnProperty("versionInstalledErrorMessage")) + object.versionInstalledErrorMessage = message.versionInstalledErrorMessage; + if (message.provider != null && message.hasOwnProperty("provider")) + object.provider = message.provider; + if (message.agonesVersionTargeted != null && message.hasOwnProperty("agonesVersionTargeted")) + object.agonesVersionTargeted = message.agonesVersionTargeted; + return object; + }; + + /** + * Converts this KubernetesClusterState to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.KubernetesClusterState + * @instance + * @returns {Object.} JSON object + */ + KubernetesClusterState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for KubernetesClusterState + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.KubernetesClusterState + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + KubernetesClusterState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.KubernetesClusterState"; + }; + + /** + * InstallationState enum. + * @name google.cloud.gaming.v1.KubernetesClusterState.InstallationState + * @enum {number} + * @property {number} INSTALLATION_STATE_UNSPECIFIED=0 INSTALLATION_STATE_UNSPECIFIED value + * @property {number} AGONES_KUBERNETES_VERSION_SUPPORTED=1 AGONES_KUBERNETES_VERSION_SUPPORTED value + * @property {number} AGONES_VERSION_UNSUPPORTED=2 AGONES_VERSION_UNSUPPORTED value + * @property {number} AGONES_KUBERNETES_VERSION_UNSUPPORTED=3 AGONES_KUBERNETES_VERSION_UNSUPPORTED value + * @property {number} AGONES_VERSION_UNRECOGNIZED=4 AGONES_VERSION_UNRECOGNIZED value + * @property {number} KUBERNETES_VERSION_UNRECOGNIZED=5 KUBERNETES_VERSION_UNRECOGNIZED value + * @property {number} VERSION_VERIFICATION_FAILED=6 VERSION_VERIFICATION_FAILED value + * @property {number} AGONES_NOT_INSTALLED=7 AGONES_NOT_INSTALLED value + */ + KubernetesClusterState.InstallationState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTALLATION_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AGONES_KUBERNETES_VERSION_SUPPORTED"] = 1; + values[valuesById[2] = "AGONES_VERSION_UNSUPPORTED"] = 2; + values[valuesById[3] = "AGONES_KUBERNETES_VERSION_UNSUPPORTED"] = 3; + values[valuesById[4] = "AGONES_VERSION_UNRECOGNIZED"] = 4; + values[valuesById[5] = "KUBERNETES_VERSION_UNRECOGNIZED"] = 5; + values[valuesById[6] = "VERSION_VERIFICATION_FAILED"] = 6; + values[valuesById[7] = "AGONES_NOT_INSTALLED"] = 7; + return values; + })(); + + return KubernetesClusterState; + })(); + + v1.GameServerClustersService = (function() { + + /** + * Constructs a new GameServerClustersService service. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a GameServerClustersService + * @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 GameServerClustersService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (GameServerClustersService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GameServerClustersService; + + /** + * Creates new GameServerClustersService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @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 {GameServerClustersService} RPC service. Useful where requests and/or responses are streamed. + */ + GameServerClustersService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|listGameServerClusters}. + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @typedef ListGameServerClustersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1.ListGameServerClustersResponse} [response] ListGameServerClustersResponse + */ + + /** + * Calls ListGameServerClusters. + * @function listGameServerClusters + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1.IListGameServerClustersRequest} request ListGameServerClustersRequest message or plain object + * @param {google.cloud.gaming.v1.GameServerClustersService.ListGameServerClustersCallback} callback Node-style callback called with the error, if any, and ListGameServerClustersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerClustersService.prototype.listGameServerClusters = function listGameServerClusters(request, callback) { + return this.rpcCall(listGameServerClusters, $root.google.cloud.gaming.v1.ListGameServerClustersRequest, $root.google.cloud.gaming.v1.ListGameServerClustersResponse, request, callback); + }, "name", { value: "ListGameServerClusters" }); + + /** + * Calls ListGameServerClusters. + * @function listGameServerClusters + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1.IListGameServerClustersRequest} request ListGameServerClustersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|getGameServerCluster}. + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @typedef GetGameServerClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1.GameServerCluster} [response] GameServerCluster + */ + + /** + * Calls GetGameServerCluster. + * @function getGameServerCluster + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1.IGetGameServerClusterRequest} request GetGameServerClusterRequest message or plain object + * @param {google.cloud.gaming.v1.GameServerClustersService.GetGameServerClusterCallback} callback Node-style callback called with the error, if any, and GameServerCluster + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerClustersService.prototype.getGameServerCluster = function getGameServerCluster(request, callback) { + return this.rpcCall(getGameServerCluster, $root.google.cloud.gaming.v1.GetGameServerClusterRequest, $root.google.cloud.gaming.v1.GameServerCluster, request, callback); + }, "name", { value: "GetGameServerCluster" }); + + /** + * Calls GetGameServerCluster. + * @function getGameServerCluster + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1.IGetGameServerClusterRequest} request GetGameServerClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|createGameServerCluster}. + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @typedef CreateGameServerClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateGameServerCluster. + * @function createGameServerCluster + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1.ICreateGameServerClusterRequest} request CreateGameServerClusterRequest message or plain object + * @param {google.cloud.gaming.v1.GameServerClustersService.CreateGameServerClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerClustersService.prototype.createGameServerCluster = function createGameServerCluster(request, callback) { + return this.rpcCall(createGameServerCluster, $root.google.cloud.gaming.v1.CreateGameServerClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateGameServerCluster" }); + + /** + * Calls CreateGameServerCluster. + * @function createGameServerCluster + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1.ICreateGameServerClusterRequest} request CreateGameServerClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|previewCreateGameServerCluster}. + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @typedef PreviewCreateGameServerClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse} [response] PreviewCreateGameServerClusterResponse + */ + + /** + * Calls PreviewCreateGameServerCluster. + * @function previewCreateGameServerCluster + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest} request PreviewCreateGameServerClusterRequest message or plain object + * @param {google.cloud.gaming.v1.GameServerClustersService.PreviewCreateGameServerClusterCallback} callback Node-style callback called with the error, if any, and PreviewCreateGameServerClusterResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerClustersService.prototype.previewCreateGameServerCluster = function previewCreateGameServerCluster(request, callback) { + return this.rpcCall(previewCreateGameServerCluster, $root.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest, $root.google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse, request, callback); + }, "name", { value: "PreviewCreateGameServerCluster" }); + + /** + * Calls PreviewCreateGameServerCluster. + * @function previewCreateGameServerCluster + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest} request PreviewCreateGameServerClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|deleteGameServerCluster}. + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @typedef DeleteGameServerClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteGameServerCluster. + * @function deleteGameServerCluster + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1.IDeleteGameServerClusterRequest} request DeleteGameServerClusterRequest message or plain object + * @param {google.cloud.gaming.v1.GameServerClustersService.DeleteGameServerClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerClustersService.prototype.deleteGameServerCluster = function deleteGameServerCluster(request, callback) { + return this.rpcCall(deleteGameServerCluster, $root.google.cloud.gaming.v1.DeleteGameServerClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteGameServerCluster" }); + + /** + * Calls DeleteGameServerCluster. + * @function deleteGameServerCluster + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1.IDeleteGameServerClusterRequest} request DeleteGameServerClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|previewDeleteGameServerCluster}. + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @typedef PreviewDeleteGameServerClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse} [response] PreviewDeleteGameServerClusterResponse + */ + + /** + * Calls PreviewDeleteGameServerCluster. + * @function previewDeleteGameServerCluster + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest} request PreviewDeleteGameServerClusterRequest message or plain object + * @param {google.cloud.gaming.v1.GameServerClustersService.PreviewDeleteGameServerClusterCallback} callback Node-style callback called with the error, if any, and PreviewDeleteGameServerClusterResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerClustersService.prototype.previewDeleteGameServerCluster = function previewDeleteGameServerCluster(request, callback) { + return this.rpcCall(previewDeleteGameServerCluster, $root.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest, $root.google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse, request, callback); + }, "name", { value: "PreviewDeleteGameServerCluster" }); + + /** + * Calls PreviewDeleteGameServerCluster. + * @function previewDeleteGameServerCluster + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest} request PreviewDeleteGameServerClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|updateGameServerCluster}. + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @typedef UpdateGameServerClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateGameServerCluster. + * @function updateGameServerCluster + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1.IUpdateGameServerClusterRequest} request UpdateGameServerClusterRequest message or plain object + * @param {google.cloud.gaming.v1.GameServerClustersService.UpdateGameServerClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerClustersService.prototype.updateGameServerCluster = function updateGameServerCluster(request, callback) { + return this.rpcCall(updateGameServerCluster, $root.google.cloud.gaming.v1.UpdateGameServerClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateGameServerCluster" }); + + /** + * Calls UpdateGameServerCluster. + * @function updateGameServerCluster + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1.IUpdateGameServerClusterRequest} request UpdateGameServerClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|previewUpdateGameServerCluster}. + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @typedef PreviewUpdateGameServerClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse} [response] PreviewUpdateGameServerClusterResponse + */ + + /** + * Calls PreviewUpdateGameServerCluster. + * @function previewUpdateGameServerCluster + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest} request PreviewUpdateGameServerClusterRequest message or plain object + * @param {google.cloud.gaming.v1.GameServerClustersService.PreviewUpdateGameServerClusterCallback} callback Node-style callback called with the error, if any, and PreviewUpdateGameServerClusterResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerClustersService.prototype.previewUpdateGameServerCluster = function previewUpdateGameServerCluster(request, callback) { + return this.rpcCall(previewUpdateGameServerCluster, $root.google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest, $root.google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse, request, callback); + }, "name", { value: "PreviewUpdateGameServerCluster" }); + + /** + * Calls PreviewUpdateGameServerCluster. + * @function previewUpdateGameServerCluster + * @memberof google.cloud.gaming.v1.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest} request PreviewUpdateGameServerClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return GameServerClustersService; + })(); + + v1.ListGameServerConfigsRequest = (function() { + + /** + * Properties of a ListGameServerConfigsRequest. + * @memberof google.cloud.gaming.v1 + * @interface IListGameServerConfigsRequest + * @property {string|null} [parent] ListGameServerConfigsRequest parent + * @property {number|null} [pageSize] ListGameServerConfigsRequest pageSize + * @property {string|null} [pageToken] ListGameServerConfigsRequest pageToken + * @property {string|null} [filter] ListGameServerConfigsRequest filter + * @property {string|null} [orderBy] ListGameServerConfigsRequest orderBy + */ + + /** + * Constructs a new ListGameServerConfigsRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a ListGameServerConfigsRequest. + * @implements IListGameServerConfigsRequest + * @constructor + * @param {google.cloud.gaming.v1.IListGameServerConfigsRequest=} [properties] Properties to set + */ + function ListGameServerConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGameServerConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.gaming.v1.ListGameServerConfigsRequest + * @instance + */ + ListGameServerConfigsRequest.prototype.parent = ""; + + /** + * ListGameServerConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.gaming.v1.ListGameServerConfigsRequest + * @instance + */ + ListGameServerConfigsRequest.prototype.pageSize = 0; + + /** + * ListGameServerConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.gaming.v1.ListGameServerConfigsRequest + * @instance + */ + ListGameServerConfigsRequest.prototype.pageToken = ""; + + /** + * ListGameServerConfigsRequest filter. + * @member {string} filter + * @memberof google.cloud.gaming.v1.ListGameServerConfigsRequest + * @instance + */ + ListGameServerConfigsRequest.prototype.filter = ""; + + /** + * ListGameServerConfigsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.gaming.v1.ListGameServerConfigsRequest + * @instance + */ + ListGameServerConfigsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListGameServerConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.ListGameServerConfigsRequest + * @static + * @param {google.cloud.gaming.v1.IListGameServerConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.ListGameServerConfigsRequest} ListGameServerConfigsRequest instance + */ + ListGameServerConfigsRequest.create = function create(properties) { + return new ListGameServerConfigsRequest(properties); + }; + + /** + * Encodes the specified ListGameServerConfigsRequest message. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.ListGameServerConfigsRequest + * @static + * @param {google.cloud.gaming.v1.IListGameServerConfigsRequest} message ListGameServerConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerConfigsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListGameServerConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.ListGameServerConfigsRequest + * @static + * @param {google.cloud.gaming.v1.IListGameServerConfigsRequest} message ListGameServerConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGameServerConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.ListGameServerConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.ListGameServerConfigsRequest} ListGameServerConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerConfigsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.ListGameServerConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGameServerConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.ListGameServerConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.ListGameServerConfigsRequest} ListGameServerConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGameServerConfigsRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.ListGameServerConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGameServerConfigsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListGameServerConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.ListGameServerConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.ListGameServerConfigsRequest} ListGameServerConfigsRequest + */ + ListGameServerConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.ListGameServerConfigsRequest) + return object; + var message = new $root.google.cloud.gaming.v1.ListGameServerConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListGameServerConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.ListGameServerConfigsRequest + * @static + * @param {google.cloud.gaming.v1.ListGameServerConfigsRequest} message ListGameServerConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGameServerConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListGameServerConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.ListGameServerConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListGameServerConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGameServerConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.ListGameServerConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGameServerConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.ListGameServerConfigsRequest"; + }; + + return ListGameServerConfigsRequest; + })(); + + v1.ListGameServerConfigsResponse = (function() { + + /** + * Properties of a ListGameServerConfigsResponse. + * @memberof google.cloud.gaming.v1 + * @interface IListGameServerConfigsResponse + * @property {Array.|null} [gameServerConfigs] ListGameServerConfigsResponse gameServerConfigs + * @property {string|null} [nextPageToken] ListGameServerConfigsResponse nextPageToken + * @property {Array.|null} [unreachable] ListGameServerConfigsResponse unreachable + */ + + /** + * Constructs a new ListGameServerConfigsResponse. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a ListGameServerConfigsResponse. + * @implements IListGameServerConfigsResponse + * @constructor + * @param {google.cloud.gaming.v1.IListGameServerConfigsResponse=} [properties] Properties to set + */ + function ListGameServerConfigsResponse(properties) { + this.gameServerConfigs = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGameServerConfigsResponse gameServerConfigs. + * @member {Array.} gameServerConfigs + * @memberof google.cloud.gaming.v1.ListGameServerConfigsResponse + * @instance + */ + ListGameServerConfigsResponse.prototype.gameServerConfigs = $util.emptyArray; + + /** + * ListGameServerConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.gaming.v1.ListGameServerConfigsResponse + * @instance + */ + ListGameServerConfigsResponse.prototype.nextPageToken = ""; + + /** + * ListGameServerConfigsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.gaming.v1.ListGameServerConfigsResponse + * @instance + */ + ListGameServerConfigsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListGameServerConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.ListGameServerConfigsResponse + * @static + * @param {google.cloud.gaming.v1.IListGameServerConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.ListGameServerConfigsResponse} ListGameServerConfigsResponse instance + */ + ListGameServerConfigsResponse.create = function create(properties) { + return new ListGameServerConfigsResponse(properties); + }; + + /** + * Encodes the specified ListGameServerConfigsResponse message. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.ListGameServerConfigsResponse + * @static + * @param {google.cloud.gaming.v1.IListGameServerConfigsResponse} message ListGameServerConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gameServerConfigs != null && message.gameServerConfigs.length) + for (var i = 0; i < message.gameServerConfigs.length; ++i) + $root.google.cloud.gaming.v1.GameServerConfig.encode(message.gameServerConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListGameServerConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.ListGameServerConfigsResponse + * @static + * @param {google.cloud.gaming.v1.IListGameServerConfigsResponse} message ListGameServerConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGameServerConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.ListGameServerConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.ListGameServerConfigsResponse} ListGameServerConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerConfigsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.ListGameServerConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.gameServerConfigs && message.gameServerConfigs.length)) + message.gameServerConfigs = []; + message.gameServerConfigs.push($root.google.cloud.gaming.v1.GameServerConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGameServerConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.ListGameServerConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.ListGameServerConfigsResponse} ListGameServerConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGameServerConfigsResponse message. + * @function verify + * @memberof google.cloud.gaming.v1.ListGameServerConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGameServerConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gameServerConfigs != null && message.hasOwnProperty("gameServerConfigs")) { + if (!Array.isArray(message.gameServerConfigs)) + return "gameServerConfigs: array expected"; + for (var i = 0; i < message.gameServerConfigs.length; ++i) { + var error = $root.google.cloud.gaming.v1.GameServerConfig.verify(message.gameServerConfigs[i]); + if (error) + return "gameServerConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListGameServerConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.ListGameServerConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.ListGameServerConfigsResponse} ListGameServerConfigsResponse + */ + ListGameServerConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.ListGameServerConfigsResponse) + return object; + var message = new $root.google.cloud.gaming.v1.ListGameServerConfigsResponse(); + if (object.gameServerConfigs) { + if (!Array.isArray(object.gameServerConfigs)) + throw TypeError(".google.cloud.gaming.v1.ListGameServerConfigsResponse.gameServerConfigs: array expected"); + message.gameServerConfigs = []; + for (var i = 0; i < object.gameServerConfigs.length; ++i) { + if (typeof object.gameServerConfigs[i] !== "object") + throw TypeError(".google.cloud.gaming.v1.ListGameServerConfigsResponse.gameServerConfigs: object expected"); + message.gameServerConfigs[i] = $root.google.cloud.gaming.v1.GameServerConfig.fromObject(object.gameServerConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.gaming.v1.ListGameServerConfigsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListGameServerConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.ListGameServerConfigsResponse + * @static + * @param {google.cloud.gaming.v1.ListGameServerConfigsResponse} message ListGameServerConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGameServerConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.gameServerConfigs = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.gameServerConfigs && message.gameServerConfigs.length) { + object.gameServerConfigs = []; + for (var j = 0; j < message.gameServerConfigs.length; ++j) + object.gameServerConfigs[j] = $root.google.cloud.gaming.v1.GameServerConfig.toObject(message.gameServerConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListGameServerConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.ListGameServerConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListGameServerConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGameServerConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.ListGameServerConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGameServerConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.ListGameServerConfigsResponse"; + }; + + return ListGameServerConfigsResponse; + })(); + + v1.GetGameServerConfigRequest = (function() { + + /** + * Properties of a GetGameServerConfigRequest. + * @memberof google.cloud.gaming.v1 + * @interface IGetGameServerConfigRequest + * @property {string|null} [name] GetGameServerConfigRequest name + */ + + /** + * Constructs a new GetGameServerConfigRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a GetGameServerConfigRequest. + * @implements IGetGameServerConfigRequest + * @constructor + * @param {google.cloud.gaming.v1.IGetGameServerConfigRequest=} [properties] Properties to set + */ + function GetGameServerConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGameServerConfigRequest name. + * @member {string} name + * @memberof google.cloud.gaming.v1.GetGameServerConfigRequest + * @instance + */ + GetGameServerConfigRequest.prototype.name = ""; + + /** + * Creates a new GetGameServerConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.GetGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1.IGetGameServerConfigRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.GetGameServerConfigRequest} GetGameServerConfigRequest instance + */ + GetGameServerConfigRequest.create = function create(properties) { + return new GetGameServerConfigRequest(properties); + }; + + /** + * Encodes the specified GetGameServerConfigRequest message. Does not implicitly {@link google.cloud.gaming.v1.GetGameServerConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.GetGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1.IGetGameServerConfigRequest} message GetGameServerConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGameServerConfigRequest.encode = function encode(message, writer) { + 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 GetGameServerConfigRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GetGameServerConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.GetGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1.IGetGameServerConfigRequest} message GetGameServerConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGameServerConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGameServerConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.GetGameServerConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.GetGameServerConfigRequest} GetGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGameServerConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.GetGameServerConfigRequest(); + 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 GetGameServerConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.GetGameServerConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.GetGameServerConfigRequest} GetGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGameServerConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGameServerConfigRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.GetGameServerConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGameServerConfigRequest.verify = function verify(message) { + if (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 GetGameServerConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.GetGameServerConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.GetGameServerConfigRequest} GetGameServerConfigRequest + */ + GetGameServerConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.GetGameServerConfigRequest) + return object; + var message = new $root.google.cloud.gaming.v1.GetGameServerConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetGameServerConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.GetGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1.GetGameServerConfigRequest} message GetGameServerConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGameServerConfigRequest.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 GetGameServerConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.GetGameServerConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetGameServerConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGameServerConfigRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.GetGameServerConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGameServerConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.GetGameServerConfigRequest"; + }; + + return GetGameServerConfigRequest; + })(); + + v1.CreateGameServerConfigRequest = (function() { + + /** + * Properties of a CreateGameServerConfigRequest. + * @memberof google.cloud.gaming.v1 + * @interface ICreateGameServerConfigRequest + * @property {string|null} [parent] CreateGameServerConfigRequest parent + * @property {string|null} [configId] CreateGameServerConfigRequest configId + * @property {google.cloud.gaming.v1.IGameServerConfig|null} [gameServerConfig] CreateGameServerConfigRequest gameServerConfig + */ + + /** + * Constructs a new CreateGameServerConfigRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a CreateGameServerConfigRequest. + * @implements ICreateGameServerConfigRequest + * @constructor + * @param {google.cloud.gaming.v1.ICreateGameServerConfigRequest=} [properties] Properties to set + */ + function CreateGameServerConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateGameServerConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.gaming.v1.CreateGameServerConfigRequest + * @instance + */ + CreateGameServerConfigRequest.prototype.parent = ""; + + /** + * CreateGameServerConfigRequest configId. + * @member {string} configId + * @memberof google.cloud.gaming.v1.CreateGameServerConfigRequest + * @instance + */ + CreateGameServerConfigRequest.prototype.configId = ""; + + /** + * CreateGameServerConfigRequest gameServerConfig. + * @member {google.cloud.gaming.v1.IGameServerConfig|null|undefined} gameServerConfig + * @memberof google.cloud.gaming.v1.CreateGameServerConfigRequest + * @instance + */ + CreateGameServerConfigRequest.prototype.gameServerConfig = null; + + /** + * Creates a new CreateGameServerConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.CreateGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1.ICreateGameServerConfigRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.CreateGameServerConfigRequest} CreateGameServerConfigRequest instance + */ + CreateGameServerConfigRequest.create = function create(properties) { + return new CreateGameServerConfigRequest(properties); + }; + + /** + * Encodes the specified CreateGameServerConfigRequest message. Does not implicitly {@link google.cloud.gaming.v1.CreateGameServerConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.CreateGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1.ICreateGameServerConfigRequest} message CreateGameServerConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGameServerConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.configId != null && Object.hasOwnProperty.call(message, "configId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.configId); + if (message.gameServerConfig != null && Object.hasOwnProperty.call(message, "gameServerConfig")) + $root.google.cloud.gaming.v1.GameServerConfig.encode(message.gameServerConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateGameServerConfigRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.CreateGameServerConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.CreateGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1.ICreateGameServerConfigRequest} message CreateGameServerConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGameServerConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateGameServerConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.CreateGameServerConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.CreateGameServerConfigRequest} CreateGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGameServerConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.CreateGameServerConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.configId = reader.string(); + break; + } + case 3: { + message.gameServerConfig = $root.google.cloud.gaming.v1.GameServerConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateGameServerConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.CreateGameServerConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.CreateGameServerConfigRequest} CreateGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGameServerConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateGameServerConfigRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.CreateGameServerConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateGameServerConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.configId != null && message.hasOwnProperty("configId")) + if (!$util.isString(message.configId)) + return "configId: string expected"; + if (message.gameServerConfig != null && message.hasOwnProperty("gameServerConfig")) { + var error = $root.google.cloud.gaming.v1.GameServerConfig.verify(message.gameServerConfig); + if (error) + return "gameServerConfig." + error; + } + return null; + }; + + /** + * Creates a CreateGameServerConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.CreateGameServerConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.CreateGameServerConfigRequest} CreateGameServerConfigRequest + */ + CreateGameServerConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.CreateGameServerConfigRequest) + return object; + var message = new $root.google.cloud.gaming.v1.CreateGameServerConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.configId != null) + message.configId = String(object.configId); + if (object.gameServerConfig != null) { + if (typeof object.gameServerConfig !== "object") + throw TypeError(".google.cloud.gaming.v1.CreateGameServerConfigRequest.gameServerConfig: object expected"); + message.gameServerConfig = $root.google.cloud.gaming.v1.GameServerConfig.fromObject(object.gameServerConfig); + } + return message; + }; + + /** + * Creates a plain object from a CreateGameServerConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.CreateGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1.CreateGameServerConfigRequest} message CreateGameServerConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateGameServerConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.configId = ""; + object.gameServerConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.configId != null && message.hasOwnProperty("configId")) + object.configId = message.configId; + if (message.gameServerConfig != null && message.hasOwnProperty("gameServerConfig")) + object.gameServerConfig = $root.google.cloud.gaming.v1.GameServerConfig.toObject(message.gameServerConfig, options); + return object; + }; + + /** + * Converts this CreateGameServerConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.CreateGameServerConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateGameServerConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateGameServerConfigRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.CreateGameServerConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateGameServerConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.CreateGameServerConfigRequest"; + }; + + return CreateGameServerConfigRequest; + })(); + + v1.DeleteGameServerConfigRequest = (function() { + + /** + * Properties of a DeleteGameServerConfigRequest. + * @memberof google.cloud.gaming.v1 + * @interface IDeleteGameServerConfigRequest + * @property {string|null} [name] DeleteGameServerConfigRequest name + */ + + /** + * Constructs a new DeleteGameServerConfigRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a DeleteGameServerConfigRequest. + * @implements IDeleteGameServerConfigRequest + * @constructor + * @param {google.cloud.gaming.v1.IDeleteGameServerConfigRequest=} [properties] Properties to set + */ + function DeleteGameServerConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGameServerConfigRequest name. + * @member {string} name + * @memberof google.cloud.gaming.v1.DeleteGameServerConfigRequest + * @instance + */ + DeleteGameServerConfigRequest.prototype.name = ""; + + /** + * Creates a new DeleteGameServerConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.DeleteGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1.IDeleteGameServerConfigRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.DeleteGameServerConfigRequest} DeleteGameServerConfigRequest instance + */ + DeleteGameServerConfigRequest.create = function create(properties) { + return new DeleteGameServerConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteGameServerConfigRequest message. Does not implicitly {@link google.cloud.gaming.v1.DeleteGameServerConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.DeleteGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1.IDeleteGameServerConfigRequest} message DeleteGameServerConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGameServerConfigRequest.encode = function encode(message, writer) { + 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 DeleteGameServerConfigRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.DeleteGameServerConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.DeleteGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1.IDeleteGameServerConfigRequest} message DeleteGameServerConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGameServerConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGameServerConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.DeleteGameServerConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.DeleteGameServerConfigRequest} DeleteGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGameServerConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.DeleteGameServerConfigRequest(); + 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 DeleteGameServerConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.DeleteGameServerConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.DeleteGameServerConfigRequest} DeleteGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGameServerConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGameServerConfigRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.DeleteGameServerConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGameServerConfigRequest.verify = function verify(message) { + if (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 DeleteGameServerConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.DeleteGameServerConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.DeleteGameServerConfigRequest} DeleteGameServerConfigRequest + */ + DeleteGameServerConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.DeleteGameServerConfigRequest) + return object; + var message = new $root.google.cloud.gaming.v1.DeleteGameServerConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteGameServerConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.DeleteGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1.DeleteGameServerConfigRequest} message DeleteGameServerConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGameServerConfigRequest.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 DeleteGameServerConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.DeleteGameServerConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGameServerConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteGameServerConfigRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.DeleteGameServerConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteGameServerConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.DeleteGameServerConfigRequest"; + }; + + return DeleteGameServerConfigRequest; + })(); + + v1.ScalingConfig = (function() { + + /** + * Properties of a ScalingConfig. + * @memberof google.cloud.gaming.v1 + * @interface IScalingConfig + * @property {string|null} [name] ScalingConfig name + * @property {string|null} [fleetAutoscalerSpec] ScalingConfig fleetAutoscalerSpec + * @property {Array.|null} [selectors] ScalingConfig selectors + * @property {Array.|null} [schedules] ScalingConfig schedules + */ + + /** + * Constructs a new ScalingConfig. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a ScalingConfig. + * @implements IScalingConfig + * @constructor + * @param {google.cloud.gaming.v1.IScalingConfig=} [properties] Properties to set + */ + function ScalingConfig(properties) { + this.selectors = []; + this.schedules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScalingConfig name. + * @member {string} name + * @memberof google.cloud.gaming.v1.ScalingConfig + * @instance + */ + ScalingConfig.prototype.name = ""; + + /** + * ScalingConfig fleetAutoscalerSpec. + * @member {string} fleetAutoscalerSpec + * @memberof google.cloud.gaming.v1.ScalingConfig + * @instance + */ + ScalingConfig.prototype.fleetAutoscalerSpec = ""; + + /** + * ScalingConfig selectors. + * @member {Array.} selectors + * @memberof google.cloud.gaming.v1.ScalingConfig + * @instance + */ + ScalingConfig.prototype.selectors = $util.emptyArray; + + /** + * ScalingConfig schedules. + * @member {Array.} schedules + * @memberof google.cloud.gaming.v1.ScalingConfig + * @instance + */ + ScalingConfig.prototype.schedules = $util.emptyArray; + + /** + * Creates a new ScalingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.ScalingConfig + * @static + * @param {google.cloud.gaming.v1.IScalingConfig=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.ScalingConfig} ScalingConfig instance + */ + ScalingConfig.create = function create(properties) { + return new ScalingConfig(properties); + }; + + /** + * Encodes the specified ScalingConfig message. Does not implicitly {@link google.cloud.gaming.v1.ScalingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.ScalingConfig + * @static + * @param {google.cloud.gaming.v1.IScalingConfig} message ScalingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScalingConfig.encode = function encode(message, writer) { + 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.fleetAutoscalerSpec != null && Object.hasOwnProperty.call(message, "fleetAutoscalerSpec")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fleetAutoscalerSpec); + if (message.selectors != null && message.selectors.length) + for (var i = 0; i < message.selectors.length; ++i) + $root.google.cloud.gaming.v1.LabelSelector.encode(message.selectors[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.schedules != null && message.schedules.length) + for (var i = 0; i < message.schedules.length; ++i) + $root.google.cloud.gaming.v1.Schedule.encode(message.schedules[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ScalingConfig message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.ScalingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.ScalingConfig + * @static + * @param {google.cloud.gaming.v1.IScalingConfig} message ScalingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScalingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScalingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.ScalingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.ScalingConfig} ScalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScalingConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.ScalingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.fleetAutoscalerSpec = reader.string(); + break; + } + case 4: { + if (!(message.selectors && message.selectors.length)) + message.selectors = []; + message.selectors.push($root.google.cloud.gaming.v1.LabelSelector.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.schedules && message.schedules.length)) + message.schedules = []; + message.schedules.push($root.google.cloud.gaming.v1.Schedule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScalingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.ScalingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.ScalingConfig} ScalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScalingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScalingConfig message. + * @function verify + * @memberof google.cloud.gaming.v1.ScalingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScalingConfig.verify = function verify(message) { + if (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.fleetAutoscalerSpec != null && message.hasOwnProperty("fleetAutoscalerSpec")) + if (!$util.isString(message.fleetAutoscalerSpec)) + return "fleetAutoscalerSpec: string expected"; + if (message.selectors != null && message.hasOwnProperty("selectors")) { + if (!Array.isArray(message.selectors)) + return "selectors: array expected"; + for (var i = 0; i < message.selectors.length; ++i) { + var error = $root.google.cloud.gaming.v1.LabelSelector.verify(message.selectors[i]); + if (error) + return "selectors." + error; + } + } + if (message.schedules != null && message.hasOwnProperty("schedules")) { + if (!Array.isArray(message.schedules)) + return "schedules: array expected"; + for (var i = 0; i < message.schedules.length; ++i) { + var error = $root.google.cloud.gaming.v1.Schedule.verify(message.schedules[i]); + if (error) + return "schedules." + error; + } + } + return null; + }; + + /** + * Creates a ScalingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.ScalingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.ScalingConfig} ScalingConfig + */ + ScalingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.ScalingConfig) + return object; + var message = new $root.google.cloud.gaming.v1.ScalingConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.fleetAutoscalerSpec != null) + message.fleetAutoscalerSpec = String(object.fleetAutoscalerSpec); + if (object.selectors) { + if (!Array.isArray(object.selectors)) + throw TypeError(".google.cloud.gaming.v1.ScalingConfig.selectors: array expected"); + message.selectors = []; + for (var i = 0; i < object.selectors.length; ++i) { + if (typeof object.selectors[i] !== "object") + throw TypeError(".google.cloud.gaming.v1.ScalingConfig.selectors: object expected"); + message.selectors[i] = $root.google.cloud.gaming.v1.LabelSelector.fromObject(object.selectors[i]); + } + } + if (object.schedules) { + if (!Array.isArray(object.schedules)) + throw TypeError(".google.cloud.gaming.v1.ScalingConfig.schedules: array expected"); + message.schedules = []; + for (var i = 0; i < object.schedules.length; ++i) { + if (typeof object.schedules[i] !== "object") + throw TypeError(".google.cloud.gaming.v1.ScalingConfig.schedules: object expected"); + message.schedules[i] = $root.google.cloud.gaming.v1.Schedule.fromObject(object.schedules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ScalingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.ScalingConfig + * @static + * @param {google.cloud.gaming.v1.ScalingConfig} message ScalingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScalingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.selectors = []; + object.schedules = []; + } + if (options.defaults) { + object.name = ""; + object.fleetAutoscalerSpec = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.fleetAutoscalerSpec != null && message.hasOwnProperty("fleetAutoscalerSpec")) + object.fleetAutoscalerSpec = message.fleetAutoscalerSpec; + if (message.selectors && message.selectors.length) { + object.selectors = []; + for (var j = 0; j < message.selectors.length; ++j) + object.selectors[j] = $root.google.cloud.gaming.v1.LabelSelector.toObject(message.selectors[j], options); + } + if (message.schedules && message.schedules.length) { + object.schedules = []; + for (var j = 0; j < message.schedules.length; ++j) + object.schedules[j] = $root.google.cloud.gaming.v1.Schedule.toObject(message.schedules[j], options); + } + return object; + }; + + /** + * Converts this ScalingConfig to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.ScalingConfig + * @instance + * @returns {Object.} JSON object + */ + ScalingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScalingConfig + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.ScalingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScalingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.ScalingConfig"; + }; + + return ScalingConfig; + })(); + + v1.FleetConfig = (function() { + + /** + * Properties of a FleetConfig. + * @memberof google.cloud.gaming.v1 + * @interface IFleetConfig + * @property {string|null} [fleetSpec] FleetConfig fleetSpec + * @property {string|null} [name] FleetConfig name + */ + + /** + * Constructs a new FleetConfig. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a FleetConfig. + * @implements IFleetConfig + * @constructor + * @param {google.cloud.gaming.v1.IFleetConfig=} [properties] Properties to set + */ + function FleetConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FleetConfig fleetSpec. + * @member {string} fleetSpec + * @memberof google.cloud.gaming.v1.FleetConfig + * @instance + */ + FleetConfig.prototype.fleetSpec = ""; + + /** + * FleetConfig name. + * @member {string} name + * @memberof google.cloud.gaming.v1.FleetConfig + * @instance + */ + FleetConfig.prototype.name = ""; + + /** + * Creates a new FleetConfig instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.FleetConfig + * @static + * @param {google.cloud.gaming.v1.IFleetConfig=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.FleetConfig} FleetConfig instance + */ + FleetConfig.create = function create(properties) { + return new FleetConfig(properties); + }; + + /** + * Encodes the specified FleetConfig message. Does not implicitly {@link google.cloud.gaming.v1.FleetConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.FleetConfig + * @static + * @param {google.cloud.gaming.v1.IFleetConfig} message FleetConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FleetConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fleetSpec != null && Object.hasOwnProperty.call(message, "fleetSpec")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fleetSpec); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + return writer; + }; + + /** + * Encodes the specified FleetConfig message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.FleetConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.FleetConfig + * @static + * @param {google.cloud.gaming.v1.IFleetConfig} message FleetConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FleetConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FleetConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.FleetConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.FleetConfig} FleetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FleetConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.FleetConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fleetSpec = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FleetConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.FleetConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.FleetConfig} FleetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FleetConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FleetConfig message. + * @function verify + * @memberof google.cloud.gaming.v1.FleetConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FleetConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fleetSpec != null && message.hasOwnProperty("fleetSpec")) + if (!$util.isString(message.fleetSpec)) + return "fleetSpec: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a FleetConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.FleetConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.FleetConfig} FleetConfig + */ + FleetConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.FleetConfig) + return object; + var message = new $root.google.cloud.gaming.v1.FleetConfig(); + if (object.fleetSpec != null) + message.fleetSpec = String(object.fleetSpec); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a FleetConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.FleetConfig + * @static + * @param {google.cloud.gaming.v1.FleetConfig} message FleetConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FleetConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fleetSpec = ""; + object.name = ""; + } + if (message.fleetSpec != null && message.hasOwnProperty("fleetSpec")) + object.fleetSpec = message.fleetSpec; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this FleetConfig to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.FleetConfig + * @instance + * @returns {Object.} JSON object + */ + FleetConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FleetConfig + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.FleetConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FleetConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.FleetConfig"; + }; + + return FleetConfig; + })(); + + v1.GameServerConfig = (function() { + + /** + * Properties of a GameServerConfig. + * @memberof google.cloud.gaming.v1 + * @interface IGameServerConfig + * @property {string|null} [name] GameServerConfig name + * @property {google.protobuf.ITimestamp|null} [createTime] GameServerConfig createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] GameServerConfig updateTime + * @property {Object.|null} [labels] GameServerConfig labels + * @property {Array.|null} [fleetConfigs] GameServerConfig fleetConfigs + * @property {Array.|null} [scalingConfigs] GameServerConfig scalingConfigs + * @property {string|null} [description] GameServerConfig description + */ + + /** + * Constructs a new GameServerConfig. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a GameServerConfig. + * @implements IGameServerConfig + * @constructor + * @param {google.cloud.gaming.v1.IGameServerConfig=} [properties] Properties to set + */ + function GameServerConfig(properties) { + this.labels = {}; + this.fleetConfigs = []; + this.scalingConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GameServerConfig name. + * @member {string} name + * @memberof google.cloud.gaming.v1.GameServerConfig + * @instance + */ + GameServerConfig.prototype.name = ""; + + /** + * GameServerConfig createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.gaming.v1.GameServerConfig + * @instance + */ + GameServerConfig.prototype.createTime = null; + + /** + * GameServerConfig updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.gaming.v1.GameServerConfig + * @instance + */ + GameServerConfig.prototype.updateTime = null; + + /** + * GameServerConfig labels. + * @member {Object.} labels + * @memberof google.cloud.gaming.v1.GameServerConfig + * @instance + */ + GameServerConfig.prototype.labels = $util.emptyObject; + + /** + * GameServerConfig fleetConfigs. + * @member {Array.} fleetConfigs + * @memberof google.cloud.gaming.v1.GameServerConfig + * @instance + */ + GameServerConfig.prototype.fleetConfigs = $util.emptyArray; + + /** + * GameServerConfig scalingConfigs. + * @member {Array.} scalingConfigs + * @memberof google.cloud.gaming.v1.GameServerConfig + * @instance + */ + GameServerConfig.prototype.scalingConfigs = $util.emptyArray; + + /** + * GameServerConfig description. + * @member {string} description + * @memberof google.cloud.gaming.v1.GameServerConfig + * @instance + */ + GameServerConfig.prototype.description = ""; + + /** + * Creates a new GameServerConfig instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.GameServerConfig + * @static + * @param {google.cloud.gaming.v1.IGameServerConfig=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.GameServerConfig} GameServerConfig instance + */ + GameServerConfig.create = function create(properties) { + return new GameServerConfig(properties); + }; + + /** + * Encodes the specified GameServerConfig message. Does not implicitly {@link google.cloud.gaming.v1.GameServerConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.GameServerConfig + * @static + * @param {google.cloud.gaming.v1.IGameServerConfig} message GameServerConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.fleetConfigs != null && message.fleetConfigs.length) + for (var i = 0; i < message.fleetConfigs.length; ++i) + $root.google.cloud.gaming.v1.FleetConfig.encode(message.fleetConfigs[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.scalingConfigs != null && message.scalingConfigs.length) + for (var i = 0; i < message.scalingConfigs.length; ++i) + $root.google.cloud.gaming.v1.ScalingConfig.encode(message.scalingConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); + return writer; + }; + + /** + * Encodes the specified GameServerConfig message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GameServerConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.GameServerConfig + * @static + * @param {google.cloud.gaming.v1.IGameServerConfig} message GameServerConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GameServerConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.GameServerConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.GameServerConfig} GameServerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.GameServerConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + if (!(message.fleetConfigs && message.fleetConfigs.length)) + message.fleetConfigs = []; + message.fleetConfigs.push($root.google.cloud.gaming.v1.FleetConfig.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.scalingConfigs && message.scalingConfigs.length)) + message.scalingConfigs = []; + message.scalingConfigs.push($root.google.cloud.gaming.v1.ScalingConfig.decode(reader, reader.uint32())); + break; + } + case 7: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GameServerConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.GameServerConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.GameServerConfig} GameServerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GameServerConfig message. + * @function verify + * @memberof google.cloud.gaming.v1.GameServerConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GameServerConfig.verify = function verify(message) { + if (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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.fleetConfigs != null && message.hasOwnProperty("fleetConfigs")) { + if (!Array.isArray(message.fleetConfigs)) + return "fleetConfigs: array expected"; + for (var i = 0; i < message.fleetConfigs.length; ++i) { + var error = $root.google.cloud.gaming.v1.FleetConfig.verify(message.fleetConfigs[i]); + if (error) + return "fleetConfigs." + error; + } + } + if (message.scalingConfigs != null && message.hasOwnProperty("scalingConfigs")) { + if (!Array.isArray(message.scalingConfigs)) + return "scalingConfigs: array expected"; + for (var i = 0; i < message.scalingConfigs.length; ++i) { + var error = $root.google.cloud.gaming.v1.ScalingConfig.verify(message.scalingConfigs[i]); + if (error) + return "scalingConfigs." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a GameServerConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.GameServerConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.GameServerConfig} GameServerConfig + */ + GameServerConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.GameServerConfig) + return object; + var message = new $root.google.cloud.gaming.v1.GameServerConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.gaming.v1.GameServerConfig.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.gaming.v1.GameServerConfig.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.gaming.v1.GameServerConfig.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.fleetConfigs) { + if (!Array.isArray(object.fleetConfigs)) + throw TypeError(".google.cloud.gaming.v1.GameServerConfig.fleetConfigs: array expected"); + message.fleetConfigs = []; + for (var i = 0; i < object.fleetConfigs.length; ++i) { + if (typeof object.fleetConfigs[i] !== "object") + throw TypeError(".google.cloud.gaming.v1.GameServerConfig.fleetConfigs: object expected"); + message.fleetConfigs[i] = $root.google.cloud.gaming.v1.FleetConfig.fromObject(object.fleetConfigs[i]); + } + } + if (object.scalingConfigs) { + if (!Array.isArray(object.scalingConfigs)) + throw TypeError(".google.cloud.gaming.v1.GameServerConfig.scalingConfigs: array expected"); + message.scalingConfigs = []; + for (var i = 0; i < object.scalingConfigs.length; ++i) { + if (typeof object.scalingConfigs[i] !== "object") + throw TypeError(".google.cloud.gaming.v1.GameServerConfig.scalingConfigs: object expected"); + message.scalingConfigs[i] = $root.google.cloud.gaming.v1.ScalingConfig.fromObject(object.scalingConfigs[i]); + } + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a GameServerConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.GameServerConfig + * @static + * @param {google.cloud.gaming.v1.GameServerConfig} message GameServerConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GameServerConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.fleetConfigs = []; + object.scalingConfigs = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.fleetConfigs && message.fleetConfigs.length) { + object.fleetConfigs = []; + for (var j = 0; j < message.fleetConfigs.length; ++j) + object.fleetConfigs[j] = $root.google.cloud.gaming.v1.FleetConfig.toObject(message.fleetConfigs[j], options); + } + if (message.scalingConfigs && message.scalingConfigs.length) { + object.scalingConfigs = []; + for (var j = 0; j < message.scalingConfigs.length; ++j) + object.scalingConfigs[j] = $root.google.cloud.gaming.v1.ScalingConfig.toObject(message.scalingConfigs[j], options); + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this GameServerConfig to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.GameServerConfig + * @instance + * @returns {Object.} JSON object + */ + GameServerConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GameServerConfig + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.GameServerConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GameServerConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.GameServerConfig"; + }; + + return GameServerConfig; + })(); + + v1.GameServerConfigsService = (function() { + + /** + * Constructs a new GameServerConfigsService service. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a GameServerConfigsService + * @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 GameServerConfigsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (GameServerConfigsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GameServerConfigsService; + + /** + * Creates new GameServerConfigsService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.gaming.v1.GameServerConfigsService + * @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 {GameServerConfigsService} RPC service. Useful where requests and/or responses are streamed. + */ + GameServerConfigsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerConfigsService|listGameServerConfigs}. + * @memberof google.cloud.gaming.v1.GameServerConfigsService + * @typedef ListGameServerConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1.ListGameServerConfigsResponse} [response] ListGameServerConfigsResponse + */ + + /** + * Calls ListGameServerConfigs. + * @function listGameServerConfigs + * @memberof google.cloud.gaming.v1.GameServerConfigsService + * @instance + * @param {google.cloud.gaming.v1.IListGameServerConfigsRequest} request ListGameServerConfigsRequest message or plain object + * @param {google.cloud.gaming.v1.GameServerConfigsService.ListGameServerConfigsCallback} callback Node-style callback called with the error, if any, and ListGameServerConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerConfigsService.prototype.listGameServerConfigs = function listGameServerConfigs(request, callback) { + return this.rpcCall(listGameServerConfigs, $root.google.cloud.gaming.v1.ListGameServerConfigsRequest, $root.google.cloud.gaming.v1.ListGameServerConfigsResponse, request, callback); + }, "name", { value: "ListGameServerConfigs" }); + + /** + * Calls ListGameServerConfigs. + * @function listGameServerConfigs + * @memberof google.cloud.gaming.v1.GameServerConfigsService + * @instance + * @param {google.cloud.gaming.v1.IListGameServerConfigsRequest} request ListGameServerConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerConfigsService|getGameServerConfig}. + * @memberof google.cloud.gaming.v1.GameServerConfigsService + * @typedef GetGameServerConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1.GameServerConfig} [response] GameServerConfig + */ + + /** + * Calls GetGameServerConfig. + * @function getGameServerConfig + * @memberof google.cloud.gaming.v1.GameServerConfigsService + * @instance + * @param {google.cloud.gaming.v1.IGetGameServerConfigRequest} request GetGameServerConfigRequest message or plain object + * @param {google.cloud.gaming.v1.GameServerConfigsService.GetGameServerConfigCallback} callback Node-style callback called with the error, if any, and GameServerConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerConfigsService.prototype.getGameServerConfig = function getGameServerConfig(request, callback) { + return this.rpcCall(getGameServerConfig, $root.google.cloud.gaming.v1.GetGameServerConfigRequest, $root.google.cloud.gaming.v1.GameServerConfig, request, callback); + }, "name", { value: "GetGameServerConfig" }); + + /** + * Calls GetGameServerConfig. + * @function getGameServerConfig + * @memberof google.cloud.gaming.v1.GameServerConfigsService + * @instance + * @param {google.cloud.gaming.v1.IGetGameServerConfigRequest} request GetGameServerConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerConfigsService|createGameServerConfig}. + * @memberof google.cloud.gaming.v1.GameServerConfigsService + * @typedef CreateGameServerConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateGameServerConfig. + * @function createGameServerConfig + * @memberof google.cloud.gaming.v1.GameServerConfigsService + * @instance + * @param {google.cloud.gaming.v1.ICreateGameServerConfigRequest} request CreateGameServerConfigRequest message or plain object + * @param {google.cloud.gaming.v1.GameServerConfigsService.CreateGameServerConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerConfigsService.prototype.createGameServerConfig = function createGameServerConfig(request, callback) { + return this.rpcCall(createGameServerConfig, $root.google.cloud.gaming.v1.CreateGameServerConfigRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateGameServerConfig" }); + + /** + * Calls CreateGameServerConfig. + * @function createGameServerConfig + * @memberof google.cloud.gaming.v1.GameServerConfigsService + * @instance + * @param {google.cloud.gaming.v1.ICreateGameServerConfigRequest} request CreateGameServerConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerConfigsService|deleteGameServerConfig}. + * @memberof google.cloud.gaming.v1.GameServerConfigsService + * @typedef DeleteGameServerConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteGameServerConfig. + * @function deleteGameServerConfig + * @memberof google.cloud.gaming.v1.GameServerConfigsService + * @instance + * @param {google.cloud.gaming.v1.IDeleteGameServerConfigRequest} request DeleteGameServerConfigRequest message or plain object + * @param {google.cloud.gaming.v1.GameServerConfigsService.DeleteGameServerConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerConfigsService.prototype.deleteGameServerConfig = function deleteGameServerConfig(request, callback) { + return this.rpcCall(deleteGameServerConfig, $root.google.cloud.gaming.v1.DeleteGameServerConfigRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteGameServerConfig" }); + + /** + * Calls DeleteGameServerConfig. + * @function deleteGameServerConfig + * @memberof google.cloud.gaming.v1.GameServerConfigsService + * @instance + * @param {google.cloud.gaming.v1.IDeleteGameServerConfigRequest} request DeleteGameServerConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return GameServerConfigsService; + })(); + + v1.ListGameServerDeploymentsRequest = (function() { + + /** + * Properties of a ListGameServerDeploymentsRequest. + * @memberof google.cloud.gaming.v1 + * @interface IListGameServerDeploymentsRequest + * @property {string|null} [parent] ListGameServerDeploymentsRequest parent + * @property {number|null} [pageSize] ListGameServerDeploymentsRequest pageSize + * @property {string|null} [pageToken] ListGameServerDeploymentsRequest pageToken + * @property {string|null} [filter] ListGameServerDeploymentsRequest filter + * @property {string|null} [orderBy] ListGameServerDeploymentsRequest orderBy + */ + + /** + * Constructs a new ListGameServerDeploymentsRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a ListGameServerDeploymentsRequest. + * @implements IListGameServerDeploymentsRequest + * @constructor + * @param {google.cloud.gaming.v1.IListGameServerDeploymentsRequest=} [properties] Properties to set + */ + function ListGameServerDeploymentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGameServerDeploymentsRequest parent. + * @member {string} parent + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsRequest + * @instance + */ + ListGameServerDeploymentsRequest.prototype.parent = ""; + + /** + * ListGameServerDeploymentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsRequest + * @instance + */ + ListGameServerDeploymentsRequest.prototype.pageSize = 0; + + /** + * ListGameServerDeploymentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsRequest + * @instance + */ + ListGameServerDeploymentsRequest.prototype.pageToken = ""; + + /** + * ListGameServerDeploymentsRequest filter. + * @member {string} filter + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsRequest + * @instance + */ + ListGameServerDeploymentsRequest.prototype.filter = ""; + + /** + * ListGameServerDeploymentsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsRequest + * @instance + */ + ListGameServerDeploymentsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListGameServerDeploymentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsRequest + * @static + * @param {google.cloud.gaming.v1.IListGameServerDeploymentsRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.ListGameServerDeploymentsRequest} ListGameServerDeploymentsRequest instance + */ + ListGameServerDeploymentsRequest.create = function create(properties) { + return new ListGameServerDeploymentsRequest(properties); + }; + + /** + * Encodes the specified ListGameServerDeploymentsRequest message. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerDeploymentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsRequest + * @static + * @param {google.cloud.gaming.v1.IListGameServerDeploymentsRequest} message ListGameServerDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerDeploymentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListGameServerDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerDeploymentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsRequest + * @static + * @param {google.cloud.gaming.v1.IListGameServerDeploymentsRequest} message ListGameServerDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerDeploymentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGameServerDeploymentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.ListGameServerDeploymentsRequest} ListGameServerDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerDeploymentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.ListGameServerDeploymentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGameServerDeploymentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.ListGameServerDeploymentsRequest} ListGameServerDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerDeploymentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGameServerDeploymentsRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGameServerDeploymentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListGameServerDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.ListGameServerDeploymentsRequest} ListGameServerDeploymentsRequest + */ + ListGameServerDeploymentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.ListGameServerDeploymentsRequest) + return object; + var message = new $root.google.cloud.gaming.v1.ListGameServerDeploymentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListGameServerDeploymentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsRequest + * @static + * @param {google.cloud.gaming.v1.ListGameServerDeploymentsRequest} message ListGameServerDeploymentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGameServerDeploymentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListGameServerDeploymentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListGameServerDeploymentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGameServerDeploymentsRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGameServerDeploymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.ListGameServerDeploymentsRequest"; + }; + + return ListGameServerDeploymentsRequest; + })(); + + v1.ListGameServerDeploymentsResponse = (function() { + + /** + * Properties of a ListGameServerDeploymentsResponse. + * @memberof google.cloud.gaming.v1 + * @interface IListGameServerDeploymentsResponse + * @property {Array.|null} [gameServerDeployments] ListGameServerDeploymentsResponse gameServerDeployments + * @property {string|null} [nextPageToken] ListGameServerDeploymentsResponse nextPageToken + * @property {Array.|null} [unreachable] ListGameServerDeploymentsResponse unreachable + */ + + /** + * Constructs a new ListGameServerDeploymentsResponse. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a ListGameServerDeploymentsResponse. + * @implements IListGameServerDeploymentsResponse + * @constructor + * @param {google.cloud.gaming.v1.IListGameServerDeploymentsResponse=} [properties] Properties to set + */ + function ListGameServerDeploymentsResponse(properties) { + this.gameServerDeployments = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGameServerDeploymentsResponse gameServerDeployments. + * @member {Array.} gameServerDeployments + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsResponse + * @instance + */ + ListGameServerDeploymentsResponse.prototype.gameServerDeployments = $util.emptyArray; + + /** + * ListGameServerDeploymentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsResponse + * @instance + */ + ListGameServerDeploymentsResponse.prototype.nextPageToken = ""; + + /** + * ListGameServerDeploymentsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsResponse + * @instance + */ + ListGameServerDeploymentsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListGameServerDeploymentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsResponse + * @static + * @param {google.cloud.gaming.v1.IListGameServerDeploymentsResponse=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.ListGameServerDeploymentsResponse} ListGameServerDeploymentsResponse instance + */ + ListGameServerDeploymentsResponse.create = function create(properties) { + return new ListGameServerDeploymentsResponse(properties); + }; + + /** + * Encodes the specified ListGameServerDeploymentsResponse message. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerDeploymentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsResponse + * @static + * @param {google.cloud.gaming.v1.IListGameServerDeploymentsResponse} message ListGameServerDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerDeploymentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gameServerDeployments != null && message.gameServerDeployments.length) + for (var i = 0; i < message.gameServerDeployments.length; ++i) + $root.google.cloud.gaming.v1.GameServerDeployment.encode(message.gameServerDeployments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListGameServerDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.ListGameServerDeploymentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsResponse + * @static + * @param {google.cloud.gaming.v1.IListGameServerDeploymentsResponse} message ListGameServerDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerDeploymentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGameServerDeploymentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.ListGameServerDeploymentsResponse} ListGameServerDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerDeploymentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.ListGameServerDeploymentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.gameServerDeployments && message.gameServerDeployments.length)) + message.gameServerDeployments = []; + message.gameServerDeployments.push($root.google.cloud.gaming.v1.GameServerDeployment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGameServerDeploymentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.ListGameServerDeploymentsResponse} ListGameServerDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerDeploymentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGameServerDeploymentsResponse message. + * @function verify + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGameServerDeploymentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gameServerDeployments != null && message.hasOwnProperty("gameServerDeployments")) { + if (!Array.isArray(message.gameServerDeployments)) + return "gameServerDeployments: array expected"; + for (var i = 0; i < message.gameServerDeployments.length; ++i) { + var error = $root.google.cloud.gaming.v1.GameServerDeployment.verify(message.gameServerDeployments[i]); + if (error) + return "gameServerDeployments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListGameServerDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.ListGameServerDeploymentsResponse} ListGameServerDeploymentsResponse + */ + ListGameServerDeploymentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.ListGameServerDeploymentsResponse) + return object; + var message = new $root.google.cloud.gaming.v1.ListGameServerDeploymentsResponse(); + if (object.gameServerDeployments) { + if (!Array.isArray(object.gameServerDeployments)) + throw TypeError(".google.cloud.gaming.v1.ListGameServerDeploymentsResponse.gameServerDeployments: array expected"); + message.gameServerDeployments = []; + for (var i = 0; i < object.gameServerDeployments.length; ++i) { + if (typeof object.gameServerDeployments[i] !== "object") + throw TypeError(".google.cloud.gaming.v1.ListGameServerDeploymentsResponse.gameServerDeployments: object expected"); + message.gameServerDeployments[i] = $root.google.cloud.gaming.v1.GameServerDeployment.fromObject(object.gameServerDeployments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.gaming.v1.ListGameServerDeploymentsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListGameServerDeploymentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsResponse + * @static + * @param {google.cloud.gaming.v1.ListGameServerDeploymentsResponse} message ListGameServerDeploymentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGameServerDeploymentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.gameServerDeployments = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.gameServerDeployments && message.gameServerDeployments.length) { + object.gameServerDeployments = []; + for (var j = 0; j < message.gameServerDeployments.length; ++j) + object.gameServerDeployments[j] = $root.google.cloud.gaming.v1.GameServerDeployment.toObject(message.gameServerDeployments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListGameServerDeploymentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListGameServerDeploymentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGameServerDeploymentsResponse + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.ListGameServerDeploymentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGameServerDeploymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.ListGameServerDeploymentsResponse"; + }; + + return ListGameServerDeploymentsResponse; + })(); + + v1.GetGameServerDeploymentRequest = (function() { + + /** + * Properties of a GetGameServerDeploymentRequest. + * @memberof google.cloud.gaming.v1 + * @interface IGetGameServerDeploymentRequest + * @property {string|null} [name] GetGameServerDeploymentRequest name + */ + + /** + * Constructs a new GetGameServerDeploymentRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a GetGameServerDeploymentRequest. + * @implements IGetGameServerDeploymentRequest + * @constructor + * @param {google.cloud.gaming.v1.IGetGameServerDeploymentRequest=} [properties] Properties to set + */ + function GetGameServerDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGameServerDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.gaming.v1.GetGameServerDeploymentRequest + * @instance + */ + GetGameServerDeploymentRequest.prototype.name = ""; + + /** + * Creates a new GetGameServerDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.GetGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1.IGetGameServerDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.GetGameServerDeploymentRequest} GetGameServerDeploymentRequest instance + */ + GetGameServerDeploymentRequest.create = function create(properties) { + return new GetGameServerDeploymentRequest(properties); + }; + + /** + * Encodes the specified GetGameServerDeploymentRequest message. Does not implicitly {@link google.cloud.gaming.v1.GetGameServerDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.GetGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1.IGetGameServerDeploymentRequest} message GetGameServerDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGameServerDeploymentRequest.encode = function encode(message, writer) { + 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 GetGameServerDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GetGameServerDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.GetGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1.IGetGameServerDeploymentRequest} message GetGameServerDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGameServerDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGameServerDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.GetGameServerDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.GetGameServerDeploymentRequest} GetGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGameServerDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.GetGameServerDeploymentRequest(); + 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 GetGameServerDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.GetGameServerDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.GetGameServerDeploymentRequest} GetGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGameServerDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGameServerDeploymentRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.GetGameServerDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGameServerDeploymentRequest.verify = function verify(message) { + if (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 GetGameServerDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.GetGameServerDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.GetGameServerDeploymentRequest} GetGameServerDeploymentRequest + */ + GetGameServerDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.GetGameServerDeploymentRequest) + return object; + var message = new $root.google.cloud.gaming.v1.GetGameServerDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetGameServerDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.GetGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1.GetGameServerDeploymentRequest} message GetGameServerDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGameServerDeploymentRequest.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 GetGameServerDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.GetGameServerDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + GetGameServerDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGameServerDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.GetGameServerDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGameServerDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.GetGameServerDeploymentRequest"; + }; + + return GetGameServerDeploymentRequest; + })(); + + v1.GetGameServerDeploymentRolloutRequest = (function() { + + /** + * Properties of a GetGameServerDeploymentRolloutRequest. + * @memberof google.cloud.gaming.v1 + * @interface IGetGameServerDeploymentRolloutRequest + * @property {string|null} [name] GetGameServerDeploymentRolloutRequest name + */ + + /** + * Constructs a new GetGameServerDeploymentRolloutRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a GetGameServerDeploymentRolloutRequest. + * @implements IGetGameServerDeploymentRolloutRequest + * @constructor + * @param {google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest=} [properties] Properties to set + */ + function GetGameServerDeploymentRolloutRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGameServerDeploymentRolloutRequest name. + * @member {string} name + * @memberof google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest + * @instance + */ + GetGameServerDeploymentRolloutRequest.prototype.name = ""; + + /** + * Creates a new GetGameServerDeploymentRolloutRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest} GetGameServerDeploymentRolloutRequest instance + */ + GetGameServerDeploymentRolloutRequest.create = function create(properties) { + return new GetGameServerDeploymentRolloutRequest(properties); + }; + + /** + * Encodes the specified GetGameServerDeploymentRolloutRequest message. Does not implicitly {@link google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest} message GetGameServerDeploymentRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGameServerDeploymentRolloutRequest.encode = function encode(message, writer) { + 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 GetGameServerDeploymentRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest} message GetGameServerDeploymentRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGameServerDeploymentRolloutRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGameServerDeploymentRolloutRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest} GetGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGameServerDeploymentRolloutRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest(); + 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 GetGameServerDeploymentRolloutRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest} GetGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGameServerDeploymentRolloutRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGameServerDeploymentRolloutRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGameServerDeploymentRolloutRequest.verify = function verify(message) { + if (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 GetGameServerDeploymentRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest} GetGameServerDeploymentRolloutRequest + */ + GetGameServerDeploymentRolloutRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest) + return object; + var message = new $root.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetGameServerDeploymentRolloutRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest} message GetGameServerDeploymentRolloutRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGameServerDeploymentRolloutRequest.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 GetGameServerDeploymentRolloutRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest + * @instance + * @returns {Object.} JSON object + */ + GetGameServerDeploymentRolloutRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGameServerDeploymentRolloutRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGameServerDeploymentRolloutRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest"; + }; + + return GetGameServerDeploymentRolloutRequest; + })(); + + v1.CreateGameServerDeploymentRequest = (function() { + + /** + * Properties of a CreateGameServerDeploymentRequest. + * @memberof google.cloud.gaming.v1 + * @interface ICreateGameServerDeploymentRequest + * @property {string|null} [parent] CreateGameServerDeploymentRequest parent + * @property {string|null} [deploymentId] CreateGameServerDeploymentRequest deploymentId + * @property {google.cloud.gaming.v1.IGameServerDeployment|null} [gameServerDeployment] CreateGameServerDeploymentRequest gameServerDeployment + */ + + /** + * Constructs a new CreateGameServerDeploymentRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a CreateGameServerDeploymentRequest. + * @implements ICreateGameServerDeploymentRequest + * @constructor + * @param {google.cloud.gaming.v1.ICreateGameServerDeploymentRequest=} [properties] Properties to set + */ + function CreateGameServerDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateGameServerDeploymentRequest parent. + * @member {string} parent + * @memberof google.cloud.gaming.v1.CreateGameServerDeploymentRequest + * @instance + */ + CreateGameServerDeploymentRequest.prototype.parent = ""; + + /** + * CreateGameServerDeploymentRequest deploymentId. + * @member {string} deploymentId + * @memberof google.cloud.gaming.v1.CreateGameServerDeploymentRequest + * @instance + */ + CreateGameServerDeploymentRequest.prototype.deploymentId = ""; + + /** + * CreateGameServerDeploymentRequest gameServerDeployment. + * @member {google.cloud.gaming.v1.IGameServerDeployment|null|undefined} gameServerDeployment + * @memberof google.cloud.gaming.v1.CreateGameServerDeploymentRequest + * @instance + */ + CreateGameServerDeploymentRequest.prototype.gameServerDeployment = null; + + /** + * Creates a new CreateGameServerDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.CreateGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1.ICreateGameServerDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.CreateGameServerDeploymentRequest} CreateGameServerDeploymentRequest instance + */ + CreateGameServerDeploymentRequest.create = function create(properties) { + return new CreateGameServerDeploymentRequest(properties); + }; + + /** + * Encodes the specified CreateGameServerDeploymentRequest message. Does not implicitly {@link google.cloud.gaming.v1.CreateGameServerDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.CreateGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1.ICreateGameServerDeploymentRequest} message CreateGameServerDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGameServerDeploymentRequest.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.deploymentId != null && Object.hasOwnProperty.call(message, "deploymentId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deploymentId); + if (message.gameServerDeployment != null && Object.hasOwnProperty.call(message, "gameServerDeployment")) + $root.google.cloud.gaming.v1.GameServerDeployment.encode(message.gameServerDeployment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateGameServerDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.CreateGameServerDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.CreateGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1.ICreateGameServerDeploymentRequest} message CreateGameServerDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGameServerDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateGameServerDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.CreateGameServerDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.CreateGameServerDeploymentRequest} CreateGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGameServerDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.CreateGameServerDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.deploymentId = reader.string(); + break; + } + case 3: { + message.gameServerDeployment = $root.google.cloud.gaming.v1.GameServerDeployment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateGameServerDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.CreateGameServerDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.CreateGameServerDeploymentRequest} CreateGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGameServerDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateGameServerDeploymentRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.CreateGameServerDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateGameServerDeploymentRequest.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.deploymentId != null && message.hasOwnProperty("deploymentId")) + if (!$util.isString(message.deploymentId)) + return "deploymentId: string expected"; + if (message.gameServerDeployment != null && message.hasOwnProperty("gameServerDeployment")) { + var error = $root.google.cloud.gaming.v1.GameServerDeployment.verify(message.gameServerDeployment); + if (error) + return "gameServerDeployment." + error; + } + return null; + }; + + /** + * Creates a CreateGameServerDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.CreateGameServerDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.CreateGameServerDeploymentRequest} CreateGameServerDeploymentRequest + */ + CreateGameServerDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.CreateGameServerDeploymentRequest) + return object; + var message = new $root.google.cloud.gaming.v1.CreateGameServerDeploymentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.deploymentId != null) + message.deploymentId = String(object.deploymentId); + if (object.gameServerDeployment != null) { + if (typeof object.gameServerDeployment !== "object") + throw TypeError(".google.cloud.gaming.v1.CreateGameServerDeploymentRequest.gameServerDeployment: object expected"); + message.gameServerDeployment = $root.google.cloud.gaming.v1.GameServerDeployment.fromObject(object.gameServerDeployment); + } + return message; + }; + + /** + * Creates a plain object from a CreateGameServerDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.CreateGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1.CreateGameServerDeploymentRequest} message CreateGameServerDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateGameServerDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.deploymentId = ""; + object.gameServerDeployment = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.deploymentId != null && message.hasOwnProperty("deploymentId")) + object.deploymentId = message.deploymentId; + if (message.gameServerDeployment != null && message.hasOwnProperty("gameServerDeployment")) + object.gameServerDeployment = $root.google.cloud.gaming.v1.GameServerDeployment.toObject(message.gameServerDeployment, options); + return object; + }; + + /** + * Converts this CreateGameServerDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.CreateGameServerDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateGameServerDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateGameServerDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.CreateGameServerDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateGameServerDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.CreateGameServerDeploymentRequest"; + }; + + return CreateGameServerDeploymentRequest; + })(); + + v1.DeleteGameServerDeploymentRequest = (function() { + + /** + * Properties of a DeleteGameServerDeploymentRequest. + * @memberof google.cloud.gaming.v1 + * @interface IDeleteGameServerDeploymentRequest + * @property {string|null} [name] DeleteGameServerDeploymentRequest name + */ + + /** + * Constructs a new DeleteGameServerDeploymentRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a DeleteGameServerDeploymentRequest. + * @implements IDeleteGameServerDeploymentRequest + * @constructor + * @param {google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest=} [properties] Properties to set + */ + function DeleteGameServerDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGameServerDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.gaming.v1.DeleteGameServerDeploymentRequest + * @instance + */ + DeleteGameServerDeploymentRequest.prototype.name = ""; + + /** + * Creates a new DeleteGameServerDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.DeleteGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.DeleteGameServerDeploymentRequest} DeleteGameServerDeploymentRequest instance + */ + DeleteGameServerDeploymentRequest.create = function create(properties) { + return new DeleteGameServerDeploymentRequest(properties); + }; + + /** + * Encodes the specified DeleteGameServerDeploymentRequest message. Does not implicitly {@link google.cloud.gaming.v1.DeleteGameServerDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.DeleteGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest} message DeleteGameServerDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGameServerDeploymentRequest.encode = function encode(message, writer) { + 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 DeleteGameServerDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.DeleteGameServerDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.DeleteGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest} message DeleteGameServerDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGameServerDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGameServerDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.DeleteGameServerDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.DeleteGameServerDeploymentRequest} DeleteGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGameServerDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest(); + 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 DeleteGameServerDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.DeleteGameServerDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.DeleteGameServerDeploymentRequest} DeleteGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGameServerDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGameServerDeploymentRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.DeleteGameServerDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGameServerDeploymentRequest.verify = function verify(message) { + if (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 DeleteGameServerDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.DeleteGameServerDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.DeleteGameServerDeploymentRequest} DeleteGameServerDeploymentRequest + */ + DeleteGameServerDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest) + return object; + var message = new $root.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteGameServerDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.DeleteGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1.DeleteGameServerDeploymentRequest} message DeleteGameServerDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGameServerDeploymentRequest.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 DeleteGameServerDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.DeleteGameServerDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGameServerDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteGameServerDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.DeleteGameServerDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteGameServerDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.DeleteGameServerDeploymentRequest"; + }; + + return DeleteGameServerDeploymentRequest; + })(); + + v1.UpdateGameServerDeploymentRequest = (function() { + + /** + * Properties of an UpdateGameServerDeploymentRequest. + * @memberof google.cloud.gaming.v1 + * @interface IUpdateGameServerDeploymentRequest + * @property {google.cloud.gaming.v1.IGameServerDeployment|null} [gameServerDeployment] UpdateGameServerDeploymentRequest gameServerDeployment + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateGameServerDeploymentRequest updateMask + */ + + /** + * Constructs a new UpdateGameServerDeploymentRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents an UpdateGameServerDeploymentRequest. + * @implements IUpdateGameServerDeploymentRequest + * @constructor + * @param {google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest=} [properties] Properties to set + */ + function UpdateGameServerDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateGameServerDeploymentRequest gameServerDeployment. + * @member {google.cloud.gaming.v1.IGameServerDeployment|null|undefined} gameServerDeployment + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRequest + * @instance + */ + UpdateGameServerDeploymentRequest.prototype.gameServerDeployment = null; + + /** + * UpdateGameServerDeploymentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRequest + * @instance + */ + UpdateGameServerDeploymentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateGameServerDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.UpdateGameServerDeploymentRequest} UpdateGameServerDeploymentRequest instance + */ + UpdateGameServerDeploymentRequest.create = function create(properties) { + return new UpdateGameServerDeploymentRequest(properties); + }; + + /** + * Encodes the specified UpdateGameServerDeploymentRequest message. Does not implicitly {@link google.cloud.gaming.v1.UpdateGameServerDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest} message UpdateGameServerDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGameServerDeploymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gameServerDeployment != null && Object.hasOwnProperty.call(message, "gameServerDeployment")) + $root.google.cloud.gaming.v1.GameServerDeployment.encode(message.gameServerDeployment, 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 UpdateGameServerDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.UpdateGameServerDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest} message UpdateGameServerDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGameServerDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateGameServerDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.UpdateGameServerDeploymentRequest} UpdateGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGameServerDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.UpdateGameServerDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gameServerDeployment = $root.google.cloud.gaming.v1.GameServerDeployment.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 UpdateGameServerDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.UpdateGameServerDeploymentRequest} UpdateGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGameServerDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateGameServerDeploymentRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateGameServerDeploymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gameServerDeployment != null && message.hasOwnProperty("gameServerDeployment")) { + var error = $root.google.cloud.gaming.v1.GameServerDeployment.verify(message.gameServerDeployment); + if (error) + return "gameServerDeployment." + 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 UpdateGameServerDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.UpdateGameServerDeploymentRequest} UpdateGameServerDeploymentRequest + */ + UpdateGameServerDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.UpdateGameServerDeploymentRequest) + return object; + var message = new $root.google.cloud.gaming.v1.UpdateGameServerDeploymentRequest(); + if (object.gameServerDeployment != null) { + if (typeof object.gameServerDeployment !== "object") + throw TypeError(".google.cloud.gaming.v1.UpdateGameServerDeploymentRequest.gameServerDeployment: object expected"); + message.gameServerDeployment = $root.google.cloud.gaming.v1.GameServerDeployment.fromObject(object.gameServerDeployment); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.gaming.v1.UpdateGameServerDeploymentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateGameServerDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1.UpdateGameServerDeploymentRequest} message UpdateGameServerDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateGameServerDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gameServerDeployment = null; + object.updateMask = null; + } + if (message.gameServerDeployment != null && message.hasOwnProperty("gameServerDeployment")) + object.gameServerDeployment = $root.google.cloud.gaming.v1.GameServerDeployment.toObject(message.gameServerDeployment, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateGameServerDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateGameServerDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateGameServerDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateGameServerDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.UpdateGameServerDeploymentRequest"; + }; + + return UpdateGameServerDeploymentRequest; + })(); + + v1.UpdateGameServerDeploymentRolloutRequest = (function() { + + /** + * Properties of an UpdateGameServerDeploymentRolloutRequest. + * @memberof google.cloud.gaming.v1 + * @interface IUpdateGameServerDeploymentRolloutRequest + * @property {google.cloud.gaming.v1.IGameServerDeploymentRollout|null} [rollout] UpdateGameServerDeploymentRolloutRequest rollout + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateGameServerDeploymentRolloutRequest updateMask + */ + + /** + * Constructs a new UpdateGameServerDeploymentRolloutRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents an UpdateGameServerDeploymentRolloutRequest. + * @implements IUpdateGameServerDeploymentRolloutRequest + * @constructor + * @param {google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest=} [properties] Properties to set + */ + function UpdateGameServerDeploymentRolloutRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateGameServerDeploymentRolloutRequest rollout. + * @member {google.cloud.gaming.v1.IGameServerDeploymentRollout|null|undefined} rollout + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest + * @instance + */ + UpdateGameServerDeploymentRolloutRequest.prototype.rollout = null; + + /** + * UpdateGameServerDeploymentRolloutRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest + * @instance + */ + UpdateGameServerDeploymentRolloutRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateGameServerDeploymentRolloutRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest} UpdateGameServerDeploymentRolloutRequest instance + */ + UpdateGameServerDeploymentRolloutRequest.create = function create(properties) { + return new UpdateGameServerDeploymentRolloutRequest(properties); + }; + + /** + * Encodes the specified UpdateGameServerDeploymentRolloutRequest message. Does not implicitly {@link google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest} message UpdateGameServerDeploymentRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGameServerDeploymentRolloutRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rollout != null && Object.hasOwnProperty.call(message, "rollout")) + $root.google.cloud.gaming.v1.GameServerDeploymentRollout.encode(message.rollout, 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 UpdateGameServerDeploymentRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest} message UpdateGameServerDeploymentRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGameServerDeploymentRolloutRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateGameServerDeploymentRolloutRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest} UpdateGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGameServerDeploymentRolloutRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rollout = $root.google.cloud.gaming.v1.GameServerDeploymentRollout.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 UpdateGameServerDeploymentRolloutRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest} UpdateGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGameServerDeploymentRolloutRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateGameServerDeploymentRolloutRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateGameServerDeploymentRolloutRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rollout != null && message.hasOwnProperty("rollout")) { + var error = $root.google.cloud.gaming.v1.GameServerDeploymentRollout.verify(message.rollout); + if (error) + return "rollout." + 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 UpdateGameServerDeploymentRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest} UpdateGameServerDeploymentRolloutRequest + */ + UpdateGameServerDeploymentRolloutRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest) + return object; + var message = new $root.google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest(); + if (object.rollout != null) { + if (typeof object.rollout !== "object") + throw TypeError(".google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest.rollout: object expected"); + message.rollout = $root.google.cloud.gaming.v1.GameServerDeploymentRollout.fromObject(object.rollout); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateGameServerDeploymentRolloutRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest} message UpdateGameServerDeploymentRolloutRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateGameServerDeploymentRolloutRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rollout = null; + object.updateMask = null; + } + if (message.rollout != null && message.hasOwnProperty("rollout")) + object.rollout = $root.google.cloud.gaming.v1.GameServerDeploymentRollout.toObject(message.rollout, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateGameServerDeploymentRolloutRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateGameServerDeploymentRolloutRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateGameServerDeploymentRolloutRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateGameServerDeploymentRolloutRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest"; + }; + + return UpdateGameServerDeploymentRolloutRequest; + })(); + + v1.FetchDeploymentStateRequest = (function() { + + /** + * Properties of a FetchDeploymentStateRequest. + * @memberof google.cloud.gaming.v1 + * @interface IFetchDeploymentStateRequest + * @property {string|null} [name] FetchDeploymentStateRequest name + */ + + /** + * Constructs a new FetchDeploymentStateRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a FetchDeploymentStateRequest. + * @implements IFetchDeploymentStateRequest + * @constructor + * @param {google.cloud.gaming.v1.IFetchDeploymentStateRequest=} [properties] Properties to set + */ + function FetchDeploymentStateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchDeploymentStateRequest name. + * @member {string} name + * @memberof google.cloud.gaming.v1.FetchDeploymentStateRequest + * @instance + */ + FetchDeploymentStateRequest.prototype.name = ""; + + /** + * Creates a new FetchDeploymentStateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.FetchDeploymentStateRequest + * @static + * @param {google.cloud.gaming.v1.IFetchDeploymentStateRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.FetchDeploymentStateRequest} FetchDeploymentStateRequest instance + */ + FetchDeploymentStateRequest.create = function create(properties) { + return new FetchDeploymentStateRequest(properties); + }; + + /** + * Encodes the specified FetchDeploymentStateRequest message. Does not implicitly {@link google.cloud.gaming.v1.FetchDeploymentStateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.FetchDeploymentStateRequest + * @static + * @param {google.cloud.gaming.v1.IFetchDeploymentStateRequest} message FetchDeploymentStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchDeploymentStateRequest.encode = function encode(message, writer) { + 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 FetchDeploymentStateRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.FetchDeploymentStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.FetchDeploymentStateRequest + * @static + * @param {google.cloud.gaming.v1.IFetchDeploymentStateRequest} message FetchDeploymentStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchDeploymentStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchDeploymentStateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.FetchDeploymentStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.FetchDeploymentStateRequest} FetchDeploymentStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchDeploymentStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.FetchDeploymentStateRequest(); + 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 FetchDeploymentStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.FetchDeploymentStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.FetchDeploymentStateRequest} FetchDeploymentStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchDeploymentStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchDeploymentStateRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.FetchDeploymentStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchDeploymentStateRequest.verify = function verify(message) { + if (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 FetchDeploymentStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.FetchDeploymentStateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.FetchDeploymentStateRequest} FetchDeploymentStateRequest + */ + FetchDeploymentStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.FetchDeploymentStateRequest) + return object; + var message = new $root.google.cloud.gaming.v1.FetchDeploymentStateRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a FetchDeploymentStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.FetchDeploymentStateRequest + * @static + * @param {google.cloud.gaming.v1.FetchDeploymentStateRequest} message FetchDeploymentStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchDeploymentStateRequest.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 FetchDeploymentStateRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.FetchDeploymentStateRequest + * @instance + * @returns {Object.} JSON object + */ + FetchDeploymentStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchDeploymentStateRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.FetchDeploymentStateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchDeploymentStateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.FetchDeploymentStateRequest"; + }; + + return FetchDeploymentStateRequest; + })(); + + v1.FetchDeploymentStateResponse = (function() { + + /** + * Properties of a FetchDeploymentStateResponse. + * @memberof google.cloud.gaming.v1 + * @interface IFetchDeploymentStateResponse + * @property {Array.|null} [clusterState] FetchDeploymentStateResponse clusterState + * @property {Array.|null} [unavailable] FetchDeploymentStateResponse unavailable + */ + + /** + * Constructs a new FetchDeploymentStateResponse. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a FetchDeploymentStateResponse. + * @implements IFetchDeploymentStateResponse + * @constructor + * @param {google.cloud.gaming.v1.IFetchDeploymentStateResponse=} [properties] Properties to set + */ + function FetchDeploymentStateResponse(properties) { + this.clusterState = []; + this.unavailable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchDeploymentStateResponse clusterState. + * @member {Array.} clusterState + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse + * @instance + */ + FetchDeploymentStateResponse.prototype.clusterState = $util.emptyArray; + + /** + * FetchDeploymentStateResponse unavailable. + * @member {Array.} unavailable + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse + * @instance + */ + FetchDeploymentStateResponse.prototype.unavailable = $util.emptyArray; + + /** + * Creates a new FetchDeploymentStateResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse + * @static + * @param {google.cloud.gaming.v1.IFetchDeploymentStateResponse=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.FetchDeploymentStateResponse} FetchDeploymentStateResponse instance + */ + FetchDeploymentStateResponse.create = function create(properties) { + return new FetchDeploymentStateResponse(properties); + }; + + /** + * Encodes the specified FetchDeploymentStateResponse message. Does not implicitly {@link google.cloud.gaming.v1.FetchDeploymentStateResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse + * @static + * @param {google.cloud.gaming.v1.IFetchDeploymentStateResponse} message FetchDeploymentStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchDeploymentStateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusterState != null && message.clusterState.length) + for (var i = 0; i < message.clusterState.length; ++i) + $root.google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState.encode(message.clusterState[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.unavailable != null && message.unavailable.length) + for (var i = 0; i < message.unavailable.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.unavailable[i]); + return writer; + }; + + /** + * Encodes the specified FetchDeploymentStateResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.FetchDeploymentStateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse + * @static + * @param {google.cloud.gaming.v1.IFetchDeploymentStateResponse} message FetchDeploymentStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchDeploymentStateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchDeploymentStateResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.FetchDeploymentStateResponse} FetchDeploymentStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchDeploymentStateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.FetchDeploymentStateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.clusterState && message.clusterState.length)) + message.clusterState = []; + message.clusterState.push($root.google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.unavailable && message.unavailable.length)) + message.unavailable = []; + message.unavailable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchDeploymentStateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.FetchDeploymentStateResponse} FetchDeploymentStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchDeploymentStateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchDeploymentStateResponse message. + * @function verify + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchDeploymentStateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusterState != null && message.hasOwnProperty("clusterState")) { + if (!Array.isArray(message.clusterState)) + return "clusterState: array expected"; + for (var i = 0; i < message.clusterState.length; ++i) { + var error = $root.google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState.verify(message.clusterState[i]); + if (error) + return "clusterState." + error; + } + } + if (message.unavailable != null && message.hasOwnProperty("unavailable")) { + if (!Array.isArray(message.unavailable)) + return "unavailable: array expected"; + for (var i = 0; i < message.unavailable.length; ++i) + if (!$util.isString(message.unavailable[i])) + return "unavailable: string[] expected"; + } + return null; + }; + + /** + * Creates a FetchDeploymentStateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.FetchDeploymentStateResponse} FetchDeploymentStateResponse + */ + FetchDeploymentStateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.FetchDeploymentStateResponse) + return object; + var message = new $root.google.cloud.gaming.v1.FetchDeploymentStateResponse(); + if (object.clusterState) { + if (!Array.isArray(object.clusterState)) + throw TypeError(".google.cloud.gaming.v1.FetchDeploymentStateResponse.clusterState: array expected"); + message.clusterState = []; + for (var i = 0; i < object.clusterState.length; ++i) { + if (typeof object.clusterState[i] !== "object") + throw TypeError(".google.cloud.gaming.v1.FetchDeploymentStateResponse.clusterState: object expected"); + message.clusterState[i] = $root.google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState.fromObject(object.clusterState[i]); + } + } + if (object.unavailable) { + if (!Array.isArray(object.unavailable)) + throw TypeError(".google.cloud.gaming.v1.FetchDeploymentStateResponse.unavailable: array expected"); + message.unavailable = []; + for (var i = 0; i < object.unavailable.length; ++i) + message.unavailable[i] = String(object.unavailable[i]); + } + return message; + }; + + /** + * Creates a plain object from a FetchDeploymentStateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse + * @static + * @param {google.cloud.gaming.v1.FetchDeploymentStateResponse} message FetchDeploymentStateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchDeploymentStateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.clusterState = []; + object.unavailable = []; + } + if (message.clusterState && message.clusterState.length) { + object.clusterState = []; + for (var j = 0; j < message.clusterState.length; ++j) + object.clusterState[j] = $root.google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState.toObject(message.clusterState[j], options); + } + if (message.unavailable && message.unavailable.length) { + object.unavailable = []; + for (var j = 0; j < message.unavailable.length; ++j) + object.unavailable[j] = message.unavailable[j]; + } + return object; + }; + + /** + * Converts this FetchDeploymentStateResponse to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse + * @instance + * @returns {Object.} JSON object + */ + FetchDeploymentStateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchDeploymentStateResponse + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchDeploymentStateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.FetchDeploymentStateResponse"; + }; + + FetchDeploymentStateResponse.DeployedClusterState = (function() { + + /** + * Properties of a DeployedClusterState. + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse + * @interface IDeployedClusterState + * @property {string|null} [cluster] DeployedClusterState cluster + * @property {Array.|null} [fleetDetails] DeployedClusterState fleetDetails + */ + + /** + * Constructs a new DeployedClusterState. + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse + * @classdesc Represents a DeployedClusterState. + * @implements IDeployedClusterState + * @constructor + * @param {google.cloud.gaming.v1.FetchDeploymentStateResponse.IDeployedClusterState=} [properties] Properties to set + */ + function DeployedClusterState(properties) { + this.fleetDetails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployedClusterState cluster. + * @member {string} cluster + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState + * @instance + */ + DeployedClusterState.prototype.cluster = ""; + + /** + * DeployedClusterState fleetDetails. + * @member {Array.} fleetDetails + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState + * @instance + */ + DeployedClusterState.prototype.fleetDetails = $util.emptyArray; + + /** + * Creates a new DeployedClusterState instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState + * @static + * @param {google.cloud.gaming.v1.FetchDeploymentStateResponse.IDeployedClusterState=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState} DeployedClusterState instance + */ + DeployedClusterState.create = function create(properties) { + return new DeployedClusterState(properties); + }; + + /** + * Encodes the specified DeployedClusterState message. Does not implicitly {@link google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState + * @static + * @param {google.cloud.gaming.v1.FetchDeploymentStateResponse.IDeployedClusterState} message DeployedClusterState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployedClusterState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cluster); + if (message.fleetDetails != null && message.fleetDetails.length) + for (var i = 0; i < message.fleetDetails.length; ++i) + $root.google.cloud.gaming.v1.DeployedFleetDetails.encode(message.fleetDetails[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployedClusterState message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState + * @static + * @param {google.cloud.gaming.v1.FetchDeploymentStateResponse.IDeployedClusterState} message DeployedClusterState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployedClusterState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployedClusterState message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState} DeployedClusterState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployedClusterState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cluster = reader.string(); + break; + } + case 2: { + if (!(message.fleetDetails && message.fleetDetails.length)) + message.fleetDetails = []; + message.fleetDetails.push($root.google.cloud.gaming.v1.DeployedFleetDetails.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployedClusterState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState} DeployedClusterState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployedClusterState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployedClusterState message. + * @function verify + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployedClusterState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) + if (!$util.isString(message.cluster)) + return "cluster: string expected"; + if (message.fleetDetails != null && message.hasOwnProperty("fleetDetails")) { + if (!Array.isArray(message.fleetDetails)) + return "fleetDetails: array expected"; + for (var i = 0; i < message.fleetDetails.length; ++i) { + var error = $root.google.cloud.gaming.v1.DeployedFleetDetails.verify(message.fleetDetails[i]); + if (error) + return "fleetDetails." + error; + } + } + return null; + }; + + /** + * Creates a DeployedClusterState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState} DeployedClusterState + */ + DeployedClusterState.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState) + return object; + var message = new $root.google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState(); + if (object.cluster != null) + message.cluster = String(object.cluster); + if (object.fleetDetails) { + if (!Array.isArray(object.fleetDetails)) + throw TypeError(".google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState.fleetDetails: array expected"); + message.fleetDetails = []; + for (var i = 0; i < object.fleetDetails.length; ++i) { + if (typeof object.fleetDetails[i] !== "object") + throw TypeError(".google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState.fleetDetails: object expected"); + message.fleetDetails[i] = $root.google.cloud.gaming.v1.DeployedFleetDetails.fromObject(object.fleetDetails[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DeployedClusterState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState + * @static + * @param {google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState} message DeployedClusterState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployedClusterState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fleetDetails = []; + if (options.defaults) + object.cluster = ""; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = message.cluster; + if (message.fleetDetails && message.fleetDetails.length) { + object.fleetDetails = []; + for (var j = 0; j < message.fleetDetails.length; ++j) + object.fleetDetails[j] = $root.google.cloud.gaming.v1.DeployedFleetDetails.toObject(message.fleetDetails[j], options); + } + return object; + }; + + /** + * Converts this DeployedClusterState to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState + * @instance + * @returns {Object.} JSON object + */ + DeployedClusterState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployedClusterState + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployedClusterState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.FetchDeploymentStateResponse.DeployedClusterState"; + }; + + return DeployedClusterState; + })(); + + return FetchDeploymentStateResponse; + })(); + + v1.GameServerDeployment = (function() { + + /** + * Properties of a GameServerDeployment. + * @memberof google.cloud.gaming.v1 + * @interface IGameServerDeployment + * @property {string|null} [name] GameServerDeployment name + * @property {google.protobuf.ITimestamp|null} [createTime] GameServerDeployment createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] GameServerDeployment updateTime + * @property {Object.|null} [labels] GameServerDeployment labels + * @property {string|null} [etag] GameServerDeployment etag + * @property {string|null} [description] GameServerDeployment description + */ + + /** + * Constructs a new GameServerDeployment. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a GameServerDeployment. + * @implements IGameServerDeployment + * @constructor + * @param {google.cloud.gaming.v1.IGameServerDeployment=} [properties] Properties to set + */ + function GameServerDeployment(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]]; + } + + /** + * GameServerDeployment name. + * @member {string} name + * @memberof google.cloud.gaming.v1.GameServerDeployment + * @instance + */ + GameServerDeployment.prototype.name = ""; + + /** + * GameServerDeployment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.gaming.v1.GameServerDeployment + * @instance + */ + GameServerDeployment.prototype.createTime = null; + + /** + * GameServerDeployment updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.gaming.v1.GameServerDeployment + * @instance + */ + GameServerDeployment.prototype.updateTime = null; + + /** + * GameServerDeployment labels. + * @member {Object.} labels + * @memberof google.cloud.gaming.v1.GameServerDeployment + * @instance + */ + GameServerDeployment.prototype.labels = $util.emptyObject; + + /** + * GameServerDeployment etag. + * @member {string} etag + * @memberof google.cloud.gaming.v1.GameServerDeployment + * @instance + */ + GameServerDeployment.prototype.etag = ""; + + /** + * GameServerDeployment description. + * @member {string} description + * @memberof google.cloud.gaming.v1.GameServerDeployment + * @instance + */ + GameServerDeployment.prototype.description = ""; + + /** + * Creates a new GameServerDeployment instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.GameServerDeployment + * @static + * @param {google.cloud.gaming.v1.IGameServerDeployment=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.GameServerDeployment} GameServerDeployment instance + */ + GameServerDeployment.create = function create(properties) { + return new GameServerDeployment(properties); + }; + + /** + * Encodes the specified GameServerDeployment message. Does not implicitly {@link google.cloud.gaming.v1.GameServerDeployment.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.GameServerDeployment + * @static + * @param {google.cloud.gaming.v1.IGameServerDeployment} message GameServerDeployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerDeployment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.description); + return writer; + }; + + /** + * Encodes the specified GameServerDeployment message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GameServerDeployment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.GameServerDeployment + * @static + * @param {google.cloud.gaming.v1.IGameServerDeployment} message GameServerDeployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerDeployment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GameServerDeployment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.GameServerDeployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.GameServerDeployment} GameServerDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerDeployment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.GameServerDeployment(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 7: { + message.etag = reader.string(); + break; + } + case 8: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GameServerDeployment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.GameServerDeployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.GameServerDeployment} GameServerDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerDeployment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GameServerDeployment message. + * @function verify + * @memberof google.cloud.gaming.v1.GameServerDeployment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GameServerDeployment.verify = function verify(message) { + if (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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a GameServerDeployment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.GameServerDeployment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.GameServerDeployment} GameServerDeployment + */ + GameServerDeployment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.GameServerDeployment) + return object; + var message = new $root.google.cloud.gaming.v1.GameServerDeployment(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.gaming.v1.GameServerDeployment.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.gaming.v1.GameServerDeployment.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.gaming.v1.GameServerDeployment.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a GameServerDeployment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.GameServerDeployment + * @static + * @param {google.cloud.gaming.v1.GameServerDeployment} message GameServerDeployment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GameServerDeployment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this GameServerDeployment to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.GameServerDeployment + * @instance + * @returns {Object.} JSON object + */ + GameServerDeployment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GameServerDeployment + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.GameServerDeployment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GameServerDeployment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.GameServerDeployment"; + }; + + return GameServerDeployment; + })(); + + v1.GameServerConfigOverride = (function() { + + /** + * Properties of a GameServerConfigOverride. + * @memberof google.cloud.gaming.v1 + * @interface IGameServerConfigOverride + * @property {google.cloud.gaming.v1.IRealmSelector|null} [realmsSelector] GameServerConfigOverride realmsSelector + * @property {string|null} [configVersion] GameServerConfigOverride configVersion + */ + + /** + * Constructs a new GameServerConfigOverride. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a GameServerConfigOverride. + * @implements IGameServerConfigOverride + * @constructor + * @param {google.cloud.gaming.v1.IGameServerConfigOverride=} [properties] Properties to set + */ + function GameServerConfigOverride(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GameServerConfigOverride realmsSelector. + * @member {google.cloud.gaming.v1.IRealmSelector|null|undefined} realmsSelector + * @memberof google.cloud.gaming.v1.GameServerConfigOverride + * @instance + */ + GameServerConfigOverride.prototype.realmsSelector = null; + + /** + * GameServerConfigOverride configVersion. + * @member {string|null|undefined} configVersion + * @memberof google.cloud.gaming.v1.GameServerConfigOverride + * @instance + */ + GameServerConfigOverride.prototype.configVersion = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GameServerConfigOverride selector. + * @member {"realmsSelector"|undefined} selector + * @memberof google.cloud.gaming.v1.GameServerConfigOverride + * @instance + */ + Object.defineProperty(GameServerConfigOverride.prototype, "selector", { + get: $util.oneOfGetter($oneOfFields = ["realmsSelector"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GameServerConfigOverride change. + * @member {"configVersion"|undefined} change + * @memberof google.cloud.gaming.v1.GameServerConfigOverride + * @instance + */ + Object.defineProperty(GameServerConfigOverride.prototype, "change", { + get: $util.oneOfGetter($oneOfFields = ["configVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GameServerConfigOverride instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.GameServerConfigOverride + * @static + * @param {google.cloud.gaming.v1.IGameServerConfigOverride=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.GameServerConfigOverride} GameServerConfigOverride instance + */ + GameServerConfigOverride.create = function create(properties) { + return new GameServerConfigOverride(properties); + }; + + /** + * Encodes the specified GameServerConfigOverride message. Does not implicitly {@link google.cloud.gaming.v1.GameServerConfigOverride.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.GameServerConfigOverride + * @static + * @param {google.cloud.gaming.v1.IGameServerConfigOverride} message GameServerConfigOverride message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerConfigOverride.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.realmsSelector != null && Object.hasOwnProperty.call(message, "realmsSelector")) + $root.google.cloud.gaming.v1.RealmSelector.encode(message.realmsSelector, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.configVersion != null && Object.hasOwnProperty.call(message, "configVersion")) + writer.uint32(/* id 100, wireType 2 =*/802).string(message.configVersion); + return writer; + }; + + /** + * Encodes the specified GameServerConfigOverride message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GameServerConfigOverride.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.GameServerConfigOverride + * @static + * @param {google.cloud.gaming.v1.IGameServerConfigOverride} message GameServerConfigOverride message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerConfigOverride.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GameServerConfigOverride message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.GameServerConfigOverride + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.GameServerConfigOverride} GameServerConfigOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerConfigOverride.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.GameServerConfigOverride(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.realmsSelector = $root.google.cloud.gaming.v1.RealmSelector.decode(reader, reader.uint32()); + break; + } + case 100: { + message.configVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GameServerConfigOverride message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.GameServerConfigOverride + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.GameServerConfigOverride} GameServerConfigOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerConfigOverride.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GameServerConfigOverride message. + * @function verify + * @memberof google.cloud.gaming.v1.GameServerConfigOverride + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GameServerConfigOverride.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.realmsSelector != null && message.hasOwnProperty("realmsSelector")) { + properties.selector = 1; + { + var error = $root.google.cloud.gaming.v1.RealmSelector.verify(message.realmsSelector); + if (error) + return "realmsSelector." + error; + } + } + if (message.configVersion != null && message.hasOwnProperty("configVersion")) { + properties.change = 1; + if (!$util.isString(message.configVersion)) + return "configVersion: string expected"; + } + return null; + }; + + /** + * Creates a GameServerConfigOverride message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.GameServerConfigOverride + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.GameServerConfigOverride} GameServerConfigOverride + */ + GameServerConfigOverride.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.GameServerConfigOverride) + return object; + var message = new $root.google.cloud.gaming.v1.GameServerConfigOverride(); + if (object.realmsSelector != null) { + if (typeof object.realmsSelector !== "object") + throw TypeError(".google.cloud.gaming.v1.GameServerConfigOverride.realmsSelector: object expected"); + message.realmsSelector = $root.google.cloud.gaming.v1.RealmSelector.fromObject(object.realmsSelector); + } + if (object.configVersion != null) + message.configVersion = String(object.configVersion); + return message; + }; + + /** + * Creates a plain object from a GameServerConfigOverride message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.GameServerConfigOverride + * @static + * @param {google.cloud.gaming.v1.GameServerConfigOverride} message GameServerConfigOverride + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GameServerConfigOverride.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.realmsSelector != null && message.hasOwnProperty("realmsSelector")) { + object.realmsSelector = $root.google.cloud.gaming.v1.RealmSelector.toObject(message.realmsSelector, options); + if (options.oneofs) + object.selector = "realmsSelector"; + } + if (message.configVersion != null && message.hasOwnProperty("configVersion")) { + object.configVersion = message.configVersion; + if (options.oneofs) + object.change = "configVersion"; + } + return object; + }; + + /** + * Converts this GameServerConfigOverride to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.GameServerConfigOverride + * @instance + * @returns {Object.} JSON object + */ + GameServerConfigOverride.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GameServerConfigOverride + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.GameServerConfigOverride + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GameServerConfigOverride.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.GameServerConfigOverride"; + }; + + return GameServerConfigOverride; + })(); + + v1.GameServerDeploymentRollout = (function() { + + /** + * Properties of a GameServerDeploymentRollout. + * @memberof google.cloud.gaming.v1 + * @interface IGameServerDeploymentRollout + * @property {string|null} [name] GameServerDeploymentRollout name + * @property {google.protobuf.ITimestamp|null} [createTime] GameServerDeploymentRollout createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] GameServerDeploymentRollout updateTime + * @property {string|null} [defaultGameServerConfig] GameServerDeploymentRollout defaultGameServerConfig + * @property {Array.|null} [gameServerConfigOverrides] GameServerDeploymentRollout gameServerConfigOverrides + * @property {string|null} [etag] GameServerDeploymentRollout etag + */ + + /** + * Constructs a new GameServerDeploymentRollout. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a GameServerDeploymentRollout. + * @implements IGameServerDeploymentRollout + * @constructor + * @param {google.cloud.gaming.v1.IGameServerDeploymentRollout=} [properties] Properties to set + */ + function GameServerDeploymentRollout(properties) { + this.gameServerConfigOverrides = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GameServerDeploymentRollout name. + * @member {string} name + * @memberof google.cloud.gaming.v1.GameServerDeploymentRollout + * @instance + */ + GameServerDeploymentRollout.prototype.name = ""; + + /** + * GameServerDeploymentRollout createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.gaming.v1.GameServerDeploymentRollout + * @instance + */ + GameServerDeploymentRollout.prototype.createTime = null; + + /** + * GameServerDeploymentRollout updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.gaming.v1.GameServerDeploymentRollout + * @instance + */ + GameServerDeploymentRollout.prototype.updateTime = null; + + /** + * GameServerDeploymentRollout defaultGameServerConfig. + * @member {string} defaultGameServerConfig + * @memberof google.cloud.gaming.v1.GameServerDeploymentRollout + * @instance + */ + GameServerDeploymentRollout.prototype.defaultGameServerConfig = ""; + + /** + * GameServerDeploymentRollout gameServerConfigOverrides. + * @member {Array.} gameServerConfigOverrides + * @memberof google.cloud.gaming.v1.GameServerDeploymentRollout + * @instance + */ + GameServerDeploymentRollout.prototype.gameServerConfigOverrides = $util.emptyArray; + + /** + * GameServerDeploymentRollout etag. + * @member {string} etag + * @memberof google.cloud.gaming.v1.GameServerDeploymentRollout + * @instance + */ + GameServerDeploymentRollout.prototype.etag = ""; + + /** + * Creates a new GameServerDeploymentRollout instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.GameServerDeploymentRollout + * @static + * @param {google.cloud.gaming.v1.IGameServerDeploymentRollout=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.GameServerDeploymentRollout} GameServerDeploymentRollout instance + */ + GameServerDeploymentRollout.create = function create(properties) { + return new GameServerDeploymentRollout(properties); + }; + + /** + * Encodes the specified GameServerDeploymentRollout message. Does not implicitly {@link google.cloud.gaming.v1.GameServerDeploymentRollout.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.GameServerDeploymentRollout + * @static + * @param {google.cloud.gaming.v1.IGameServerDeploymentRollout} message GameServerDeploymentRollout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerDeploymentRollout.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.defaultGameServerConfig != null && Object.hasOwnProperty.call(message, "defaultGameServerConfig")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.defaultGameServerConfig); + if (message.gameServerConfigOverrides != null && message.gameServerConfigOverrides.length) + for (var i = 0; i < message.gameServerConfigOverrides.length; ++i) + $root.google.cloud.gaming.v1.GameServerConfigOverride.encode(message.gameServerConfigOverrides[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + return writer; + }; + + /** + * Encodes the specified GameServerDeploymentRollout message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GameServerDeploymentRollout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.GameServerDeploymentRollout + * @static + * @param {google.cloud.gaming.v1.IGameServerDeploymentRollout} message GameServerDeploymentRollout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerDeploymentRollout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GameServerDeploymentRollout message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.GameServerDeploymentRollout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.GameServerDeploymentRollout} GameServerDeploymentRollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerDeploymentRollout.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.GameServerDeploymentRollout(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.defaultGameServerConfig = reader.string(); + break; + } + case 5: { + if (!(message.gameServerConfigOverrides && message.gameServerConfigOverrides.length)) + message.gameServerConfigOverrides = []; + message.gameServerConfigOverrides.push($root.google.cloud.gaming.v1.GameServerConfigOverride.decode(reader, reader.uint32())); + break; + } + case 6: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GameServerDeploymentRollout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.GameServerDeploymentRollout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.GameServerDeploymentRollout} GameServerDeploymentRollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerDeploymentRollout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GameServerDeploymentRollout message. + * @function verify + * @memberof google.cloud.gaming.v1.GameServerDeploymentRollout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GameServerDeploymentRollout.verify = function verify(message) { + if (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.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.defaultGameServerConfig != null && message.hasOwnProperty("defaultGameServerConfig")) + if (!$util.isString(message.defaultGameServerConfig)) + return "defaultGameServerConfig: string expected"; + if (message.gameServerConfigOverrides != null && message.hasOwnProperty("gameServerConfigOverrides")) { + if (!Array.isArray(message.gameServerConfigOverrides)) + return "gameServerConfigOverrides: array expected"; + for (var i = 0; i < message.gameServerConfigOverrides.length; ++i) { + var error = $root.google.cloud.gaming.v1.GameServerConfigOverride.verify(message.gameServerConfigOverrides[i]); + if (error) + return "gameServerConfigOverrides." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a GameServerDeploymentRollout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.GameServerDeploymentRollout + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.GameServerDeploymentRollout} GameServerDeploymentRollout + */ + GameServerDeploymentRollout.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.GameServerDeploymentRollout) + return object; + var message = new $root.google.cloud.gaming.v1.GameServerDeploymentRollout(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.gaming.v1.GameServerDeploymentRollout.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.gaming.v1.GameServerDeploymentRollout.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.defaultGameServerConfig != null) + message.defaultGameServerConfig = String(object.defaultGameServerConfig); + if (object.gameServerConfigOverrides) { + if (!Array.isArray(object.gameServerConfigOverrides)) + throw TypeError(".google.cloud.gaming.v1.GameServerDeploymentRollout.gameServerConfigOverrides: array expected"); + message.gameServerConfigOverrides = []; + for (var i = 0; i < object.gameServerConfigOverrides.length; ++i) { + if (typeof object.gameServerConfigOverrides[i] !== "object") + throw TypeError(".google.cloud.gaming.v1.GameServerDeploymentRollout.gameServerConfigOverrides: object expected"); + message.gameServerConfigOverrides[i] = $root.google.cloud.gaming.v1.GameServerConfigOverride.fromObject(object.gameServerConfigOverrides[i]); + } + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a GameServerDeploymentRollout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.GameServerDeploymentRollout + * @static + * @param {google.cloud.gaming.v1.GameServerDeploymentRollout} message GameServerDeploymentRollout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GameServerDeploymentRollout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.gameServerConfigOverrides = []; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.defaultGameServerConfig = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.defaultGameServerConfig != null && message.hasOwnProperty("defaultGameServerConfig")) + object.defaultGameServerConfig = message.defaultGameServerConfig; + if (message.gameServerConfigOverrides && message.gameServerConfigOverrides.length) { + object.gameServerConfigOverrides = []; + for (var j = 0; j < message.gameServerConfigOverrides.length; ++j) + object.gameServerConfigOverrides[j] = $root.google.cloud.gaming.v1.GameServerConfigOverride.toObject(message.gameServerConfigOverrides[j], options); + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this GameServerDeploymentRollout to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.GameServerDeploymentRollout + * @instance + * @returns {Object.} JSON object + */ + GameServerDeploymentRollout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GameServerDeploymentRollout + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.GameServerDeploymentRollout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GameServerDeploymentRollout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.GameServerDeploymentRollout"; + }; + + return GameServerDeploymentRollout; + })(); + + v1.PreviewGameServerDeploymentRolloutRequest = (function() { + + /** + * Properties of a PreviewGameServerDeploymentRolloutRequest. + * @memberof google.cloud.gaming.v1 + * @interface IPreviewGameServerDeploymentRolloutRequest + * @property {google.cloud.gaming.v1.IGameServerDeploymentRollout|null} [rollout] PreviewGameServerDeploymentRolloutRequest rollout + * @property {google.protobuf.IFieldMask|null} [updateMask] PreviewGameServerDeploymentRolloutRequest updateMask + * @property {google.protobuf.ITimestamp|null} [previewTime] PreviewGameServerDeploymentRolloutRequest previewTime + */ + + /** + * Constructs a new PreviewGameServerDeploymentRolloutRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a PreviewGameServerDeploymentRolloutRequest. + * @implements IPreviewGameServerDeploymentRolloutRequest + * @constructor + * @param {google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest=} [properties] Properties to set + */ + function PreviewGameServerDeploymentRolloutRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreviewGameServerDeploymentRolloutRequest rollout. + * @member {google.cloud.gaming.v1.IGameServerDeploymentRollout|null|undefined} rollout + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest + * @instance + */ + PreviewGameServerDeploymentRolloutRequest.prototype.rollout = null; + + /** + * PreviewGameServerDeploymentRolloutRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest + * @instance + */ + PreviewGameServerDeploymentRolloutRequest.prototype.updateMask = null; + + /** + * PreviewGameServerDeploymentRolloutRequest previewTime. + * @member {google.protobuf.ITimestamp|null|undefined} previewTime + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest + * @instance + */ + PreviewGameServerDeploymentRolloutRequest.prototype.previewTime = null; + + /** + * Creates a new PreviewGameServerDeploymentRolloutRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest} PreviewGameServerDeploymentRolloutRequest instance + */ + PreviewGameServerDeploymentRolloutRequest.create = function create(properties) { + return new PreviewGameServerDeploymentRolloutRequest(properties); + }; + + /** + * Encodes the specified PreviewGameServerDeploymentRolloutRequest message. Does not implicitly {@link google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest} message PreviewGameServerDeploymentRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewGameServerDeploymentRolloutRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rollout != null && Object.hasOwnProperty.call(message, "rollout")) + $root.google.cloud.gaming.v1.GameServerDeploymentRollout.encode(message.rollout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.previewTime != null && Object.hasOwnProperty.call(message, "previewTime")) + $root.google.protobuf.Timestamp.encode(message.previewTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreviewGameServerDeploymentRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest} message PreviewGameServerDeploymentRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewGameServerDeploymentRolloutRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreviewGameServerDeploymentRolloutRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest} PreviewGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewGameServerDeploymentRolloutRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rollout = $root.google.cloud.gaming.v1.GameServerDeploymentRollout.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.previewTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreviewGameServerDeploymentRolloutRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest} PreviewGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewGameServerDeploymentRolloutRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreviewGameServerDeploymentRolloutRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreviewGameServerDeploymentRolloutRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rollout != null && message.hasOwnProperty("rollout")) { + var error = $root.google.cloud.gaming.v1.GameServerDeploymentRollout.verify(message.rollout); + if (error) + return "rollout." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.previewTime != null && message.hasOwnProperty("previewTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.previewTime); + if (error) + return "previewTime." + error; + } + return null; + }; + + /** + * Creates a PreviewGameServerDeploymentRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest} PreviewGameServerDeploymentRolloutRequest + */ + PreviewGameServerDeploymentRolloutRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest) + return object; + var message = new $root.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest(); + if (object.rollout != null) { + if (typeof object.rollout !== "object") + throw TypeError(".google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest.rollout: object expected"); + message.rollout = $root.google.cloud.gaming.v1.GameServerDeploymentRollout.fromObject(object.rollout); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.previewTime != null) { + if (typeof object.previewTime !== "object") + throw TypeError(".google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest.previewTime: object expected"); + message.previewTime = $root.google.protobuf.Timestamp.fromObject(object.previewTime); + } + return message; + }; + + /** + * Creates a plain object from a PreviewGameServerDeploymentRolloutRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest} message PreviewGameServerDeploymentRolloutRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreviewGameServerDeploymentRolloutRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rollout = null; + object.updateMask = null; + object.previewTime = null; + } + if (message.rollout != null && message.hasOwnProperty("rollout")) + object.rollout = $root.google.cloud.gaming.v1.GameServerDeploymentRollout.toObject(message.rollout, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.previewTime != null && message.hasOwnProperty("previewTime")) + object.previewTime = $root.google.protobuf.Timestamp.toObject(message.previewTime, options); + return object; + }; + + /** + * Converts this PreviewGameServerDeploymentRolloutRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest + * @instance + * @returns {Object.} JSON object + */ + PreviewGameServerDeploymentRolloutRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PreviewGameServerDeploymentRolloutRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PreviewGameServerDeploymentRolloutRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest"; + }; + + return PreviewGameServerDeploymentRolloutRequest; + })(); + + v1.PreviewGameServerDeploymentRolloutResponse = (function() { + + /** + * Properties of a PreviewGameServerDeploymentRolloutResponse. + * @memberof google.cloud.gaming.v1 + * @interface IPreviewGameServerDeploymentRolloutResponse + * @property {Array.|null} [unavailable] PreviewGameServerDeploymentRolloutResponse unavailable + * @property {string|null} [etag] PreviewGameServerDeploymentRolloutResponse etag + * @property {google.cloud.gaming.v1.ITargetState|null} [targetState] PreviewGameServerDeploymentRolloutResponse targetState + */ + + /** + * Constructs a new PreviewGameServerDeploymentRolloutResponse. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a PreviewGameServerDeploymentRolloutResponse. + * @implements IPreviewGameServerDeploymentRolloutResponse + * @constructor + * @param {google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutResponse=} [properties] Properties to set + */ + function PreviewGameServerDeploymentRolloutResponse(properties) { + this.unavailable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreviewGameServerDeploymentRolloutResponse unavailable. + * @member {Array.} unavailable + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse + * @instance + */ + PreviewGameServerDeploymentRolloutResponse.prototype.unavailable = $util.emptyArray; + + /** + * PreviewGameServerDeploymentRolloutResponse etag. + * @member {string} etag + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse + * @instance + */ + PreviewGameServerDeploymentRolloutResponse.prototype.etag = ""; + + /** + * PreviewGameServerDeploymentRolloutResponse targetState. + * @member {google.cloud.gaming.v1.ITargetState|null|undefined} targetState + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse + * @instance + */ + PreviewGameServerDeploymentRolloutResponse.prototype.targetState = null; + + /** + * Creates a new PreviewGameServerDeploymentRolloutResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse + * @static + * @param {google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutResponse=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse} PreviewGameServerDeploymentRolloutResponse instance + */ + PreviewGameServerDeploymentRolloutResponse.create = function create(properties) { + return new PreviewGameServerDeploymentRolloutResponse(properties); + }; + + /** + * Encodes the specified PreviewGameServerDeploymentRolloutResponse message. Does not implicitly {@link google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse + * @static + * @param {google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutResponse} message PreviewGameServerDeploymentRolloutResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewGameServerDeploymentRolloutResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unavailable != null && message.unavailable.length) + for (var i = 0; i < message.unavailable.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.unavailable[i]); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.targetState != null && Object.hasOwnProperty.call(message, "targetState")) + $root.google.cloud.gaming.v1.TargetState.encode(message.targetState, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreviewGameServerDeploymentRolloutResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse + * @static + * @param {google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutResponse} message PreviewGameServerDeploymentRolloutResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewGameServerDeploymentRolloutResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreviewGameServerDeploymentRolloutResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse} PreviewGameServerDeploymentRolloutResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewGameServerDeploymentRolloutResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.unavailable && message.unavailable.length)) + message.unavailable = []; + message.unavailable.push(reader.string()); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 4: { + message.targetState = $root.google.cloud.gaming.v1.TargetState.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreviewGameServerDeploymentRolloutResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse} PreviewGameServerDeploymentRolloutResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewGameServerDeploymentRolloutResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreviewGameServerDeploymentRolloutResponse message. + * @function verify + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreviewGameServerDeploymentRolloutResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.unavailable != null && message.hasOwnProperty("unavailable")) { + if (!Array.isArray(message.unavailable)) + return "unavailable: array expected"; + for (var i = 0; i < message.unavailable.length; ++i) + if (!$util.isString(message.unavailable[i])) + return "unavailable: string[] expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.targetState != null && message.hasOwnProperty("targetState")) { + var error = $root.google.cloud.gaming.v1.TargetState.verify(message.targetState); + if (error) + return "targetState." + error; + } + return null; + }; + + /** + * Creates a PreviewGameServerDeploymentRolloutResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse} PreviewGameServerDeploymentRolloutResponse + */ + PreviewGameServerDeploymentRolloutResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse) + return object; + var message = new $root.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse(); + if (object.unavailable) { + if (!Array.isArray(object.unavailable)) + throw TypeError(".google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse.unavailable: array expected"); + message.unavailable = []; + for (var i = 0; i < object.unavailable.length; ++i) + message.unavailable[i] = String(object.unavailable[i]); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.targetState != null) { + if (typeof object.targetState !== "object") + throw TypeError(".google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse.targetState: object expected"); + message.targetState = $root.google.cloud.gaming.v1.TargetState.fromObject(object.targetState); + } + return message; + }; + + /** + * Creates a plain object from a PreviewGameServerDeploymentRolloutResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse + * @static + * @param {google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse} message PreviewGameServerDeploymentRolloutResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreviewGameServerDeploymentRolloutResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unavailable = []; + if (options.defaults) { + object.etag = ""; + object.targetState = null; + } + if (message.unavailable && message.unavailable.length) { + object.unavailable = []; + for (var j = 0; j < message.unavailable.length; ++j) + object.unavailable[j] = message.unavailable[j]; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.targetState != null && message.hasOwnProperty("targetState")) + object.targetState = $root.google.cloud.gaming.v1.TargetState.toObject(message.targetState, options); + return object; + }; + + /** + * Converts this PreviewGameServerDeploymentRolloutResponse to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse + * @instance + * @returns {Object.} JSON object + */ + PreviewGameServerDeploymentRolloutResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PreviewGameServerDeploymentRolloutResponse + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PreviewGameServerDeploymentRolloutResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse"; + }; + + return PreviewGameServerDeploymentRolloutResponse; + })(); + + v1.GameServerDeploymentsService = (function() { + + /** + * Constructs a new GameServerDeploymentsService service. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a GameServerDeploymentsService + * @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 GameServerDeploymentsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (GameServerDeploymentsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GameServerDeploymentsService; + + /** + * Creates new GameServerDeploymentsService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @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 {GameServerDeploymentsService} RPC service. Useful where requests and/or responses are streamed. + */ + GameServerDeploymentsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|listGameServerDeployments}. + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @typedef ListGameServerDeploymentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1.ListGameServerDeploymentsResponse} [response] ListGameServerDeploymentsResponse + */ + + /** + * Calls ListGameServerDeployments. + * @function listGameServerDeployments + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1.IListGameServerDeploymentsRequest} request ListGameServerDeploymentsRequest message or plain object + * @param {google.cloud.gaming.v1.GameServerDeploymentsService.ListGameServerDeploymentsCallback} callback Node-style callback called with the error, if any, and ListGameServerDeploymentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerDeploymentsService.prototype.listGameServerDeployments = function listGameServerDeployments(request, callback) { + return this.rpcCall(listGameServerDeployments, $root.google.cloud.gaming.v1.ListGameServerDeploymentsRequest, $root.google.cloud.gaming.v1.ListGameServerDeploymentsResponse, request, callback); + }, "name", { value: "ListGameServerDeployments" }); + + /** + * Calls ListGameServerDeployments. + * @function listGameServerDeployments + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1.IListGameServerDeploymentsRequest} request ListGameServerDeploymentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|getGameServerDeployment}. + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @typedef GetGameServerDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1.GameServerDeployment} [response] GameServerDeployment + */ + + /** + * Calls GetGameServerDeployment. + * @function getGameServerDeployment + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1.IGetGameServerDeploymentRequest} request GetGameServerDeploymentRequest message or plain object + * @param {google.cloud.gaming.v1.GameServerDeploymentsService.GetGameServerDeploymentCallback} callback Node-style callback called with the error, if any, and GameServerDeployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerDeploymentsService.prototype.getGameServerDeployment = function getGameServerDeployment(request, callback) { + return this.rpcCall(getGameServerDeployment, $root.google.cloud.gaming.v1.GetGameServerDeploymentRequest, $root.google.cloud.gaming.v1.GameServerDeployment, request, callback); + }, "name", { value: "GetGameServerDeployment" }); + + /** + * Calls GetGameServerDeployment. + * @function getGameServerDeployment + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1.IGetGameServerDeploymentRequest} request GetGameServerDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|createGameServerDeployment}. + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @typedef CreateGameServerDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateGameServerDeployment. + * @function createGameServerDeployment + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1.ICreateGameServerDeploymentRequest} request CreateGameServerDeploymentRequest message or plain object + * @param {google.cloud.gaming.v1.GameServerDeploymentsService.CreateGameServerDeploymentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerDeploymentsService.prototype.createGameServerDeployment = function createGameServerDeployment(request, callback) { + return this.rpcCall(createGameServerDeployment, $root.google.cloud.gaming.v1.CreateGameServerDeploymentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateGameServerDeployment" }); + + /** + * Calls CreateGameServerDeployment. + * @function createGameServerDeployment + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1.ICreateGameServerDeploymentRequest} request CreateGameServerDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|deleteGameServerDeployment}. + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @typedef DeleteGameServerDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteGameServerDeployment. + * @function deleteGameServerDeployment + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest} request DeleteGameServerDeploymentRequest message or plain object + * @param {google.cloud.gaming.v1.GameServerDeploymentsService.DeleteGameServerDeploymentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerDeploymentsService.prototype.deleteGameServerDeployment = function deleteGameServerDeployment(request, callback) { + return this.rpcCall(deleteGameServerDeployment, $root.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteGameServerDeployment" }); + + /** + * Calls DeleteGameServerDeployment. + * @function deleteGameServerDeployment + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest} request DeleteGameServerDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|updateGameServerDeployment}. + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @typedef UpdateGameServerDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateGameServerDeployment. + * @function updateGameServerDeployment + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest} request UpdateGameServerDeploymentRequest message or plain object + * @param {google.cloud.gaming.v1.GameServerDeploymentsService.UpdateGameServerDeploymentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerDeploymentsService.prototype.updateGameServerDeployment = function updateGameServerDeployment(request, callback) { + return this.rpcCall(updateGameServerDeployment, $root.google.cloud.gaming.v1.UpdateGameServerDeploymentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateGameServerDeployment" }); + + /** + * Calls UpdateGameServerDeployment. + * @function updateGameServerDeployment + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest} request UpdateGameServerDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|getGameServerDeploymentRollout}. + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @typedef GetGameServerDeploymentRolloutCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1.GameServerDeploymentRollout} [response] GameServerDeploymentRollout + */ + + /** + * Calls GetGameServerDeploymentRollout. + * @function getGameServerDeploymentRollout + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest} request GetGameServerDeploymentRolloutRequest message or plain object + * @param {google.cloud.gaming.v1.GameServerDeploymentsService.GetGameServerDeploymentRolloutCallback} callback Node-style callback called with the error, if any, and GameServerDeploymentRollout + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerDeploymentsService.prototype.getGameServerDeploymentRollout = function getGameServerDeploymentRollout(request, callback) { + return this.rpcCall(getGameServerDeploymentRollout, $root.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest, $root.google.cloud.gaming.v1.GameServerDeploymentRollout, request, callback); + }, "name", { value: "GetGameServerDeploymentRollout" }); + + /** + * Calls GetGameServerDeploymentRollout. + * @function getGameServerDeploymentRollout + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest} request GetGameServerDeploymentRolloutRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|updateGameServerDeploymentRollout}. + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @typedef UpdateGameServerDeploymentRolloutCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateGameServerDeploymentRollout. + * @function updateGameServerDeploymentRollout + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest} request UpdateGameServerDeploymentRolloutRequest message or plain object + * @param {google.cloud.gaming.v1.GameServerDeploymentsService.UpdateGameServerDeploymentRolloutCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerDeploymentsService.prototype.updateGameServerDeploymentRollout = function updateGameServerDeploymentRollout(request, callback) { + return this.rpcCall(updateGameServerDeploymentRollout, $root.google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateGameServerDeploymentRollout" }); + + /** + * Calls UpdateGameServerDeploymentRollout. + * @function updateGameServerDeploymentRollout + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest} request UpdateGameServerDeploymentRolloutRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|previewGameServerDeploymentRollout}. + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @typedef PreviewGameServerDeploymentRolloutCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse} [response] PreviewGameServerDeploymentRolloutResponse + */ + + /** + * Calls PreviewGameServerDeploymentRollout. + * @function previewGameServerDeploymentRollout + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest} request PreviewGameServerDeploymentRolloutRequest message or plain object + * @param {google.cloud.gaming.v1.GameServerDeploymentsService.PreviewGameServerDeploymentRolloutCallback} callback Node-style callback called with the error, if any, and PreviewGameServerDeploymentRolloutResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerDeploymentsService.prototype.previewGameServerDeploymentRollout = function previewGameServerDeploymentRollout(request, callback) { + return this.rpcCall(previewGameServerDeploymentRollout, $root.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest, $root.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse, request, callback); + }, "name", { value: "PreviewGameServerDeploymentRollout" }); + + /** + * Calls PreviewGameServerDeploymentRollout. + * @function previewGameServerDeploymentRollout + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest} request PreviewGameServerDeploymentRolloutRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|fetchDeploymentState}. + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @typedef FetchDeploymentStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1.FetchDeploymentStateResponse} [response] FetchDeploymentStateResponse + */ + + /** + * Calls FetchDeploymentState. + * @function fetchDeploymentState + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1.IFetchDeploymentStateRequest} request FetchDeploymentStateRequest message or plain object + * @param {google.cloud.gaming.v1.GameServerDeploymentsService.FetchDeploymentStateCallback} callback Node-style callback called with the error, if any, and FetchDeploymentStateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerDeploymentsService.prototype.fetchDeploymentState = function fetchDeploymentState(request, callback) { + return this.rpcCall(fetchDeploymentState, $root.google.cloud.gaming.v1.FetchDeploymentStateRequest, $root.google.cloud.gaming.v1.FetchDeploymentStateResponse, request, callback); + }, "name", { value: "FetchDeploymentState" }); + + /** + * Calls FetchDeploymentState. + * @function fetchDeploymentState + * @memberof google.cloud.gaming.v1.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1.IFetchDeploymentStateRequest} request FetchDeploymentStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return GameServerDeploymentsService; + })(); + + v1.ListRealmsRequest = (function() { + + /** + * Properties of a ListRealmsRequest. + * @memberof google.cloud.gaming.v1 + * @interface IListRealmsRequest + * @property {string|null} [parent] ListRealmsRequest parent + * @property {number|null} [pageSize] ListRealmsRequest pageSize + * @property {string|null} [pageToken] ListRealmsRequest pageToken + * @property {string|null} [filter] ListRealmsRequest filter + * @property {string|null} [orderBy] ListRealmsRequest orderBy + */ + + /** + * Constructs a new ListRealmsRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a ListRealmsRequest. + * @implements IListRealmsRequest + * @constructor + * @param {google.cloud.gaming.v1.IListRealmsRequest=} [properties] Properties to set + */ + function ListRealmsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRealmsRequest parent. + * @member {string} parent + * @memberof google.cloud.gaming.v1.ListRealmsRequest + * @instance + */ + ListRealmsRequest.prototype.parent = ""; + + /** + * ListRealmsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.gaming.v1.ListRealmsRequest + * @instance + */ + ListRealmsRequest.prototype.pageSize = 0; + + /** + * ListRealmsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.gaming.v1.ListRealmsRequest + * @instance + */ + ListRealmsRequest.prototype.pageToken = ""; + + /** + * ListRealmsRequest filter. + * @member {string} filter + * @memberof google.cloud.gaming.v1.ListRealmsRequest + * @instance + */ + ListRealmsRequest.prototype.filter = ""; + + /** + * ListRealmsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.gaming.v1.ListRealmsRequest + * @instance + */ + ListRealmsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListRealmsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.ListRealmsRequest + * @static + * @param {google.cloud.gaming.v1.IListRealmsRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.ListRealmsRequest} ListRealmsRequest instance + */ + ListRealmsRequest.create = function create(properties) { + return new ListRealmsRequest(properties); + }; + + /** + * Encodes the specified ListRealmsRequest message. Does not implicitly {@link google.cloud.gaming.v1.ListRealmsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.ListRealmsRequest + * @static + * @param {google.cloud.gaming.v1.IListRealmsRequest} message ListRealmsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRealmsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListRealmsRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.ListRealmsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.ListRealmsRequest + * @static + * @param {google.cloud.gaming.v1.IListRealmsRequest} message ListRealmsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRealmsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRealmsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.ListRealmsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.ListRealmsRequest} ListRealmsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRealmsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.ListRealmsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRealmsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.ListRealmsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.ListRealmsRequest} ListRealmsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRealmsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRealmsRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.ListRealmsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRealmsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListRealmsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.ListRealmsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.ListRealmsRequest} ListRealmsRequest + */ + ListRealmsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.ListRealmsRequest) + return object; + var message = new $root.google.cloud.gaming.v1.ListRealmsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListRealmsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.ListRealmsRequest + * @static + * @param {google.cloud.gaming.v1.ListRealmsRequest} message ListRealmsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRealmsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListRealmsRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.ListRealmsRequest + * @instance + * @returns {Object.} JSON object + */ + ListRealmsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRealmsRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.ListRealmsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRealmsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.ListRealmsRequest"; + }; + + return ListRealmsRequest; + })(); + + v1.ListRealmsResponse = (function() { + + /** + * Properties of a ListRealmsResponse. + * @memberof google.cloud.gaming.v1 + * @interface IListRealmsResponse + * @property {Array.|null} [realms] ListRealmsResponse realms + * @property {string|null} [nextPageToken] ListRealmsResponse nextPageToken + * @property {Array.|null} [unreachable] ListRealmsResponse unreachable + */ + + /** + * Constructs a new ListRealmsResponse. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a ListRealmsResponse. + * @implements IListRealmsResponse + * @constructor + * @param {google.cloud.gaming.v1.IListRealmsResponse=} [properties] Properties to set + */ + function ListRealmsResponse(properties) { + this.realms = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRealmsResponse realms. + * @member {Array.} realms + * @memberof google.cloud.gaming.v1.ListRealmsResponse + * @instance + */ + ListRealmsResponse.prototype.realms = $util.emptyArray; + + /** + * ListRealmsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.gaming.v1.ListRealmsResponse + * @instance + */ + ListRealmsResponse.prototype.nextPageToken = ""; + + /** + * ListRealmsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.gaming.v1.ListRealmsResponse + * @instance + */ + ListRealmsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListRealmsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.ListRealmsResponse + * @static + * @param {google.cloud.gaming.v1.IListRealmsResponse=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.ListRealmsResponse} ListRealmsResponse instance + */ + ListRealmsResponse.create = function create(properties) { + return new ListRealmsResponse(properties); + }; + + /** + * Encodes the specified ListRealmsResponse message. Does not implicitly {@link google.cloud.gaming.v1.ListRealmsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.ListRealmsResponse + * @static + * @param {google.cloud.gaming.v1.IListRealmsResponse} message ListRealmsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRealmsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.realms != null && message.realms.length) + for (var i = 0; i < message.realms.length; ++i) + $root.google.cloud.gaming.v1.Realm.encode(message.realms[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListRealmsResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.ListRealmsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.ListRealmsResponse + * @static + * @param {google.cloud.gaming.v1.IListRealmsResponse} message ListRealmsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRealmsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRealmsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.ListRealmsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.ListRealmsResponse} ListRealmsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRealmsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.ListRealmsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.realms && message.realms.length)) + message.realms = []; + message.realms.push($root.google.cloud.gaming.v1.Realm.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRealmsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.ListRealmsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.ListRealmsResponse} ListRealmsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRealmsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRealmsResponse message. + * @function verify + * @memberof google.cloud.gaming.v1.ListRealmsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRealmsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.realms != null && message.hasOwnProperty("realms")) { + if (!Array.isArray(message.realms)) + return "realms: array expected"; + for (var i = 0; i < message.realms.length; ++i) { + var error = $root.google.cloud.gaming.v1.Realm.verify(message.realms[i]); + if (error) + return "realms." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListRealmsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.ListRealmsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.ListRealmsResponse} ListRealmsResponse + */ + ListRealmsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.ListRealmsResponse) + return object; + var message = new $root.google.cloud.gaming.v1.ListRealmsResponse(); + if (object.realms) { + if (!Array.isArray(object.realms)) + throw TypeError(".google.cloud.gaming.v1.ListRealmsResponse.realms: array expected"); + message.realms = []; + for (var i = 0; i < object.realms.length; ++i) { + if (typeof object.realms[i] !== "object") + throw TypeError(".google.cloud.gaming.v1.ListRealmsResponse.realms: object expected"); + message.realms[i] = $root.google.cloud.gaming.v1.Realm.fromObject(object.realms[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.gaming.v1.ListRealmsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListRealmsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.ListRealmsResponse + * @static + * @param {google.cloud.gaming.v1.ListRealmsResponse} message ListRealmsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRealmsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.realms = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.realms && message.realms.length) { + object.realms = []; + for (var j = 0; j < message.realms.length; ++j) + object.realms[j] = $root.google.cloud.gaming.v1.Realm.toObject(message.realms[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListRealmsResponse to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.ListRealmsResponse + * @instance + * @returns {Object.} JSON object + */ + ListRealmsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRealmsResponse + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.ListRealmsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRealmsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.ListRealmsResponse"; + }; + + return ListRealmsResponse; + })(); + + v1.GetRealmRequest = (function() { + + /** + * Properties of a GetRealmRequest. + * @memberof google.cloud.gaming.v1 + * @interface IGetRealmRequest + * @property {string|null} [name] GetRealmRequest name + */ + + /** + * Constructs a new GetRealmRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a GetRealmRequest. + * @implements IGetRealmRequest + * @constructor + * @param {google.cloud.gaming.v1.IGetRealmRequest=} [properties] Properties to set + */ + function GetRealmRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRealmRequest name. + * @member {string} name + * @memberof google.cloud.gaming.v1.GetRealmRequest + * @instance + */ + GetRealmRequest.prototype.name = ""; + + /** + * Creates a new GetRealmRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.GetRealmRequest + * @static + * @param {google.cloud.gaming.v1.IGetRealmRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.GetRealmRequest} GetRealmRequest instance + */ + GetRealmRequest.create = function create(properties) { + return new GetRealmRequest(properties); + }; + + /** + * Encodes the specified GetRealmRequest message. Does not implicitly {@link google.cloud.gaming.v1.GetRealmRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.GetRealmRequest + * @static + * @param {google.cloud.gaming.v1.IGetRealmRequest} message GetRealmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRealmRequest.encode = function encode(message, writer) { + 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 GetRealmRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.GetRealmRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.GetRealmRequest + * @static + * @param {google.cloud.gaming.v1.IGetRealmRequest} message GetRealmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRealmRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRealmRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.GetRealmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.GetRealmRequest} GetRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRealmRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.GetRealmRequest(); + 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 GetRealmRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.GetRealmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.GetRealmRequest} GetRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRealmRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRealmRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.GetRealmRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRealmRequest.verify = function verify(message) { + if (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 GetRealmRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.GetRealmRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.GetRealmRequest} GetRealmRequest + */ + GetRealmRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.GetRealmRequest) + return object; + var message = new $root.google.cloud.gaming.v1.GetRealmRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetRealmRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.GetRealmRequest + * @static + * @param {google.cloud.gaming.v1.GetRealmRequest} message GetRealmRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRealmRequest.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 GetRealmRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.GetRealmRequest + * @instance + * @returns {Object.} JSON object + */ + GetRealmRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetRealmRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.GetRealmRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetRealmRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.GetRealmRequest"; + }; + + return GetRealmRequest; + })(); + + v1.CreateRealmRequest = (function() { + + /** + * Properties of a CreateRealmRequest. + * @memberof google.cloud.gaming.v1 + * @interface ICreateRealmRequest + * @property {string|null} [parent] CreateRealmRequest parent + * @property {string|null} [realmId] CreateRealmRequest realmId + * @property {google.cloud.gaming.v1.IRealm|null} [realm] CreateRealmRequest realm + */ + + /** + * Constructs a new CreateRealmRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a CreateRealmRequest. + * @implements ICreateRealmRequest + * @constructor + * @param {google.cloud.gaming.v1.ICreateRealmRequest=} [properties] Properties to set + */ + function CreateRealmRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateRealmRequest parent. + * @member {string} parent + * @memberof google.cloud.gaming.v1.CreateRealmRequest + * @instance + */ + CreateRealmRequest.prototype.parent = ""; + + /** + * CreateRealmRequest realmId. + * @member {string} realmId + * @memberof google.cloud.gaming.v1.CreateRealmRequest + * @instance + */ + CreateRealmRequest.prototype.realmId = ""; + + /** + * CreateRealmRequest realm. + * @member {google.cloud.gaming.v1.IRealm|null|undefined} realm + * @memberof google.cloud.gaming.v1.CreateRealmRequest + * @instance + */ + CreateRealmRequest.prototype.realm = null; + + /** + * Creates a new CreateRealmRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.CreateRealmRequest + * @static + * @param {google.cloud.gaming.v1.ICreateRealmRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.CreateRealmRequest} CreateRealmRequest instance + */ + CreateRealmRequest.create = function create(properties) { + return new CreateRealmRequest(properties); + }; + + /** + * Encodes the specified CreateRealmRequest message. Does not implicitly {@link google.cloud.gaming.v1.CreateRealmRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.CreateRealmRequest + * @static + * @param {google.cloud.gaming.v1.ICreateRealmRequest} message CreateRealmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRealmRequest.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.realmId != null && Object.hasOwnProperty.call(message, "realmId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.realmId); + if (message.realm != null && Object.hasOwnProperty.call(message, "realm")) + $root.google.cloud.gaming.v1.Realm.encode(message.realm, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateRealmRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.CreateRealmRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.CreateRealmRequest + * @static + * @param {google.cloud.gaming.v1.ICreateRealmRequest} message CreateRealmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRealmRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateRealmRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.CreateRealmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.CreateRealmRequest} CreateRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRealmRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.CreateRealmRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.realmId = reader.string(); + break; + } + case 3: { + message.realm = $root.google.cloud.gaming.v1.Realm.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateRealmRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.CreateRealmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.CreateRealmRequest} CreateRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRealmRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateRealmRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.CreateRealmRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateRealmRequest.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.realmId != null && message.hasOwnProperty("realmId")) + if (!$util.isString(message.realmId)) + return "realmId: string expected"; + if (message.realm != null && message.hasOwnProperty("realm")) { + var error = $root.google.cloud.gaming.v1.Realm.verify(message.realm); + if (error) + return "realm." + error; + } + return null; + }; + + /** + * Creates a CreateRealmRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.CreateRealmRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.CreateRealmRequest} CreateRealmRequest + */ + CreateRealmRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.CreateRealmRequest) + return object; + var message = new $root.google.cloud.gaming.v1.CreateRealmRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.realmId != null) + message.realmId = String(object.realmId); + if (object.realm != null) { + if (typeof object.realm !== "object") + throw TypeError(".google.cloud.gaming.v1.CreateRealmRequest.realm: object expected"); + message.realm = $root.google.cloud.gaming.v1.Realm.fromObject(object.realm); + } + return message; + }; + + /** + * Creates a plain object from a CreateRealmRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.CreateRealmRequest + * @static + * @param {google.cloud.gaming.v1.CreateRealmRequest} message CreateRealmRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateRealmRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.realmId = ""; + object.realm = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.realmId != null && message.hasOwnProperty("realmId")) + object.realmId = message.realmId; + if (message.realm != null && message.hasOwnProperty("realm")) + object.realm = $root.google.cloud.gaming.v1.Realm.toObject(message.realm, options); + return object; + }; + + /** + * Converts this CreateRealmRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.CreateRealmRequest + * @instance + * @returns {Object.} JSON object + */ + CreateRealmRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateRealmRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.CreateRealmRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateRealmRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.CreateRealmRequest"; + }; + + return CreateRealmRequest; + })(); + + v1.DeleteRealmRequest = (function() { + + /** + * Properties of a DeleteRealmRequest. + * @memberof google.cloud.gaming.v1 + * @interface IDeleteRealmRequest + * @property {string|null} [name] DeleteRealmRequest name + */ + + /** + * Constructs a new DeleteRealmRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a DeleteRealmRequest. + * @implements IDeleteRealmRequest + * @constructor + * @param {google.cloud.gaming.v1.IDeleteRealmRequest=} [properties] Properties to set + */ + function DeleteRealmRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRealmRequest name. + * @member {string} name + * @memberof google.cloud.gaming.v1.DeleteRealmRequest + * @instance + */ + DeleteRealmRequest.prototype.name = ""; + + /** + * Creates a new DeleteRealmRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.DeleteRealmRequest + * @static + * @param {google.cloud.gaming.v1.IDeleteRealmRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.DeleteRealmRequest} DeleteRealmRequest instance + */ + DeleteRealmRequest.create = function create(properties) { + return new DeleteRealmRequest(properties); + }; + + /** + * Encodes the specified DeleteRealmRequest message. Does not implicitly {@link google.cloud.gaming.v1.DeleteRealmRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.DeleteRealmRequest + * @static + * @param {google.cloud.gaming.v1.IDeleteRealmRequest} message DeleteRealmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRealmRequest.encode = function encode(message, writer) { + 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 DeleteRealmRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.DeleteRealmRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.DeleteRealmRequest + * @static + * @param {google.cloud.gaming.v1.IDeleteRealmRequest} message DeleteRealmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRealmRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRealmRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.DeleteRealmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.DeleteRealmRequest} DeleteRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRealmRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.DeleteRealmRequest(); + 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 DeleteRealmRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.DeleteRealmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.DeleteRealmRequest} DeleteRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRealmRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRealmRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.DeleteRealmRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRealmRequest.verify = function verify(message) { + if (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 DeleteRealmRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.DeleteRealmRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.DeleteRealmRequest} DeleteRealmRequest + */ + DeleteRealmRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.DeleteRealmRequest) + return object; + var message = new $root.google.cloud.gaming.v1.DeleteRealmRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteRealmRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.DeleteRealmRequest + * @static + * @param {google.cloud.gaming.v1.DeleteRealmRequest} message DeleteRealmRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRealmRequest.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 DeleteRealmRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.DeleteRealmRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRealmRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteRealmRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.DeleteRealmRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteRealmRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.DeleteRealmRequest"; + }; + + return DeleteRealmRequest; + })(); + + v1.UpdateRealmRequest = (function() { + + /** + * Properties of an UpdateRealmRequest. + * @memberof google.cloud.gaming.v1 + * @interface IUpdateRealmRequest + * @property {google.cloud.gaming.v1.IRealm|null} [realm] UpdateRealmRequest realm + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateRealmRequest updateMask + */ + + /** + * Constructs a new UpdateRealmRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents an UpdateRealmRequest. + * @implements IUpdateRealmRequest + * @constructor + * @param {google.cloud.gaming.v1.IUpdateRealmRequest=} [properties] Properties to set + */ + function UpdateRealmRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateRealmRequest realm. + * @member {google.cloud.gaming.v1.IRealm|null|undefined} realm + * @memberof google.cloud.gaming.v1.UpdateRealmRequest + * @instance + */ + UpdateRealmRequest.prototype.realm = null; + + /** + * UpdateRealmRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.gaming.v1.UpdateRealmRequest + * @instance + */ + UpdateRealmRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateRealmRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.UpdateRealmRequest + * @static + * @param {google.cloud.gaming.v1.IUpdateRealmRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.UpdateRealmRequest} UpdateRealmRequest instance + */ + UpdateRealmRequest.create = function create(properties) { + return new UpdateRealmRequest(properties); + }; + + /** + * Encodes the specified UpdateRealmRequest message. Does not implicitly {@link google.cloud.gaming.v1.UpdateRealmRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.UpdateRealmRequest + * @static + * @param {google.cloud.gaming.v1.IUpdateRealmRequest} message UpdateRealmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRealmRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.realm != null && Object.hasOwnProperty.call(message, "realm")) + $root.google.cloud.gaming.v1.Realm.encode(message.realm, 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 UpdateRealmRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.UpdateRealmRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.UpdateRealmRequest + * @static + * @param {google.cloud.gaming.v1.IUpdateRealmRequest} message UpdateRealmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRealmRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateRealmRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.UpdateRealmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.UpdateRealmRequest} UpdateRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRealmRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.UpdateRealmRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.realm = $root.google.cloud.gaming.v1.Realm.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 UpdateRealmRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.UpdateRealmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.UpdateRealmRequest} UpdateRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRealmRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateRealmRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.UpdateRealmRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateRealmRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.realm != null && message.hasOwnProperty("realm")) { + var error = $root.google.cloud.gaming.v1.Realm.verify(message.realm); + if (error) + return "realm." + 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 UpdateRealmRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.UpdateRealmRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.UpdateRealmRequest} UpdateRealmRequest + */ + UpdateRealmRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.UpdateRealmRequest) + return object; + var message = new $root.google.cloud.gaming.v1.UpdateRealmRequest(); + if (object.realm != null) { + if (typeof object.realm !== "object") + throw TypeError(".google.cloud.gaming.v1.UpdateRealmRequest.realm: object expected"); + message.realm = $root.google.cloud.gaming.v1.Realm.fromObject(object.realm); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.gaming.v1.UpdateRealmRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateRealmRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.UpdateRealmRequest + * @static + * @param {google.cloud.gaming.v1.UpdateRealmRequest} message UpdateRealmRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateRealmRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.realm = null; + object.updateMask = null; + } + if (message.realm != null && message.hasOwnProperty("realm")) + object.realm = $root.google.cloud.gaming.v1.Realm.toObject(message.realm, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateRealmRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.UpdateRealmRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateRealmRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateRealmRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.UpdateRealmRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateRealmRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.UpdateRealmRequest"; + }; + + return UpdateRealmRequest; + })(); + + v1.PreviewRealmUpdateRequest = (function() { + + /** + * Properties of a PreviewRealmUpdateRequest. + * @memberof google.cloud.gaming.v1 + * @interface IPreviewRealmUpdateRequest + * @property {google.cloud.gaming.v1.IRealm|null} [realm] PreviewRealmUpdateRequest realm + * @property {google.protobuf.IFieldMask|null} [updateMask] PreviewRealmUpdateRequest updateMask + * @property {google.protobuf.ITimestamp|null} [previewTime] PreviewRealmUpdateRequest previewTime + */ + + /** + * Constructs a new PreviewRealmUpdateRequest. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a PreviewRealmUpdateRequest. + * @implements IPreviewRealmUpdateRequest + * @constructor + * @param {google.cloud.gaming.v1.IPreviewRealmUpdateRequest=} [properties] Properties to set + */ + function PreviewRealmUpdateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreviewRealmUpdateRequest realm. + * @member {google.cloud.gaming.v1.IRealm|null|undefined} realm + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateRequest + * @instance + */ + PreviewRealmUpdateRequest.prototype.realm = null; + + /** + * PreviewRealmUpdateRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateRequest + * @instance + */ + PreviewRealmUpdateRequest.prototype.updateMask = null; + + /** + * PreviewRealmUpdateRequest previewTime. + * @member {google.protobuf.ITimestamp|null|undefined} previewTime + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateRequest + * @instance + */ + PreviewRealmUpdateRequest.prototype.previewTime = null; + + /** + * Creates a new PreviewRealmUpdateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateRequest + * @static + * @param {google.cloud.gaming.v1.IPreviewRealmUpdateRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.PreviewRealmUpdateRequest} PreviewRealmUpdateRequest instance + */ + PreviewRealmUpdateRequest.create = function create(properties) { + return new PreviewRealmUpdateRequest(properties); + }; + + /** + * Encodes the specified PreviewRealmUpdateRequest message. Does not implicitly {@link google.cloud.gaming.v1.PreviewRealmUpdateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateRequest + * @static + * @param {google.cloud.gaming.v1.IPreviewRealmUpdateRequest} message PreviewRealmUpdateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewRealmUpdateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.realm != null && Object.hasOwnProperty.call(message, "realm")) + $root.google.cloud.gaming.v1.Realm.encode(message.realm, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.previewTime != null && Object.hasOwnProperty.call(message, "previewTime")) + $root.google.protobuf.Timestamp.encode(message.previewTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreviewRealmUpdateRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.PreviewRealmUpdateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateRequest + * @static + * @param {google.cloud.gaming.v1.IPreviewRealmUpdateRequest} message PreviewRealmUpdateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewRealmUpdateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreviewRealmUpdateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.PreviewRealmUpdateRequest} PreviewRealmUpdateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewRealmUpdateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.PreviewRealmUpdateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.realm = $root.google.cloud.gaming.v1.Realm.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.previewTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreviewRealmUpdateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.PreviewRealmUpdateRequest} PreviewRealmUpdateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewRealmUpdateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreviewRealmUpdateRequest message. + * @function verify + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreviewRealmUpdateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.realm != null && message.hasOwnProperty("realm")) { + var error = $root.google.cloud.gaming.v1.Realm.verify(message.realm); + if (error) + return "realm." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.previewTime != null && message.hasOwnProperty("previewTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.previewTime); + if (error) + return "previewTime." + error; + } + return null; + }; + + /** + * Creates a PreviewRealmUpdateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.PreviewRealmUpdateRequest} PreviewRealmUpdateRequest + */ + PreviewRealmUpdateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.PreviewRealmUpdateRequest) + return object; + var message = new $root.google.cloud.gaming.v1.PreviewRealmUpdateRequest(); + if (object.realm != null) { + if (typeof object.realm !== "object") + throw TypeError(".google.cloud.gaming.v1.PreviewRealmUpdateRequest.realm: object expected"); + message.realm = $root.google.cloud.gaming.v1.Realm.fromObject(object.realm); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.gaming.v1.PreviewRealmUpdateRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.previewTime != null) { + if (typeof object.previewTime !== "object") + throw TypeError(".google.cloud.gaming.v1.PreviewRealmUpdateRequest.previewTime: object expected"); + message.previewTime = $root.google.protobuf.Timestamp.fromObject(object.previewTime); + } + return message; + }; + + /** + * Creates a plain object from a PreviewRealmUpdateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateRequest + * @static + * @param {google.cloud.gaming.v1.PreviewRealmUpdateRequest} message PreviewRealmUpdateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreviewRealmUpdateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.realm = null; + object.updateMask = null; + object.previewTime = null; + } + if (message.realm != null && message.hasOwnProperty("realm")) + object.realm = $root.google.cloud.gaming.v1.Realm.toObject(message.realm, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.previewTime != null && message.hasOwnProperty("previewTime")) + object.previewTime = $root.google.protobuf.Timestamp.toObject(message.previewTime, options); + return object; + }; + + /** + * Converts this PreviewRealmUpdateRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateRequest + * @instance + * @returns {Object.} JSON object + */ + PreviewRealmUpdateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PreviewRealmUpdateRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PreviewRealmUpdateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.PreviewRealmUpdateRequest"; + }; + + return PreviewRealmUpdateRequest; + })(); + + v1.PreviewRealmUpdateResponse = (function() { + + /** + * Properties of a PreviewRealmUpdateResponse. + * @memberof google.cloud.gaming.v1 + * @interface IPreviewRealmUpdateResponse + * @property {string|null} [etag] PreviewRealmUpdateResponse etag + * @property {google.cloud.gaming.v1.ITargetState|null} [targetState] PreviewRealmUpdateResponse targetState + */ + + /** + * Constructs a new PreviewRealmUpdateResponse. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a PreviewRealmUpdateResponse. + * @implements IPreviewRealmUpdateResponse + * @constructor + * @param {google.cloud.gaming.v1.IPreviewRealmUpdateResponse=} [properties] Properties to set + */ + function PreviewRealmUpdateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreviewRealmUpdateResponse etag. + * @member {string} etag + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateResponse + * @instance + */ + PreviewRealmUpdateResponse.prototype.etag = ""; + + /** + * PreviewRealmUpdateResponse targetState. + * @member {google.cloud.gaming.v1.ITargetState|null|undefined} targetState + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateResponse + * @instance + */ + PreviewRealmUpdateResponse.prototype.targetState = null; + + /** + * Creates a new PreviewRealmUpdateResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateResponse + * @static + * @param {google.cloud.gaming.v1.IPreviewRealmUpdateResponse=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.PreviewRealmUpdateResponse} PreviewRealmUpdateResponse instance + */ + PreviewRealmUpdateResponse.create = function create(properties) { + return new PreviewRealmUpdateResponse(properties); + }; + + /** + * Encodes the specified PreviewRealmUpdateResponse message. Does not implicitly {@link google.cloud.gaming.v1.PreviewRealmUpdateResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateResponse + * @static + * @param {google.cloud.gaming.v1.IPreviewRealmUpdateResponse} message PreviewRealmUpdateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewRealmUpdateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.targetState != null && Object.hasOwnProperty.call(message, "targetState")) + $root.google.cloud.gaming.v1.TargetState.encode(message.targetState, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreviewRealmUpdateResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.PreviewRealmUpdateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateResponse + * @static + * @param {google.cloud.gaming.v1.IPreviewRealmUpdateResponse} message PreviewRealmUpdateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewRealmUpdateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreviewRealmUpdateResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.PreviewRealmUpdateResponse} PreviewRealmUpdateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewRealmUpdateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.PreviewRealmUpdateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.etag = reader.string(); + break; + } + case 3: { + message.targetState = $root.google.cloud.gaming.v1.TargetState.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreviewRealmUpdateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.PreviewRealmUpdateResponse} PreviewRealmUpdateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewRealmUpdateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreviewRealmUpdateResponse message. + * @function verify + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreviewRealmUpdateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.targetState != null && message.hasOwnProperty("targetState")) { + var error = $root.google.cloud.gaming.v1.TargetState.verify(message.targetState); + if (error) + return "targetState." + error; + } + return null; + }; + + /** + * Creates a PreviewRealmUpdateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.PreviewRealmUpdateResponse} PreviewRealmUpdateResponse + */ + PreviewRealmUpdateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.PreviewRealmUpdateResponse) + return object; + var message = new $root.google.cloud.gaming.v1.PreviewRealmUpdateResponse(); + if (object.etag != null) + message.etag = String(object.etag); + if (object.targetState != null) { + if (typeof object.targetState !== "object") + throw TypeError(".google.cloud.gaming.v1.PreviewRealmUpdateResponse.targetState: object expected"); + message.targetState = $root.google.cloud.gaming.v1.TargetState.fromObject(object.targetState); + } + return message; + }; + + /** + * Creates a plain object from a PreviewRealmUpdateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateResponse + * @static + * @param {google.cloud.gaming.v1.PreviewRealmUpdateResponse} message PreviewRealmUpdateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreviewRealmUpdateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.etag = ""; + object.targetState = null; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.targetState != null && message.hasOwnProperty("targetState")) + object.targetState = $root.google.cloud.gaming.v1.TargetState.toObject(message.targetState, options); + return object; + }; + + /** + * Converts this PreviewRealmUpdateResponse to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateResponse + * @instance + * @returns {Object.} JSON object + */ + PreviewRealmUpdateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PreviewRealmUpdateResponse + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.PreviewRealmUpdateResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PreviewRealmUpdateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.PreviewRealmUpdateResponse"; + }; + + return PreviewRealmUpdateResponse; + })(); + + v1.Realm = (function() { + + /** + * Properties of a Realm. + * @memberof google.cloud.gaming.v1 + * @interface IRealm + * @property {string|null} [name] Realm name + * @property {google.protobuf.ITimestamp|null} [createTime] Realm createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Realm updateTime + * @property {Object.|null} [labels] Realm labels + * @property {string|null} [timeZone] Realm timeZone + * @property {string|null} [etag] Realm etag + * @property {string|null} [description] Realm description + */ + + /** + * Constructs a new Realm. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a Realm. + * @implements IRealm + * @constructor + * @param {google.cloud.gaming.v1.IRealm=} [properties] Properties to set + */ + function Realm(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]]; + } + + /** + * Realm name. + * @member {string} name + * @memberof google.cloud.gaming.v1.Realm + * @instance + */ + Realm.prototype.name = ""; + + /** + * Realm createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.gaming.v1.Realm + * @instance + */ + Realm.prototype.createTime = null; + + /** + * Realm updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.gaming.v1.Realm + * @instance + */ + Realm.prototype.updateTime = null; + + /** + * Realm labels. + * @member {Object.} labels + * @memberof google.cloud.gaming.v1.Realm + * @instance + */ + Realm.prototype.labels = $util.emptyObject; + + /** + * Realm timeZone. + * @member {string} timeZone + * @memberof google.cloud.gaming.v1.Realm + * @instance + */ + Realm.prototype.timeZone = ""; + + /** + * Realm etag. + * @member {string} etag + * @memberof google.cloud.gaming.v1.Realm + * @instance + */ + Realm.prototype.etag = ""; + + /** + * Realm description. + * @member {string} description + * @memberof google.cloud.gaming.v1.Realm + * @instance + */ + Realm.prototype.description = ""; + + /** + * Creates a new Realm instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1.Realm + * @static + * @param {google.cloud.gaming.v1.IRealm=} [properties] Properties to set + * @returns {google.cloud.gaming.v1.Realm} Realm instance + */ + Realm.create = function create(properties) { + return new Realm(properties); + }; + + /** + * Encodes the specified Realm message. Does not implicitly {@link google.cloud.gaming.v1.Realm.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1.Realm + * @static + * @param {google.cloud.gaming.v1.IRealm} message Realm message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Realm.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.timeZone); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.description); + return writer; + }; + + /** + * Encodes the specified Realm message, length delimited. Does not implicitly {@link google.cloud.gaming.v1.Realm.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1.Realm + * @static + * @param {google.cloud.gaming.v1.IRealm} message Realm message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Realm.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Realm message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1.Realm + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1.Realm} Realm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Realm.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1.Realm(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.timeZone = reader.string(); + break; + } + case 7: { + message.etag = reader.string(); + break; + } + case 8: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Realm message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1.Realm + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1.Realm} Realm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Realm.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Realm message. + * @function verify + * @memberof google.cloud.gaming.v1.Realm + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Realm.verify = function verify(message) { + if (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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a Realm message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1.Realm + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1.Realm} Realm + */ + Realm.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1.Realm) + return object; + var message = new $root.google.cloud.gaming.v1.Realm(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.gaming.v1.Realm.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.gaming.v1.Realm.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.gaming.v1.Realm.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.etag != null) + message.etag = String(object.etag); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a Realm message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1.Realm + * @static + * @param {google.cloud.gaming.v1.Realm} message Realm + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Realm.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.timeZone = ""; + object.etag = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this Realm to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1.Realm + * @instance + * @returns {Object.} JSON object + */ + Realm.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Realm + * @function getTypeUrl + * @memberof google.cloud.gaming.v1.Realm + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Realm.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1.Realm"; + }; + + return Realm; + })(); + + v1.RealmsService = (function() { + + /** + * Constructs a new RealmsService service. + * @memberof google.cloud.gaming.v1 + * @classdesc Represents a RealmsService + * @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 RealmsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RealmsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RealmsService; + + /** + * Creates new RealmsService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.gaming.v1.RealmsService + * @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 {RealmsService} RPC service. Useful where requests and/or responses are streamed. + */ + RealmsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.gaming.v1.RealmsService|listRealms}. + * @memberof google.cloud.gaming.v1.RealmsService + * @typedef ListRealmsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1.ListRealmsResponse} [response] ListRealmsResponse + */ + + /** + * Calls ListRealms. + * @function listRealms + * @memberof google.cloud.gaming.v1.RealmsService + * @instance + * @param {google.cloud.gaming.v1.IListRealmsRequest} request ListRealmsRequest message or plain object + * @param {google.cloud.gaming.v1.RealmsService.ListRealmsCallback} callback Node-style callback called with the error, if any, and ListRealmsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RealmsService.prototype.listRealms = function listRealms(request, callback) { + return this.rpcCall(listRealms, $root.google.cloud.gaming.v1.ListRealmsRequest, $root.google.cloud.gaming.v1.ListRealmsResponse, request, callback); + }, "name", { value: "ListRealms" }); + + /** + * Calls ListRealms. + * @function listRealms + * @memberof google.cloud.gaming.v1.RealmsService + * @instance + * @param {google.cloud.gaming.v1.IListRealmsRequest} request ListRealmsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.RealmsService|getRealm}. + * @memberof google.cloud.gaming.v1.RealmsService + * @typedef GetRealmCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1.Realm} [response] Realm + */ + + /** + * Calls GetRealm. + * @function getRealm + * @memberof google.cloud.gaming.v1.RealmsService + * @instance + * @param {google.cloud.gaming.v1.IGetRealmRequest} request GetRealmRequest message or plain object + * @param {google.cloud.gaming.v1.RealmsService.GetRealmCallback} callback Node-style callback called with the error, if any, and Realm + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RealmsService.prototype.getRealm = function getRealm(request, callback) { + return this.rpcCall(getRealm, $root.google.cloud.gaming.v1.GetRealmRequest, $root.google.cloud.gaming.v1.Realm, request, callback); + }, "name", { value: "GetRealm" }); + + /** + * Calls GetRealm. + * @function getRealm + * @memberof google.cloud.gaming.v1.RealmsService + * @instance + * @param {google.cloud.gaming.v1.IGetRealmRequest} request GetRealmRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.RealmsService|createRealm}. + * @memberof google.cloud.gaming.v1.RealmsService + * @typedef CreateRealmCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateRealm. + * @function createRealm + * @memberof google.cloud.gaming.v1.RealmsService + * @instance + * @param {google.cloud.gaming.v1.ICreateRealmRequest} request CreateRealmRequest message or plain object + * @param {google.cloud.gaming.v1.RealmsService.CreateRealmCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RealmsService.prototype.createRealm = function createRealm(request, callback) { + return this.rpcCall(createRealm, $root.google.cloud.gaming.v1.CreateRealmRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateRealm" }); + + /** + * Calls CreateRealm. + * @function createRealm + * @memberof google.cloud.gaming.v1.RealmsService + * @instance + * @param {google.cloud.gaming.v1.ICreateRealmRequest} request CreateRealmRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.RealmsService|deleteRealm}. + * @memberof google.cloud.gaming.v1.RealmsService + * @typedef DeleteRealmCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteRealm. + * @function deleteRealm + * @memberof google.cloud.gaming.v1.RealmsService + * @instance + * @param {google.cloud.gaming.v1.IDeleteRealmRequest} request DeleteRealmRequest message or plain object + * @param {google.cloud.gaming.v1.RealmsService.DeleteRealmCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RealmsService.prototype.deleteRealm = function deleteRealm(request, callback) { + return this.rpcCall(deleteRealm, $root.google.cloud.gaming.v1.DeleteRealmRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteRealm" }); + + /** + * Calls DeleteRealm. + * @function deleteRealm + * @memberof google.cloud.gaming.v1.RealmsService + * @instance + * @param {google.cloud.gaming.v1.IDeleteRealmRequest} request DeleteRealmRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.RealmsService|updateRealm}. + * @memberof google.cloud.gaming.v1.RealmsService + * @typedef UpdateRealmCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateRealm. + * @function updateRealm + * @memberof google.cloud.gaming.v1.RealmsService + * @instance + * @param {google.cloud.gaming.v1.IUpdateRealmRequest} request UpdateRealmRequest message or plain object + * @param {google.cloud.gaming.v1.RealmsService.UpdateRealmCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RealmsService.prototype.updateRealm = function updateRealm(request, callback) { + return this.rpcCall(updateRealm, $root.google.cloud.gaming.v1.UpdateRealmRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateRealm" }); + + /** + * Calls UpdateRealm. + * @function updateRealm + * @memberof google.cloud.gaming.v1.RealmsService + * @instance + * @param {google.cloud.gaming.v1.IUpdateRealmRequest} request UpdateRealmRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1.RealmsService|previewRealmUpdate}. + * @memberof google.cloud.gaming.v1.RealmsService + * @typedef PreviewRealmUpdateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1.PreviewRealmUpdateResponse} [response] PreviewRealmUpdateResponse + */ + + /** + * Calls PreviewRealmUpdate. + * @function previewRealmUpdate + * @memberof google.cloud.gaming.v1.RealmsService + * @instance + * @param {google.cloud.gaming.v1.IPreviewRealmUpdateRequest} request PreviewRealmUpdateRequest message or plain object + * @param {google.cloud.gaming.v1.RealmsService.PreviewRealmUpdateCallback} callback Node-style callback called with the error, if any, and PreviewRealmUpdateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RealmsService.prototype.previewRealmUpdate = function previewRealmUpdate(request, callback) { + return this.rpcCall(previewRealmUpdate, $root.google.cloud.gaming.v1.PreviewRealmUpdateRequest, $root.google.cloud.gaming.v1.PreviewRealmUpdateResponse, request, callback); + }, "name", { value: "PreviewRealmUpdate" }); + + /** + * Calls PreviewRealmUpdate. + * @function previewRealmUpdate + * @memberof google.cloud.gaming.v1.RealmsService + * @instance + * @param {google.cloud.gaming.v1.IPreviewRealmUpdateRequest} request PreviewRealmUpdateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RealmsService; + })(); + + return v1; + })(); + + gaming.v1beta = (function() { + + /** + * Namespace v1beta. + * @memberof google.cloud.gaming + * @namespace + */ + var v1beta = {}; + + v1beta.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.gaming.v1beta + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + * @property {Array.|null} [unreachable] OperationMetadata unreachable + * @property {Object.|null} [operationStatus] OperationMetadata operationStatus + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.gaming.v1beta.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + this.unreachable = []; + this.operationStatus = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.gaming.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.gaming.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.gaming.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.gaming.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.gaming.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.gaming.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.gaming.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * OperationMetadata unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.gaming.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.unreachable = $util.emptyArray; + + /** + * OperationMetadata operationStatus. + * @member {Object.} operationStatus + * @memberof google.cloud.gaming.v1beta.OperationMetadata + * @instance + */ + OperationMetadata.prototype.operationStatus = $util.emptyObject; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.OperationMetadata + * @static + * @param {google.cloud.gaming.v1beta.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.gaming.v1beta.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.OperationMetadata + * @static + * @param {google.cloud.gaming.v1beta.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.unreachable[i]); + if (message.operationStatus != null && Object.hasOwnProperty.call(message, "operationStatus")) + for (var keys = Object.keys(message.operationStatus), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.gaming.v1beta.OperationStatus.encode(message.operationStatus[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.OperationMetadata + * @static + * @param {google.cloud.gaming.v1beta.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.OperationMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + case 8: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + case 9: { + if (message.operationStatus === $util.emptyObject) + message.operationStatus = {}; + 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.gaming.v1beta.OperationStatus.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.operationStatus[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.gaming.v1beta.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + if (message.operationStatus != null && message.hasOwnProperty("operationStatus")) { + if (!$util.isObject(message.operationStatus)) + return "operationStatus: object expected"; + var key = Object.keys(message.operationStatus); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.gaming.v1beta.OperationStatus.verify(message.operationStatus[key[i]]); + if (error) + return "operationStatus." + error; + } + } + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.OperationMetadata) + return object; + var message = new $root.google.cloud.gaming.v1beta.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.gaming.v1beta.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.gaming.v1beta.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.gaming.v1beta.OperationMetadata.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + if (object.operationStatus) { + if (typeof object.operationStatus !== "object") + throw TypeError(".google.cloud.gaming.v1beta.OperationMetadata.operationStatus: object expected"); + message.operationStatus = {}; + for (var keys = Object.keys(object.operationStatus), i = 0; i < keys.length; ++i) { + if (typeof object.operationStatus[keys[i]] !== "object") + throw TypeError(".google.cloud.gaming.v1beta.OperationMetadata.operationStatus: object expected"); + message.operationStatus[keys[i]] = $root.google.cloud.gaming.v1beta.OperationStatus.fromObject(object.operationStatus[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.OperationMetadata + * @static + * @param {google.cloud.gaming.v1beta.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unreachable = []; + if (options.objects || options.defaults) + object.operationStatus = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + var keys2; + if (message.operationStatus && (keys2 = Object.keys(message.operationStatus)).length) { + object.operationStatus = {}; + for (var j = 0; j < keys2.length; ++j) + object.operationStatus[keys2[j]] = $root.google.cloud.gaming.v1beta.OperationStatus.toObject(message.operationStatus[keys2[j]], options); + } + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1beta.OperationStatus = (function() { + + /** + * Properties of an OperationStatus. + * @memberof google.cloud.gaming.v1beta + * @interface IOperationStatus + * @property {boolean|null} [done] OperationStatus done + * @property {google.cloud.gaming.v1beta.OperationStatus.ErrorCode|null} [errorCode] OperationStatus errorCode + * @property {string|null} [errorMessage] OperationStatus errorMessage + */ + + /** + * Constructs a new OperationStatus. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents an OperationStatus. + * @implements IOperationStatus + * @constructor + * @param {google.cloud.gaming.v1beta.IOperationStatus=} [properties] Properties to set + */ + function OperationStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationStatus done. + * @member {boolean} done + * @memberof google.cloud.gaming.v1beta.OperationStatus + * @instance + */ + OperationStatus.prototype.done = false; + + /** + * OperationStatus errorCode. + * @member {google.cloud.gaming.v1beta.OperationStatus.ErrorCode} errorCode + * @memberof google.cloud.gaming.v1beta.OperationStatus + * @instance + */ + OperationStatus.prototype.errorCode = 0; + + /** + * OperationStatus errorMessage. + * @member {string} errorMessage + * @memberof google.cloud.gaming.v1beta.OperationStatus + * @instance + */ + OperationStatus.prototype.errorMessage = ""; + + /** + * Creates a new OperationStatus instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.OperationStatus + * @static + * @param {google.cloud.gaming.v1beta.IOperationStatus=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.OperationStatus} OperationStatus instance + */ + OperationStatus.create = function create(properties) { + return new OperationStatus(properties); + }; + + /** + * Encodes the specified OperationStatus message. Does not implicitly {@link google.cloud.gaming.v1beta.OperationStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.OperationStatus + * @static + * @param {google.cloud.gaming.v1beta.IOperationStatus} message OperationStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.done != null && Object.hasOwnProperty.call(message, "done")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.done); + if (message.errorCode != null && Object.hasOwnProperty.call(message, "errorCode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.errorCode); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.errorMessage); + return writer; + }; + + /** + * Encodes the specified OperationStatus message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.OperationStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.OperationStatus + * @static + * @param {google.cloud.gaming.v1beta.IOperationStatus} message OperationStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.OperationStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.OperationStatus} OperationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.OperationStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.done = reader.bool(); + break; + } + case 2: { + message.errorCode = reader.int32(); + break; + } + case 3: { + message.errorMessage = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.OperationStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.OperationStatus} OperationStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationStatus message. + * @function verify + * @memberof google.cloud.gaming.v1beta.OperationStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.done != null && message.hasOwnProperty("done")) + if (typeof message.done !== "boolean") + return "done: boolean expected"; + if (message.errorCode != null && message.hasOwnProperty("errorCode")) + switch (message.errorCode) { + default: + return "errorCode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + return null; + }; + + /** + * Creates an OperationStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.OperationStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.OperationStatus} OperationStatus + */ + OperationStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.OperationStatus) + return object; + var message = new $root.google.cloud.gaming.v1beta.OperationStatus(); + if (object.done != null) + message.done = Boolean(object.done); + switch (object.errorCode) { + default: + if (typeof object.errorCode === "number") { + message.errorCode = object.errorCode; + break; + } + break; + case "ERROR_CODE_UNSPECIFIED": + case 0: + message.errorCode = 0; + break; + case "INTERNAL_ERROR": + case 1: + message.errorCode = 1; + break; + case "PERMISSION_DENIED": + case 2: + message.errorCode = 2; + break; + case "CLUSTER_CONNECTION": + case 3: + message.errorCode = 3; + break; + } + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); + return message; + }; + + /** + * Creates a plain object from an OperationStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.OperationStatus + * @static + * @param {google.cloud.gaming.v1beta.OperationStatus} message OperationStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.done = false; + object.errorCode = options.enums === String ? "ERROR_CODE_UNSPECIFIED" : 0; + object.errorMessage = ""; + } + if (message.done != null && message.hasOwnProperty("done")) + object.done = message.done; + if (message.errorCode != null && message.hasOwnProperty("errorCode")) + object.errorCode = options.enums === String ? $root.google.cloud.gaming.v1beta.OperationStatus.ErrorCode[message.errorCode] === undefined ? message.errorCode : $root.google.cloud.gaming.v1beta.OperationStatus.ErrorCode[message.errorCode] : message.errorCode; + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; + return object; + }; + + /** + * Converts this OperationStatus to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.OperationStatus + * @instance + * @returns {Object.} JSON object + */ + OperationStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationStatus + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.OperationStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.OperationStatus"; + }; + + /** + * ErrorCode enum. + * @name google.cloud.gaming.v1beta.OperationStatus.ErrorCode + * @enum {number} + * @property {number} ERROR_CODE_UNSPECIFIED=0 ERROR_CODE_UNSPECIFIED value + * @property {number} INTERNAL_ERROR=1 INTERNAL_ERROR value + * @property {number} PERMISSION_DENIED=2 PERMISSION_DENIED value + * @property {number} CLUSTER_CONNECTION=3 CLUSTER_CONNECTION value + */ + OperationStatus.ErrorCode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ERROR_CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INTERNAL_ERROR"] = 1; + values[valuesById[2] = "PERMISSION_DENIED"] = 2; + values[valuesById[3] = "CLUSTER_CONNECTION"] = 3; + return values; + })(); + + return OperationStatus; + })(); + + v1beta.LabelSelector = (function() { + + /** + * Properties of a LabelSelector. + * @memberof google.cloud.gaming.v1beta + * @interface ILabelSelector + * @property {Object.|null} [labels] LabelSelector labels + */ + + /** + * Constructs a new LabelSelector. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a LabelSelector. + * @implements ILabelSelector + * @constructor + * @param {google.cloud.gaming.v1beta.ILabelSelector=} [properties] Properties to set + */ + function LabelSelector(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]]; + } + + /** + * LabelSelector labels. + * @member {Object.} labels + * @memberof google.cloud.gaming.v1beta.LabelSelector + * @instance + */ + LabelSelector.prototype.labels = $util.emptyObject; + + /** + * Creates a new LabelSelector instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.LabelSelector + * @static + * @param {google.cloud.gaming.v1beta.ILabelSelector=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.LabelSelector} LabelSelector instance + */ + LabelSelector.create = function create(properties) { + return new LabelSelector(properties); + }; + + /** + * Encodes the specified LabelSelector message. Does not implicitly {@link google.cloud.gaming.v1beta.LabelSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.LabelSelector + * @static + * @param {google.cloud.gaming.v1beta.ILabelSelector} message LabelSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelSelector.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 LabelSelector message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.LabelSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.LabelSelector + * @static + * @param {google.cloud.gaming.v1beta.ILabelSelector} message LabelSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LabelSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LabelSelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.LabelSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.LabelSelector} LabelSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelSelector.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.LabelSelector(), 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 LabelSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.LabelSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.LabelSelector} LabelSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LabelSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LabelSelector message. + * @function verify + * @memberof google.cloud.gaming.v1beta.LabelSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LabelSelector.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 LabelSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.LabelSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.LabelSelector} LabelSelector + */ + LabelSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.LabelSelector) + return object; + var message = new $root.google.cloud.gaming.v1beta.LabelSelector(); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.gaming.v1beta.LabelSelector.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 LabelSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.LabelSelector + * @static + * @param {google.cloud.gaming.v1beta.LabelSelector} message LabelSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LabelSelector.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 LabelSelector to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.LabelSelector + * @instance + * @returns {Object.} JSON object + */ + LabelSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LabelSelector + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.LabelSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LabelSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.LabelSelector"; + }; + + return LabelSelector; + })(); + + v1beta.RealmSelector = (function() { + + /** + * Properties of a RealmSelector. + * @memberof google.cloud.gaming.v1beta + * @interface IRealmSelector + * @property {Array.|null} [realms] RealmSelector realms + */ + + /** + * Constructs a new RealmSelector. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a RealmSelector. + * @implements IRealmSelector + * @constructor + * @param {google.cloud.gaming.v1beta.IRealmSelector=} [properties] Properties to set + */ + function RealmSelector(properties) { + this.realms = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RealmSelector realms. + * @member {Array.} realms + * @memberof google.cloud.gaming.v1beta.RealmSelector + * @instance + */ + RealmSelector.prototype.realms = $util.emptyArray; + + /** + * Creates a new RealmSelector instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.RealmSelector + * @static + * @param {google.cloud.gaming.v1beta.IRealmSelector=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.RealmSelector} RealmSelector instance + */ + RealmSelector.create = function create(properties) { + return new RealmSelector(properties); + }; + + /** + * Encodes the specified RealmSelector message. Does not implicitly {@link google.cloud.gaming.v1beta.RealmSelector.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.RealmSelector + * @static + * @param {google.cloud.gaming.v1beta.IRealmSelector} message RealmSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmSelector.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.realms != null && message.realms.length) + for (var i = 0; i < message.realms.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.realms[i]); + return writer; + }; + + /** + * Encodes the specified RealmSelector message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.RealmSelector.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.RealmSelector + * @static + * @param {google.cloud.gaming.v1beta.IRealmSelector} message RealmSelector message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RealmSelector.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RealmSelector message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.RealmSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.RealmSelector} RealmSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmSelector.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.RealmSelector(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.realms && message.realms.length)) + message.realms = []; + message.realms.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RealmSelector message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.RealmSelector + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.RealmSelector} RealmSelector + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RealmSelector.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RealmSelector message. + * @function verify + * @memberof google.cloud.gaming.v1beta.RealmSelector + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RealmSelector.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.realms != null && message.hasOwnProperty("realms")) { + if (!Array.isArray(message.realms)) + return "realms: array expected"; + for (var i = 0; i < message.realms.length; ++i) + if (!$util.isString(message.realms[i])) + return "realms: string[] expected"; + } + return null; + }; + + /** + * Creates a RealmSelector message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.RealmSelector + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.RealmSelector} RealmSelector + */ + RealmSelector.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.RealmSelector) + return object; + var message = new $root.google.cloud.gaming.v1beta.RealmSelector(); + if (object.realms) { + if (!Array.isArray(object.realms)) + throw TypeError(".google.cloud.gaming.v1beta.RealmSelector.realms: array expected"); + message.realms = []; + for (var i = 0; i < object.realms.length; ++i) + message.realms[i] = String(object.realms[i]); + } + return message; + }; + + /** + * Creates a plain object from a RealmSelector message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.RealmSelector + * @static + * @param {google.cloud.gaming.v1beta.RealmSelector} message RealmSelector + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RealmSelector.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.realms = []; + if (message.realms && message.realms.length) { + object.realms = []; + for (var j = 0; j < message.realms.length; ++j) + object.realms[j] = message.realms[j]; + } + return object; + }; + + /** + * Converts this RealmSelector to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.RealmSelector + * @instance + * @returns {Object.} JSON object + */ + RealmSelector.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RealmSelector + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.RealmSelector + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RealmSelector.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.RealmSelector"; + }; + + return RealmSelector; + })(); + + v1beta.Schedule = (function() { + + /** + * Properties of a Schedule. + * @memberof google.cloud.gaming.v1beta + * @interface ISchedule + * @property {google.protobuf.ITimestamp|null} [startTime] Schedule startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Schedule endTime + * @property {google.protobuf.IDuration|null} [cronJobDuration] Schedule cronJobDuration + * @property {string|null} [cronSpec] Schedule cronSpec + */ + + /** + * Constructs a new Schedule. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a Schedule. + * @implements ISchedule + * @constructor + * @param {google.cloud.gaming.v1beta.ISchedule=} [properties] Properties to set + */ + function Schedule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Schedule startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.gaming.v1beta.Schedule + * @instance + */ + Schedule.prototype.startTime = null; + + /** + * Schedule endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.gaming.v1beta.Schedule + * @instance + */ + Schedule.prototype.endTime = null; + + /** + * Schedule cronJobDuration. + * @member {google.protobuf.IDuration|null|undefined} cronJobDuration + * @memberof google.cloud.gaming.v1beta.Schedule + * @instance + */ + Schedule.prototype.cronJobDuration = null; + + /** + * Schedule cronSpec. + * @member {string} cronSpec + * @memberof google.cloud.gaming.v1beta.Schedule + * @instance + */ + Schedule.prototype.cronSpec = ""; + + /** + * Creates a new Schedule instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.Schedule + * @static + * @param {google.cloud.gaming.v1beta.ISchedule=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.Schedule} Schedule instance + */ + Schedule.create = function create(properties) { + return new Schedule(properties); + }; + + /** + * Encodes the specified Schedule message. Does not implicitly {@link google.cloud.gaming.v1beta.Schedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.Schedule + * @static + * @param {google.cloud.gaming.v1beta.ISchedule} message Schedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cronJobDuration != null && Object.hasOwnProperty.call(message, "cronJobDuration")) + $root.google.protobuf.Duration.encode(message.cronJobDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cronSpec != null && Object.hasOwnProperty.call(message, "cronSpec")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.cronSpec); + return writer; + }; + + /** + * Encodes the specified Schedule message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.Schedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.Schedule + * @static + * @param {google.cloud.gaming.v1beta.ISchedule} message Schedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Schedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Schedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.Schedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.Schedule} Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schedule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.Schedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.cronJobDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 4: { + message.cronSpec = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Schedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.Schedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.Schedule} Schedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Schedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Schedule message. + * @function verify + * @memberof google.cloud.gaming.v1beta.Schedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Schedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.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.cronJobDuration != null && message.hasOwnProperty("cronJobDuration")) { + var error = $root.google.protobuf.Duration.verify(message.cronJobDuration); + if (error) + return "cronJobDuration." + error; + } + if (message.cronSpec != null && message.hasOwnProperty("cronSpec")) + if (!$util.isString(message.cronSpec)) + return "cronSpec: string expected"; + return null; + }; + + /** + * Creates a Schedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.Schedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.Schedule} Schedule + */ + Schedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.Schedule) + return object; + var message = new $root.google.cloud.gaming.v1beta.Schedule(); + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.gaming.v1beta.Schedule.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.gaming.v1beta.Schedule.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.cronJobDuration != null) { + if (typeof object.cronJobDuration !== "object") + throw TypeError(".google.cloud.gaming.v1beta.Schedule.cronJobDuration: object expected"); + message.cronJobDuration = $root.google.protobuf.Duration.fromObject(object.cronJobDuration); + } + if (object.cronSpec != null) + message.cronSpec = String(object.cronSpec); + return message; + }; + + /** + * Creates a plain object from a Schedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.Schedule + * @static + * @param {google.cloud.gaming.v1beta.Schedule} message Schedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Schedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTime = null; + object.endTime = null; + object.cronJobDuration = null; + object.cronSpec = ""; + } + 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.cronJobDuration != null && message.hasOwnProperty("cronJobDuration")) + object.cronJobDuration = $root.google.protobuf.Duration.toObject(message.cronJobDuration, options); + if (message.cronSpec != null && message.hasOwnProperty("cronSpec")) + object.cronSpec = message.cronSpec; + return object; + }; + + /** + * Converts this Schedule to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.Schedule + * @instance + * @returns {Object.} JSON object + */ + Schedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Schedule + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.Schedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Schedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.Schedule"; + }; + + return Schedule; + })(); + + v1beta.SpecSource = (function() { + + /** + * Properties of a SpecSource. + * @memberof google.cloud.gaming.v1beta + * @interface ISpecSource + * @property {string|null} [gameServerConfigName] SpecSource gameServerConfigName + * @property {string|null} [name] SpecSource name + */ + + /** + * Constructs a new SpecSource. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a SpecSource. + * @implements ISpecSource + * @constructor + * @param {google.cloud.gaming.v1beta.ISpecSource=} [properties] Properties to set + */ + function SpecSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpecSource gameServerConfigName. + * @member {string} gameServerConfigName + * @memberof google.cloud.gaming.v1beta.SpecSource + * @instance + */ + SpecSource.prototype.gameServerConfigName = ""; + + /** + * SpecSource name. + * @member {string} name + * @memberof google.cloud.gaming.v1beta.SpecSource + * @instance + */ + SpecSource.prototype.name = ""; + + /** + * Creates a new SpecSource instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.SpecSource + * @static + * @param {google.cloud.gaming.v1beta.ISpecSource=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.SpecSource} SpecSource instance + */ + SpecSource.create = function create(properties) { + return new SpecSource(properties); + }; + + /** + * Encodes the specified SpecSource message. Does not implicitly {@link google.cloud.gaming.v1beta.SpecSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.SpecSource + * @static + * @param {google.cloud.gaming.v1beta.ISpecSource} message SpecSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpecSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gameServerConfigName != null && Object.hasOwnProperty.call(message, "gameServerConfigName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gameServerConfigName); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + return writer; + }; + + /** + * Encodes the specified SpecSource message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.SpecSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.SpecSource + * @static + * @param {google.cloud.gaming.v1beta.ISpecSource} message SpecSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpecSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpecSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.SpecSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.SpecSource} SpecSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpecSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.SpecSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gameServerConfigName = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpecSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.SpecSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.SpecSource} SpecSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpecSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpecSource message. + * @function verify + * @memberof google.cloud.gaming.v1beta.SpecSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpecSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gameServerConfigName != null && message.hasOwnProperty("gameServerConfigName")) + if (!$util.isString(message.gameServerConfigName)) + return "gameServerConfigName: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a SpecSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.SpecSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.SpecSource} SpecSource + */ + SpecSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.SpecSource) + return object; + var message = new $root.google.cloud.gaming.v1beta.SpecSource(); + if (object.gameServerConfigName != null) + message.gameServerConfigName = String(object.gameServerConfigName); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a SpecSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.SpecSource + * @static + * @param {google.cloud.gaming.v1beta.SpecSource} message SpecSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpecSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gameServerConfigName = ""; + object.name = ""; + } + if (message.gameServerConfigName != null && message.hasOwnProperty("gameServerConfigName")) + object.gameServerConfigName = message.gameServerConfigName; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this SpecSource to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.SpecSource + * @instance + * @returns {Object.} JSON object + */ + SpecSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpecSource + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.SpecSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpecSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.SpecSource"; + }; + + return SpecSource; + })(); + + v1beta.TargetDetails = (function() { + + /** + * Properties of a TargetDetails. + * @memberof google.cloud.gaming.v1beta + * @interface ITargetDetails + * @property {string|null} [gameServerClusterName] TargetDetails gameServerClusterName + * @property {string|null} [gameServerDeploymentName] TargetDetails gameServerDeploymentName + * @property {Array.|null} [fleetDetails] TargetDetails fleetDetails + */ + + /** + * Constructs a new TargetDetails. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a TargetDetails. + * @implements ITargetDetails + * @constructor + * @param {google.cloud.gaming.v1beta.ITargetDetails=} [properties] Properties to set + */ + function TargetDetails(properties) { + this.fleetDetails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetDetails gameServerClusterName. + * @member {string} gameServerClusterName + * @memberof google.cloud.gaming.v1beta.TargetDetails + * @instance + */ + TargetDetails.prototype.gameServerClusterName = ""; + + /** + * TargetDetails gameServerDeploymentName. + * @member {string} gameServerDeploymentName + * @memberof google.cloud.gaming.v1beta.TargetDetails + * @instance + */ + TargetDetails.prototype.gameServerDeploymentName = ""; + + /** + * TargetDetails fleetDetails. + * @member {Array.} fleetDetails + * @memberof google.cloud.gaming.v1beta.TargetDetails + * @instance + */ + TargetDetails.prototype.fleetDetails = $util.emptyArray; + + /** + * Creates a new TargetDetails instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.TargetDetails + * @static + * @param {google.cloud.gaming.v1beta.ITargetDetails=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.TargetDetails} TargetDetails instance + */ + TargetDetails.create = function create(properties) { + return new TargetDetails(properties); + }; + + /** + * Encodes the specified TargetDetails message. Does not implicitly {@link google.cloud.gaming.v1beta.TargetDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.TargetDetails + * @static + * @param {google.cloud.gaming.v1beta.ITargetDetails} message TargetDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gameServerClusterName != null && Object.hasOwnProperty.call(message, "gameServerClusterName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gameServerClusterName); + if (message.gameServerDeploymentName != null && Object.hasOwnProperty.call(message, "gameServerDeploymentName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gameServerDeploymentName); + if (message.fleetDetails != null && message.fleetDetails.length) + for (var i = 0; i < message.fleetDetails.length; ++i) + $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.encode(message.fleetDetails[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetDetails message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.TargetDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.TargetDetails + * @static + * @param {google.cloud.gaming.v1beta.ITargetDetails} message TargetDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.TargetDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.TargetDetails} TargetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.TargetDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gameServerClusterName = reader.string(); + break; + } + case 2: { + message.gameServerDeploymentName = reader.string(); + break; + } + case 3: { + if (!(message.fleetDetails && message.fleetDetails.length)) + message.fleetDetails = []; + message.fleetDetails.push($root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.TargetDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.TargetDetails} TargetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetDetails message. + * @function verify + * @memberof google.cloud.gaming.v1beta.TargetDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gameServerClusterName != null && message.hasOwnProperty("gameServerClusterName")) + if (!$util.isString(message.gameServerClusterName)) + return "gameServerClusterName: string expected"; + if (message.gameServerDeploymentName != null && message.hasOwnProperty("gameServerDeploymentName")) + if (!$util.isString(message.gameServerDeploymentName)) + return "gameServerDeploymentName: string expected"; + if (message.fleetDetails != null && message.hasOwnProperty("fleetDetails")) { + if (!Array.isArray(message.fleetDetails)) + return "fleetDetails: array expected"; + for (var i = 0; i < message.fleetDetails.length; ++i) { + var error = $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.verify(message.fleetDetails[i]); + if (error) + return "fleetDetails." + error; + } + } + return null; + }; + + /** + * Creates a TargetDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.TargetDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.TargetDetails} TargetDetails + */ + TargetDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.TargetDetails) + return object; + var message = new $root.google.cloud.gaming.v1beta.TargetDetails(); + if (object.gameServerClusterName != null) + message.gameServerClusterName = String(object.gameServerClusterName); + if (object.gameServerDeploymentName != null) + message.gameServerDeploymentName = String(object.gameServerDeploymentName); + if (object.fleetDetails) { + if (!Array.isArray(object.fleetDetails)) + throw TypeError(".google.cloud.gaming.v1beta.TargetDetails.fleetDetails: array expected"); + message.fleetDetails = []; + for (var i = 0; i < object.fleetDetails.length; ++i) { + if (typeof object.fleetDetails[i] !== "object") + throw TypeError(".google.cloud.gaming.v1beta.TargetDetails.fleetDetails: object expected"); + message.fleetDetails[i] = $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.fromObject(object.fleetDetails[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TargetDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.TargetDetails + * @static + * @param {google.cloud.gaming.v1beta.TargetDetails} message TargetDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fleetDetails = []; + if (options.defaults) { + object.gameServerClusterName = ""; + object.gameServerDeploymentName = ""; + } + if (message.gameServerClusterName != null && message.hasOwnProperty("gameServerClusterName")) + object.gameServerClusterName = message.gameServerClusterName; + if (message.gameServerDeploymentName != null && message.hasOwnProperty("gameServerDeploymentName")) + object.gameServerDeploymentName = message.gameServerDeploymentName; + if (message.fleetDetails && message.fleetDetails.length) { + object.fleetDetails = []; + for (var j = 0; j < message.fleetDetails.length; ++j) + object.fleetDetails[j] = $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.toObject(message.fleetDetails[j], options); + } + return object; + }; + + /** + * Converts this TargetDetails to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.TargetDetails + * @instance + * @returns {Object.} JSON object + */ + TargetDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetDetails + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.TargetDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.TargetDetails"; + }; + + TargetDetails.TargetFleetDetails = (function() { + + /** + * Properties of a TargetFleetDetails. + * @memberof google.cloud.gaming.v1beta.TargetDetails + * @interface ITargetFleetDetails + * @property {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleet|null} [fleet] TargetFleetDetails fleet + * @property {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler|null} [autoscaler] TargetFleetDetails autoscaler + */ + + /** + * Constructs a new TargetFleetDetails. + * @memberof google.cloud.gaming.v1beta.TargetDetails + * @classdesc Represents a TargetFleetDetails. + * @implements ITargetFleetDetails + * @constructor + * @param {google.cloud.gaming.v1beta.TargetDetails.ITargetFleetDetails=} [properties] Properties to set + */ + function TargetFleetDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetFleetDetails fleet. + * @member {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleet|null|undefined} fleet + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails + * @instance + */ + TargetFleetDetails.prototype.fleet = null; + + /** + * TargetFleetDetails autoscaler. + * @member {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler|null|undefined} autoscaler + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails + * @instance + */ + TargetFleetDetails.prototype.autoscaler = null; + + /** + * Creates a new TargetFleetDetails instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails + * @static + * @param {google.cloud.gaming.v1beta.TargetDetails.ITargetFleetDetails=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails} TargetFleetDetails instance + */ + TargetFleetDetails.create = function create(properties) { + return new TargetFleetDetails(properties); + }; + + /** + * Encodes the specified TargetFleetDetails message. Does not implicitly {@link google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails + * @static + * @param {google.cloud.gaming.v1beta.TargetDetails.ITargetFleetDetails} message TargetFleetDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetFleetDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fleet != null && Object.hasOwnProperty.call(message, "fleet")) + $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet.encode(message.fleet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.autoscaler != null && Object.hasOwnProperty.call(message, "autoscaler")) + $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler.encode(message.autoscaler, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetFleetDetails message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails + * @static + * @param {google.cloud.gaming.v1beta.TargetDetails.ITargetFleetDetails} message TargetFleetDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetFleetDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetFleetDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails} TargetFleetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetFleetDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fleet = $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet.decode(reader, reader.uint32()); + break; + } + case 2: { + message.autoscaler = $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetFleetDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails} TargetFleetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetFleetDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetFleetDetails message. + * @function verify + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetFleetDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fleet != null && message.hasOwnProperty("fleet")) { + var error = $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet.verify(message.fleet); + if (error) + return "fleet." + error; + } + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) { + var error = $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler.verify(message.autoscaler); + if (error) + return "autoscaler." + error; + } + return null; + }; + + /** + * Creates a TargetFleetDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails} TargetFleetDetails + */ + TargetFleetDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails) + return object; + var message = new $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails(); + if (object.fleet != null) { + if (typeof object.fleet !== "object") + throw TypeError(".google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.fleet: object expected"); + message.fleet = $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet.fromObject(object.fleet); + } + if (object.autoscaler != null) { + if (typeof object.autoscaler !== "object") + throw TypeError(".google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.autoscaler: object expected"); + message.autoscaler = $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler.fromObject(object.autoscaler); + } + return message; + }; + + /** + * Creates a plain object from a TargetFleetDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails + * @static + * @param {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails} message TargetFleetDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetFleetDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fleet = null; + object.autoscaler = null; + } + if (message.fleet != null && message.hasOwnProperty("fleet")) + object.fleet = $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet.toObject(message.fleet, options); + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) + object.autoscaler = $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler.toObject(message.autoscaler, options); + return object; + }; + + /** + * Converts this TargetFleetDetails to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails + * @instance + * @returns {Object.} JSON object + */ + TargetFleetDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetFleetDetails + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetFleetDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails"; + }; + + TargetFleetDetails.TargetFleet = (function() { + + /** + * Properties of a TargetFleet. + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails + * @interface ITargetFleet + * @property {string|null} [name] TargetFleet name + * @property {google.cloud.gaming.v1beta.ISpecSource|null} [specSource] TargetFleet specSource + */ + + /** + * Constructs a new TargetFleet. + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails + * @classdesc Represents a TargetFleet. + * @implements ITargetFleet + * @constructor + * @param {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleet=} [properties] Properties to set + */ + function TargetFleet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetFleet name. + * @member {string} name + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet + * @instance + */ + TargetFleet.prototype.name = ""; + + /** + * TargetFleet specSource. + * @member {google.cloud.gaming.v1beta.ISpecSource|null|undefined} specSource + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet + * @instance + */ + TargetFleet.prototype.specSource = null; + + /** + * Creates a new TargetFleet instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet + * @static + * @param {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleet=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet} TargetFleet instance + */ + TargetFleet.create = function create(properties) { + return new TargetFleet(properties); + }; + + /** + * Encodes the specified TargetFleet message. Does not implicitly {@link google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet + * @static + * @param {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleet} message TargetFleet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetFleet.encode = function encode(message, writer) { + 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.specSource != null && Object.hasOwnProperty.call(message, "specSource")) + $root.google.cloud.gaming.v1beta.SpecSource.encode(message.specSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetFleet message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet + * @static + * @param {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleet} message TargetFleet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetFleet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetFleet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet} TargetFleet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetFleet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.specSource = $root.google.cloud.gaming.v1beta.SpecSource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetFleet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet} TargetFleet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetFleet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetFleet message. + * @function verify + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetFleet.verify = function verify(message) { + if (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.specSource != null && message.hasOwnProperty("specSource")) { + var error = $root.google.cloud.gaming.v1beta.SpecSource.verify(message.specSource); + if (error) + return "specSource." + error; + } + return null; + }; + + /** + * Creates a TargetFleet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet} TargetFleet + */ + TargetFleet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet) + return object; + var message = new $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet(); + if (object.name != null) + message.name = String(object.name); + if (object.specSource != null) { + if (typeof object.specSource !== "object") + throw TypeError(".google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet.specSource: object expected"); + message.specSource = $root.google.cloud.gaming.v1beta.SpecSource.fromObject(object.specSource); + } + return message; + }; + + /** + * Creates a plain object from a TargetFleet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet + * @static + * @param {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet} message TargetFleet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetFleet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.specSource = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.specSource != null && message.hasOwnProperty("specSource")) + object.specSource = $root.google.cloud.gaming.v1beta.SpecSource.toObject(message.specSource, options); + return object; + }; + + /** + * Converts this TargetFleet to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet + * @instance + * @returns {Object.} JSON object + */ + TargetFleet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetFleet + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetFleet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleet"; + }; + + return TargetFleet; + })(); + + TargetFleetDetails.TargetFleetAutoscaler = (function() { + + /** + * Properties of a TargetFleetAutoscaler. + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails + * @interface ITargetFleetAutoscaler + * @property {string|null} [name] TargetFleetAutoscaler name + * @property {google.cloud.gaming.v1beta.ISpecSource|null} [specSource] TargetFleetAutoscaler specSource + */ + + /** + * Constructs a new TargetFleetAutoscaler. + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails + * @classdesc Represents a TargetFleetAutoscaler. + * @implements ITargetFleetAutoscaler + * @constructor + * @param {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler=} [properties] Properties to set + */ + function TargetFleetAutoscaler(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetFleetAutoscaler name. + * @member {string} name + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @instance + */ + TargetFleetAutoscaler.prototype.name = ""; + + /** + * TargetFleetAutoscaler specSource. + * @member {google.cloud.gaming.v1beta.ISpecSource|null|undefined} specSource + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @instance + */ + TargetFleetAutoscaler.prototype.specSource = null; + + /** + * Creates a new TargetFleetAutoscaler instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @static + * @param {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler} TargetFleetAutoscaler instance + */ + TargetFleetAutoscaler.create = function create(properties) { + return new TargetFleetAutoscaler(properties); + }; + + /** + * Encodes the specified TargetFleetAutoscaler message. Does not implicitly {@link google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @static + * @param {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler} message TargetFleetAutoscaler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetFleetAutoscaler.encode = function encode(message, writer) { + 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.specSource != null && Object.hasOwnProperty.call(message, "specSource")) + $root.google.cloud.gaming.v1beta.SpecSource.encode(message.specSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetFleetAutoscaler message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @static + * @param {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.ITargetFleetAutoscaler} message TargetFleetAutoscaler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetFleetAutoscaler.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetFleetAutoscaler message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler} TargetFleetAutoscaler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetFleetAutoscaler.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.specSource = $root.google.cloud.gaming.v1beta.SpecSource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetFleetAutoscaler message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler} TargetFleetAutoscaler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetFleetAutoscaler.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetFleetAutoscaler message. + * @function verify + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetFleetAutoscaler.verify = function verify(message) { + if (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.specSource != null && message.hasOwnProperty("specSource")) { + var error = $root.google.cloud.gaming.v1beta.SpecSource.verify(message.specSource); + if (error) + return "specSource." + error; + } + return null; + }; + + /** + * Creates a TargetFleetAutoscaler message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler} TargetFleetAutoscaler + */ + TargetFleetAutoscaler.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler) + return object; + var message = new $root.google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler(); + if (object.name != null) + message.name = String(object.name); + if (object.specSource != null) { + if (typeof object.specSource !== "object") + throw TypeError(".google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler.specSource: object expected"); + message.specSource = $root.google.cloud.gaming.v1beta.SpecSource.fromObject(object.specSource); + } + return message; + }; + + /** + * Creates a plain object from a TargetFleetAutoscaler message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @static + * @param {google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler} message TargetFleetAutoscaler + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetFleetAutoscaler.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.specSource = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.specSource != null && message.hasOwnProperty("specSource")) + object.specSource = $root.google.cloud.gaming.v1beta.SpecSource.toObject(message.specSource, options); + return object; + }; + + /** + * Converts this TargetFleetAutoscaler to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @instance + * @returns {Object.} JSON object + */ + TargetFleetAutoscaler.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetFleetAutoscaler + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetFleetAutoscaler.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.TargetDetails.TargetFleetDetails.TargetFleetAutoscaler"; + }; + + return TargetFleetAutoscaler; + })(); + + return TargetFleetDetails; + })(); + + return TargetDetails; + })(); + + v1beta.TargetState = (function() { + + /** + * Properties of a TargetState. + * @memberof google.cloud.gaming.v1beta + * @interface ITargetState + * @property {Array.|null} [details] TargetState details + */ + + /** + * Constructs a new TargetState. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a TargetState. + * @implements ITargetState + * @constructor + * @param {google.cloud.gaming.v1beta.ITargetState=} [properties] Properties to set + */ + function TargetState(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]]; + } + + /** + * TargetState details. + * @member {Array.} details + * @memberof google.cloud.gaming.v1beta.TargetState + * @instance + */ + TargetState.prototype.details = $util.emptyArray; + + /** + * Creates a new TargetState instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.TargetState + * @static + * @param {google.cloud.gaming.v1beta.ITargetState=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.TargetState} TargetState instance + */ + TargetState.create = function create(properties) { + return new TargetState(properties); + }; + + /** + * Encodes the specified TargetState message. Does not implicitly {@link google.cloud.gaming.v1beta.TargetState.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.TargetState + * @static + * @param {google.cloud.gaming.v1beta.ITargetState} message TargetState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.details != null && message.details.length) + for (var i = 0; i < message.details.length; ++i) + $root.google.cloud.gaming.v1beta.TargetDetails.encode(message.details[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetState message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.TargetState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.TargetState + * @static + * @param {google.cloud.gaming.v1beta.ITargetState} message TargetState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetState message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.TargetState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.TargetState} TargetState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.TargetState(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.details && message.details.length)) + message.details = []; + message.details.push($root.google.cloud.gaming.v1beta.TargetDetails.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.TargetState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.TargetState} TargetState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetState message. + * @function verify + * @memberof google.cloud.gaming.v1beta.TargetState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object 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.cloud.gaming.v1beta.TargetDetails.verify(message.details[i]); + if (error) + return "details." + error; + } + } + return null; + }; + + /** + * Creates a TargetState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.TargetState + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.TargetState} TargetState + */ + TargetState.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.TargetState) + return object; + var message = new $root.google.cloud.gaming.v1beta.TargetState(); + if (object.details) { + if (!Array.isArray(object.details)) + throw TypeError(".google.cloud.gaming.v1beta.TargetState.details: array expected"); + message.details = []; + for (var i = 0; i < object.details.length; ++i) { + if (typeof object.details[i] !== "object") + throw TypeError(".google.cloud.gaming.v1beta.TargetState.details: object expected"); + message.details[i] = $root.google.cloud.gaming.v1beta.TargetDetails.fromObject(object.details[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TargetState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.TargetState + * @static + * @param {google.cloud.gaming.v1beta.TargetState} message TargetState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.details = []; + if (message.details && message.details.length) { + object.details = []; + for (var j = 0; j < message.details.length; ++j) + object.details[j] = $root.google.cloud.gaming.v1beta.TargetDetails.toObject(message.details[j], options); + } + return object; + }; + + /** + * Converts this TargetState to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.TargetState + * @instance + * @returns {Object.} JSON object + */ + TargetState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetState + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.TargetState + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.TargetState"; + }; + + return TargetState; + })(); + + v1beta.DeployedFleetDetails = (function() { + + /** + * Properties of a DeployedFleetDetails. + * @memberof google.cloud.gaming.v1beta + * @interface IDeployedFleetDetails + * @property {google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleet|null} [deployedFleet] DeployedFleetDetails deployedFleet + * @property {google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleetAutoscaler|null} [deployedAutoscaler] DeployedFleetDetails deployedAutoscaler + */ + + /** + * Constructs a new DeployedFleetDetails. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a DeployedFleetDetails. + * @implements IDeployedFleetDetails + * @constructor + * @param {google.cloud.gaming.v1beta.IDeployedFleetDetails=} [properties] Properties to set + */ + function DeployedFleetDetails(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployedFleetDetails deployedFleet. + * @member {google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleet|null|undefined} deployedFleet + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails + * @instance + */ + DeployedFleetDetails.prototype.deployedFleet = null; + + /** + * DeployedFleetDetails deployedAutoscaler. + * @member {google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleetAutoscaler|null|undefined} deployedAutoscaler + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails + * @instance + */ + DeployedFleetDetails.prototype.deployedAutoscaler = null; + + /** + * Creates a new DeployedFleetDetails instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails + * @static + * @param {google.cloud.gaming.v1beta.IDeployedFleetDetails=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.DeployedFleetDetails} DeployedFleetDetails instance + */ + DeployedFleetDetails.create = function create(properties) { + return new DeployedFleetDetails(properties); + }; + + /** + * Encodes the specified DeployedFleetDetails message. Does not implicitly {@link google.cloud.gaming.v1beta.DeployedFleetDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails + * @static + * @param {google.cloud.gaming.v1beta.IDeployedFleetDetails} message DeployedFleetDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployedFleetDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deployedFleet != null && Object.hasOwnProperty.call(message, "deployedFleet")) + $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.encode(message.deployedFleet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deployedAutoscaler != null && Object.hasOwnProperty.call(message, "deployedAutoscaler")) + $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler.encode(message.deployedAutoscaler, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployedFleetDetails message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.DeployedFleetDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails + * @static + * @param {google.cloud.gaming.v1beta.IDeployedFleetDetails} message DeployedFleetDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployedFleetDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployedFleetDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.DeployedFleetDetails} DeployedFleetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployedFleetDetails.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.DeployedFleetDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deployedFleet = $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.decode(reader, reader.uint32()); + break; + } + case 2: { + message.deployedAutoscaler = $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployedFleetDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.DeployedFleetDetails} DeployedFleetDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployedFleetDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployedFleetDetails message. + * @function verify + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployedFleetDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deployedFleet != null && message.hasOwnProperty("deployedFleet")) { + var error = $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.verify(message.deployedFleet); + if (error) + return "deployedFleet." + error; + } + if (message.deployedAutoscaler != null && message.hasOwnProperty("deployedAutoscaler")) { + var error = $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler.verify(message.deployedAutoscaler); + if (error) + return "deployedAutoscaler." + error; + } + return null; + }; + + /** + * Creates a DeployedFleetDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.DeployedFleetDetails} DeployedFleetDetails + */ + DeployedFleetDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.DeployedFleetDetails) + return object; + var message = new $root.google.cloud.gaming.v1beta.DeployedFleetDetails(); + if (object.deployedFleet != null) { + if (typeof object.deployedFleet !== "object") + throw TypeError(".google.cloud.gaming.v1beta.DeployedFleetDetails.deployedFleet: object expected"); + message.deployedFleet = $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.fromObject(object.deployedFleet); + } + if (object.deployedAutoscaler != null) { + if (typeof object.deployedAutoscaler !== "object") + throw TypeError(".google.cloud.gaming.v1beta.DeployedFleetDetails.deployedAutoscaler: object expected"); + message.deployedAutoscaler = $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler.fromObject(object.deployedAutoscaler); + } + return message; + }; + + /** + * Creates a plain object from a DeployedFleetDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails + * @static + * @param {google.cloud.gaming.v1beta.DeployedFleetDetails} message DeployedFleetDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployedFleetDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.deployedFleet = null; + object.deployedAutoscaler = null; + } + if (message.deployedFleet != null && message.hasOwnProperty("deployedFleet")) + object.deployedFleet = $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.toObject(message.deployedFleet, options); + if (message.deployedAutoscaler != null && message.hasOwnProperty("deployedAutoscaler")) + object.deployedAutoscaler = $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler.toObject(message.deployedAutoscaler, options); + return object; + }; + + /** + * Converts this DeployedFleetDetails to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails + * @instance + * @returns {Object.} JSON object + */ + DeployedFleetDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployedFleetDetails + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployedFleetDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.DeployedFleetDetails"; + }; + + DeployedFleetDetails.DeployedFleet = (function() { + + /** + * Properties of a DeployedFleet. + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails + * @interface IDeployedFleet + * @property {string|null} [fleet] DeployedFleet fleet + * @property {string|null} [fleetSpec] DeployedFleet fleetSpec + * @property {google.cloud.gaming.v1beta.ISpecSource|null} [specSource] DeployedFleet specSource + * @property {google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus|null} [status] DeployedFleet status + */ + + /** + * Constructs a new DeployedFleet. + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails + * @classdesc Represents a DeployedFleet. + * @implements IDeployedFleet + * @constructor + * @param {google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleet=} [properties] Properties to set + */ + function DeployedFleet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployedFleet fleet. + * @member {string} fleet + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet + * @instance + */ + DeployedFleet.prototype.fleet = ""; + + /** + * DeployedFleet fleetSpec. + * @member {string} fleetSpec + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet + * @instance + */ + DeployedFleet.prototype.fleetSpec = ""; + + /** + * DeployedFleet specSource. + * @member {google.cloud.gaming.v1beta.ISpecSource|null|undefined} specSource + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet + * @instance + */ + DeployedFleet.prototype.specSource = null; + + /** + * DeployedFleet status. + * @member {google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus|null|undefined} status + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet + * @instance + */ + DeployedFleet.prototype.status = null; + + /** + * Creates a new DeployedFleet instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet + * @static + * @param {google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleet=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet} DeployedFleet instance + */ + DeployedFleet.create = function create(properties) { + return new DeployedFleet(properties); + }; + + /** + * Encodes the specified DeployedFleet message. Does not implicitly {@link google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet + * @static + * @param {google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleet} message DeployedFleet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployedFleet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fleet != null && Object.hasOwnProperty.call(message, "fleet")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fleet); + if (message.fleetSpec != null && Object.hasOwnProperty.call(message, "fleetSpec")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fleetSpec); + if (message.specSource != null && Object.hasOwnProperty.call(message, "specSource")) + $root.google.cloud.gaming.v1beta.SpecSource.encode(message.specSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus.encode(message.status, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployedFleet message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet + * @static + * @param {google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleet} message DeployedFleet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployedFleet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployedFleet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet} DeployedFleet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployedFleet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fleet = reader.string(); + break; + } + case 2: { + message.fleetSpec = reader.string(); + break; + } + case 3: { + message.specSource = $root.google.cloud.gaming.v1beta.SpecSource.decode(reader, reader.uint32()); + break; + } + case 5: { + message.status = $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployedFleet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet} DeployedFleet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployedFleet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployedFleet message. + * @function verify + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployedFleet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fleet != null && message.hasOwnProperty("fleet")) + if (!$util.isString(message.fleet)) + return "fleet: string expected"; + if (message.fleetSpec != null && message.hasOwnProperty("fleetSpec")) + if (!$util.isString(message.fleetSpec)) + return "fleetSpec: string expected"; + if (message.specSource != null && message.hasOwnProperty("specSource")) { + var error = $root.google.cloud.gaming.v1beta.SpecSource.verify(message.specSource); + if (error) + return "specSource." + error; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus.verify(message.status); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates a DeployedFleet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet} DeployedFleet + */ + DeployedFleet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet) + return object; + var message = new $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet(); + if (object.fleet != null) + message.fleet = String(object.fleet); + if (object.fleetSpec != null) + message.fleetSpec = String(object.fleetSpec); + if (object.specSource != null) { + if (typeof object.specSource !== "object") + throw TypeError(".google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.specSource: object expected"); + message.specSource = $root.google.cloud.gaming.v1beta.SpecSource.fromObject(object.specSource); + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.status: object expected"); + message.status = $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from a DeployedFleet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet + * @static + * @param {google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet} message DeployedFleet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployedFleet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fleet = ""; + object.fleetSpec = ""; + object.specSource = null; + object.status = null; + } + if (message.fleet != null && message.hasOwnProperty("fleet")) + object.fleet = message.fleet; + if (message.fleetSpec != null && message.hasOwnProperty("fleetSpec")) + object.fleetSpec = message.fleetSpec; + if (message.specSource != null && message.hasOwnProperty("specSource")) + object.specSource = $root.google.cloud.gaming.v1beta.SpecSource.toObject(message.specSource, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus.toObject(message.status, options); + return object; + }; + + /** + * Converts this DeployedFleet to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet + * @instance + * @returns {Object.} JSON object + */ + DeployedFleet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployedFleet + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployedFleet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet"; + }; + + DeployedFleet.DeployedFleetStatus = (function() { + + /** + * Properties of a DeployedFleetStatus. + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet + * @interface IDeployedFleetStatus + * @property {number|Long|null} [readyReplicas] DeployedFleetStatus readyReplicas + * @property {number|Long|null} [allocatedReplicas] DeployedFleetStatus allocatedReplicas + * @property {number|Long|null} [reservedReplicas] DeployedFleetStatus reservedReplicas + * @property {number|Long|null} [replicas] DeployedFleetStatus replicas + */ + + /** + * Constructs a new DeployedFleetStatus. + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet + * @classdesc Represents a DeployedFleetStatus. + * @implements IDeployedFleetStatus + * @constructor + * @param {google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus=} [properties] Properties to set + */ + function DeployedFleetStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployedFleetStatus readyReplicas. + * @member {number|Long} readyReplicas + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @instance + */ + DeployedFleetStatus.prototype.readyReplicas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DeployedFleetStatus allocatedReplicas. + * @member {number|Long} allocatedReplicas + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @instance + */ + DeployedFleetStatus.prototype.allocatedReplicas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DeployedFleetStatus reservedReplicas. + * @member {number|Long} reservedReplicas + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @instance + */ + DeployedFleetStatus.prototype.reservedReplicas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DeployedFleetStatus replicas. + * @member {number|Long} replicas + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @instance + */ + DeployedFleetStatus.prototype.replicas = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new DeployedFleetStatus instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @static + * @param {google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus} DeployedFleetStatus instance + */ + DeployedFleetStatus.create = function create(properties) { + return new DeployedFleetStatus(properties); + }; + + /** + * Encodes the specified DeployedFleetStatus message. Does not implicitly {@link google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @static + * @param {google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus} message DeployedFleetStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployedFleetStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.readyReplicas != null && Object.hasOwnProperty.call(message, "readyReplicas")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.readyReplicas); + if (message.allocatedReplicas != null && Object.hasOwnProperty.call(message, "allocatedReplicas")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.allocatedReplicas); + if (message.reservedReplicas != null && Object.hasOwnProperty.call(message, "reservedReplicas")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.reservedReplicas); + if (message.replicas != null && Object.hasOwnProperty.call(message, "replicas")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.replicas); + return writer; + }; + + /** + * Encodes the specified DeployedFleetStatus message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @static + * @param {google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.IDeployedFleetStatus} message DeployedFleetStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployedFleetStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployedFleetStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus} DeployedFleetStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployedFleetStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.readyReplicas = reader.int64(); + break; + } + case 2: { + message.allocatedReplicas = reader.int64(); + break; + } + case 3: { + message.reservedReplicas = reader.int64(); + break; + } + case 4: { + message.replicas = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployedFleetStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus} DeployedFleetStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployedFleetStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployedFleetStatus message. + * @function verify + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployedFleetStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.readyReplicas != null && message.hasOwnProperty("readyReplicas")) + if (!$util.isInteger(message.readyReplicas) && !(message.readyReplicas && $util.isInteger(message.readyReplicas.low) && $util.isInteger(message.readyReplicas.high))) + return "readyReplicas: integer|Long expected"; + if (message.allocatedReplicas != null && message.hasOwnProperty("allocatedReplicas")) + if (!$util.isInteger(message.allocatedReplicas) && !(message.allocatedReplicas && $util.isInteger(message.allocatedReplicas.low) && $util.isInteger(message.allocatedReplicas.high))) + return "allocatedReplicas: integer|Long expected"; + if (message.reservedReplicas != null && message.hasOwnProperty("reservedReplicas")) + if (!$util.isInteger(message.reservedReplicas) && !(message.reservedReplicas && $util.isInteger(message.reservedReplicas.low) && $util.isInteger(message.reservedReplicas.high))) + return "reservedReplicas: integer|Long expected"; + if (message.replicas != null && message.hasOwnProperty("replicas")) + if (!$util.isInteger(message.replicas) && !(message.replicas && $util.isInteger(message.replicas.low) && $util.isInteger(message.replicas.high))) + return "replicas: integer|Long expected"; + return null; + }; + + /** + * Creates a DeployedFleetStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus} DeployedFleetStatus + */ + DeployedFleetStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus) + return object; + var message = new $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus(); + if (object.readyReplicas != null) + if ($util.Long) + (message.readyReplicas = $util.Long.fromValue(object.readyReplicas)).unsigned = false; + else if (typeof object.readyReplicas === "string") + message.readyReplicas = parseInt(object.readyReplicas, 10); + else if (typeof object.readyReplicas === "number") + message.readyReplicas = object.readyReplicas; + else if (typeof object.readyReplicas === "object") + message.readyReplicas = new $util.LongBits(object.readyReplicas.low >>> 0, object.readyReplicas.high >>> 0).toNumber(); + if (object.allocatedReplicas != null) + if ($util.Long) + (message.allocatedReplicas = $util.Long.fromValue(object.allocatedReplicas)).unsigned = false; + else if (typeof object.allocatedReplicas === "string") + message.allocatedReplicas = parseInt(object.allocatedReplicas, 10); + else if (typeof object.allocatedReplicas === "number") + message.allocatedReplicas = object.allocatedReplicas; + else if (typeof object.allocatedReplicas === "object") + message.allocatedReplicas = new $util.LongBits(object.allocatedReplicas.low >>> 0, object.allocatedReplicas.high >>> 0).toNumber(); + if (object.reservedReplicas != null) + if ($util.Long) + (message.reservedReplicas = $util.Long.fromValue(object.reservedReplicas)).unsigned = false; + else if (typeof object.reservedReplicas === "string") + message.reservedReplicas = parseInt(object.reservedReplicas, 10); + else if (typeof object.reservedReplicas === "number") + message.reservedReplicas = object.reservedReplicas; + else if (typeof object.reservedReplicas === "object") + message.reservedReplicas = new $util.LongBits(object.reservedReplicas.low >>> 0, object.reservedReplicas.high >>> 0).toNumber(); + if (object.replicas != null) + if ($util.Long) + (message.replicas = $util.Long.fromValue(object.replicas)).unsigned = false; + else if (typeof object.replicas === "string") + message.replicas = parseInt(object.replicas, 10); + else if (typeof object.replicas === "number") + message.replicas = object.replicas; + else if (typeof object.replicas === "object") + message.replicas = new $util.LongBits(object.replicas.low >>> 0, object.replicas.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a DeployedFleetStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @static + * @param {google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus} message DeployedFleetStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployedFleetStatus.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.readyReplicas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.readyReplicas = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.allocatedReplicas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.allocatedReplicas = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.reservedReplicas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.reservedReplicas = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.replicas = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.replicas = options.longs === String ? "0" : 0; + } + if (message.readyReplicas != null && message.hasOwnProperty("readyReplicas")) + if (typeof message.readyReplicas === "number") + object.readyReplicas = options.longs === String ? String(message.readyReplicas) : message.readyReplicas; + else + object.readyReplicas = options.longs === String ? $util.Long.prototype.toString.call(message.readyReplicas) : options.longs === Number ? new $util.LongBits(message.readyReplicas.low >>> 0, message.readyReplicas.high >>> 0).toNumber() : message.readyReplicas; + if (message.allocatedReplicas != null && message.hasOwnProperty("allocatedReplicas")) + if (typeof message.allocatedReplicas === "number") + object.allocatedReplicas = options.longs === String ? String(message.allocatedReplicas) : message.allocatedReplicas; + else + object.allocatedReplicas = options.longs === String ? $util.Long.prototype.toString.call(message.allocatedReplicas) : options.longs === Number ? new $util.LongBits(message.allocatedReplicas.low >>> 0, message.allocatedReplicas.high >>> 0).toNumber() : message.allocatedReplicas; + if (message.reservedReplicas != null && message.hasOwnProperty("reservedReplicas")) + if (typeof message.reservedReplicas === "number") + object.reservedReplicas = options.longs === String ? String(message.reservedReplicas) : message.reservedReplicas; + else + object.reservedReplicas = options.longs === String ? $util.Long.prototype.toString.call(message.reservedReplicas) : options.longs === Number ? new $util.LongBits(message.reservedReplicas.low >>> 0, message.reservedReplicas.high >>> 0).toNumber() : message.reservedReplicas; + if (message.replicas != null && message.hasOwnProperty("replicas")) + if (typeof message.replicas === "number") + object.replicas = options.longs === String ? String(message.replicas) : message.replicas; + else + object.replicas = options.longs === String ? $util.Long.prototype.toString.call(message.replicas) : options.longs === Number ? new $util.LongBits(message.replicas.low >>> 0, message.replicas.high >>> 0).toNumber() : message.replicas; + return object; + }; + + /** + * Converts this DeployedFleetStatus to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @instance + * @returns {Object.} JSON object + */ + DeployedFleetStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployedFleetStatus + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployedFleetStatus.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.DeployedFleetStatus"; + }; + + return DeployedFleetStatus; + })(); + + return DeployedFleet; + })(); + + DeployedFleetDetails.DeployedFleetAutoscaler = (function() { + + /** + * Properties of a DeployedFleetAutoscaler. + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails + * @interface IDeployedFleetAutoscaler + * @property {string|null} [autoscaler] DeployedFleetAutoscaler autoscaler + * @property {google.cloud.gaming.v1beta.ISpecSource|null} [specSource] DeployedFleetAutoscaler specSource + * @property {string|null} [fleetAutoscalerSpec] DeployedFleetAutoscaler fleetAutoscalerSpec + */ + + /** + * Constructs a new DeployedFleetAutoscaler. + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails + * @classdesc Represents a DeployedFleetAutoscaler. + * @implements IDeployedFleetAutoscaler + * @constructor + * @param {google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleetAutoscaler=} [properties] Properties to set + */ + function DeployedFleetAutoscaler(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployedFleetAutoscaler autoscaler. + * @member {string} autoscaler + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler + * @instance + */ + DeployedFleetAutoscaler.prototype.autoscaler = ""; + + /** + * DeployedFleetAutoscaler specSource. + * @member {google.cloud.gaming.v1beta.ISpecSource|null|undefined} specSource + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler + * @instance + */ + DeployedFleetAutoscaler.prototype.specSource = null; + + /** + * DeployedFleetAutoscaler fleetAutoscalerSpec. + * @member {string} fleetAutoscalerSpec + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler + * @instance + */ + DeployedFleetAutoscaler.prototype.fleetAutoscalerSpec = ""; + + /** + * Creates a new DeployedFleetAutoscaler instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler + * @static + * @param {google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleetAutoscaler=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler} DeployedFleetAutoscaler instance + */ + DeployedFleetAutoscaler.create = function create(properties) { + return new DeployedFleetAutoscaler(properties); + }; + + /** + * Encodes the specified DeployedFleetAutoscaler message. Does not implicitly {@link google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler + * @static + * @param {google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleetAutoscaler} message DeployedFleetAutoscaler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployedFleetAutoscaler.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.autoscaler != null && Object.hasOwnProperty.call(message, "autoscaler")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.autoscaler); + if (message.fleetAutoscalerSpec != null && Object.hasOwnProperty.call(message, "fleetAutoscalerSpec")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.fleetAutoscalerSpec); + if (message.specSource != null && Object.hasOwnProperty.call(message, "specSource")) + $root.google.cloud.gaming.v1beta.SpecSource.encode(message.specSource, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployedFleetAutoscaler message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler + * @static + * @param {google.cloud.gaming.v1beta.DeployedFleetDetails.IDeployedFleetAutoscaler} message DeployedFleetAutoscaler message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployedFleetAutoscaler.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployedFleetAutoscaler message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler} DeployedFleetAutoscaler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployedFleetAutoscaler.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.autoscaler = reader.string(); + break; + } + case 4: { + message.specSource = $root.google.cloud.gaming.v1beta.SpecSource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.fleetAutoscalerSpec = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployedFleetAutoscaler message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler} DeployedFleetAutoscaler + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployedFleetAutoscaler.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployedFleetAutoscaler message. + * @function verify + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployedFleetAutoscaler.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) + if (!$util.isString(message.autoscaler)) + return "autoscaler: string expected"; + if (message.specSource != null && message.hasOwnProperty("specSource")) { + var error = $root.google.cloud.gaming.v1beta.SpecSource.verify(message.specSource); + if (error) + return "specSource." + error; + } + if (message.fleetAutoscalerSpec != null && message.hasOwnProperty("fleetAutoscalerSpec")) + if (!$util.isString(message.fleetAutoscalerSpec)) + return "fleetAutoscalerSpec: string expected"; + return null; + }; + + /** + * Creates a DeployedFleetAutoscaler message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler} DeployedFleetAutoscaler + */ + DeployedFleetAutoscaler.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler) + return object; + var message = new $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler(); + if (object.autoscaler != null) + message.autoscaler = String(object.autoscaler); + if (object.specSource != null) { + if (typeof object.specSource !== "object") + throw TypeError(".google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler.specSource: object expected"); + message.specSource = $root.google.cloud.gaming.v1beta.SpecSource.fromObject(object.specSource); + } + if (object.fleetAutoscalerSpec != null) + message.fleetAutoscalerSpec = String(object.fleetAutoscalerSpec); + return message; + }; + + /** + * Creates a plain object from a DeployedFleetAutoscaler message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler + * @static + * @param {google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler} message DeployedFleetAutoscaler + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployedFleetAutoscaler.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.autoscaler = ""; + object.fleetAutoscalerSpec = ""; + object.specSource = null; + } + if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) + object.autoscaler = message.autoscaler; + if (message.fleetAutoscalerSpec != null && message.hasOwnProperty("fleetAutoscalerSpec")) + object.fleetAutoscalerSpec = message.fleetAutoscalerSpec; + if (message.specSource != null && message.hasOwnProperty("specSource")) + object.specSource = $root.google.cloud.gaming.v1beta.SpecSource.toObject(message.specSource, options); + return object; + }; + + /** + * Converts this DeployedFleetAutoscaler to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler + * @instance + * @returns {Object.} JSON object + */ + DeployedFleetAutoscaler.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployedFleetAutoscaler + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployedFleetAutoscaler.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleetAutoscaler"; + }; + + return DeployedFleetAutoscaler; + })(); + + return DeployedFleetDetails; + })(); + + v1beta.ListGameServerClustersRequest = (function() { + + /** + * Properties of a ListGameServerClustersRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IListGameServerClustersRequest + * @property {string|null} [parent] ListGameServerClustersRequest parent + * @property {number|null} [pageSize] ListGameServerClustersRequest pageSize + * @property {string|null} [pageToken] ListGameServerClustersRequest pageToken + * @property {string|null} [filter] ListGameServerClustersRequest filter + * @property {string|null} [orderBy] ListGameServerClustersRequest orderBy + */ + + /** + * Constructs a new ListGameServerClustersRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a ListGameServerClustersRequest. + * @implements IListGameServerClustersRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IListGameServerClustersRequest=} [properties] Properties to set + */ + function ListGameServerClustersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGameServerClustersRequest parent. + * @member {string} parent + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersRequest + * @instance + */ + ListGameServerClustersRequest.prototype.parent = ""; + + /** + * ListGameServerClustersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersRequest + * @instance + */ + ListGameServerClustersRequest.prototype.pageSize = 0; + + /** + * ListGameServerClustersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersRequest + * @instance + */ + ListGameServerClustersRequest.prototype.pageToken = ""; + + /** + * ListGameServerClustersRequest filter. + * @member {string} filter + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersRequest + * @instance + */ + ListGameServerClustersRequest.prototype.filter = ""; + + /** + * ListGameServerClustersRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersRequest + * @instance + */ + ListGameServerClustersRequest.prototype.orderBy = ""; + + /** + * Creates a new ListGameServerClustersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersRequest + * @static + * @param {google.cloud.gaming.v1beta.IListGameServerClustersRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.ListGameServerClustersRequest} ListGameServerClustersRequest instance + */ + ListGameServerClustersRequest.create = function create(properties) { + return new ListGameServerClustersRequest(properties); + }; + + /** + * Encodes the specified ListGameServerClustersRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerClustersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersRequest + * @static + * @param {google.cloud.gaming.v1beta.IListGameServerClustersRequest} message ListGameServerClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerClustersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListGameServerClustersRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerClustersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersRequest + * @static + * @param {google.cloud.gaming.v1beta.IListGameServerClustersRequest} message ListGameServerClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGameServerClustersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.ListGameServerClustersRequest} ListGameServerClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerClustersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.ListGameServerClustersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGameServerClustersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.ListGameServerClustersRequest} ListGameServerClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerClustersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGameServerClustersRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGameServerClustersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListGameServerClustersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.ListGameServerClustersRequest} ListGameServerClustersRequest + */ + ListGameServerClustersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.ListGameServerClustersRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.ListGameServerClustersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListGameServerClustersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersRequest + * @static + * @param {google.cloud.gaming.v1beta.ListGameServerClustersRequest} message ListGameServerClustersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGameServerClustersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListGameServerClustersRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersRequest + * @instance + * @returns {Object.} JSON object + */ + ListGameServerClustersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGameServerClustersRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGameServerClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.ListGameServerClustersRequest"; + }; + + return ListGameServerClustersRequest; + })(); + + v1beta.ListGameServerClustersResponse = (function() { + + /** + * Properties of a ListGameServerClustersResponse. + * @memberof google.cloud.gaming.v1beta + * @interface IListGameServerClustersResponse + * @property {Array.|null} [gameServerClusters] ListGameServerClustersResponse gameServerClusters + * @property {string|null} [nextPageToken] ListGameServerClustersResponse nextPageToken + * @property {Array.|null} [unreachable] ListGameServerClustersResponse unreachable + */ + + /** + * Constructs a new ListGameServerClustersResponse. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a ListGameServerClustersResponse. + * @implements IListGameServerClustersResponse + * @constructor + * @param {google.cloud.gaming.v1beta.IListGameServerClustersResponse=} [properties] Properties to set + */ + function ListGameServerClustersResponse(properties) { + this.gameServerClusters = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGameServerClustersResponse gameServerClusters. + * @member {Array.} gameServerClusters + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersResponse + * @instance + */ + ListGameServerClustersResponse.prototype.gameServerClusters = $util.emptyArray; + + /** + * ListGameServerClustersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersResponse + * @instance + */ + ListGameServerClustersResponse.prototype.nextPageToken = ""; + + /** + * ListGameServerClustersResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersResponse + * @instance + */ + ListGameServerClustersResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListGameServerClustersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersResponse + * @static + * @param {google.cloud.gaming.v1beta.IListGameServerClustersResponse=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.ListGameServerClustersResponse} ListGameServerClustersResponse instance + */ + ListGameServerClustersResponse.create = function create(properties) { + return new ListGameServerClustersResponse(properties); + }; + + /** + * Encodes the specified ListGameServerClustersResponse message. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerClustersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersResponse + * @static + * @param {google.cloud.gaming.v1beta.IListGameServerClustersResponse} message ListGameServerClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerClustersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gameServerClusters != null && message.gameServerClusters.length) + for (var i = 0; i < message.gameServerClusters.length; ++i) + $root.google.cloud.gaming.v1beta.GameServerCluster.encode(message.gameServerClusters[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListGameServerClustersResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerClustersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersResponse + * @static + * @param {google.cloud.gaming.v1beta.IListGameServerClustersResponse} message ListGameServerClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGameServerClustersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.ListGameServerClustersResponse} ListGameServerClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerClustersResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.ListGameServerClustersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.gameServerClusters && message.gameServerClusters.length)) + message.gameServerClusters = []; + message.gameServerClusters.push($root.google.cloud.gaming.v1beta.GameServerCluster.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGameServerClustersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.ListGameServerClustersResponse} ListGameServerClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerClustersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGameServerClustersResponse message. + * @function verify + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGameServerClustersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gameServerClusters != null && message.hasOwnProperty("gameServerClusters")) { + if (!Array.isArray(message.gameServerClusters)) + return "gameServerClusters: array expected"; + for (var i = 0; i < message.gameServerClusters.length; ++i) { + var error = $root.google.cloud.gaming.v1beta.GameServerCluster.verify(message.gameServerClusters[i]); + if (error) + return "gameServerClusters." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListGameServerClustersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.ListGameServerClustersResponse} ListGameServerClustersResponse + */ + ListGameServerClustersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.ListGameServerClustersResponse) + return object; + var message = new $root.google.cloud.gaming.v1beta.ListGameServerClustersResponse(); + if (object.gameServerClusters) { + if (!Array.isArray(object.gameServerClusters)) + throw TypeError(".google.cloud.gaming.v1beta.ListGameServerClustersResponse.gameServerClusters: array expected"); + message.gameServerClusters = []; + for (var i = 0; i < object.gameServerClusters.length; ++i) { + if (typeof object.gameServerClusters[i] !== "object") + throw TypeError(".google.cloud.gaming.v1beta.ListGameServerClustersResponse.gameServerClusters: object expected"); + message.gameServerClusters[i] = $root.google.cloud.gaming.v1beta.GameServerCluster.fromObject(object.gameServerClusters[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.gaming.v1beta.ListGameServerClustersResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListGameServerClustersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersResponse + * @static + * @param {google.cloud.gaming.v1beta.ListGameServerClustersResponse} message ListGameServerClustersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGameServerClustersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.gameServerClusters = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.gameServerClusters && message.gameServerClusters.length) { + object.gameServerClusters = []; + for (var j = 0; j < message.gameServerClusters.length; ++j) + object.gameServerClusters[j] = $root.google.cloud.gaming.v1beta.GameServerCluster.toObject(message.gameServerClusters[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListGameServerClustersResponse to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersResponse + * @instance + * @returns {Object.} JSON object + */ + ListGameServerClustersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGameServerClustersResponse + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.ListGameServerClustersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGameServerClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.ListGameServerClustersResponse"; + }; + + return ListGameServerClustersResponse; + })(); + + v1beta.GetGameServerClusterRequest = (function() { + + /** + * Properties of a GetGameServerClusterRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IGetGameServerClusterRequest + * @property {string|null} [name] GetGameServerClusterRequest name + */ + + /** + * Constructs a new GetGameServerClusterRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a GetGameServerClusterRequest. + * @implements IGetGameServerClusterRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IGetGameServerClusterRequest=} [properties] Properties to set + */ + function GetGameServerClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGameServerClusterRequest name. + * @member {string} name + * @memberof google.cloud.gaming.v1beta.GetGameServerClusterRequest + * @instance + */ + GetGameServerClusterRequest.prototype.name = ""; + + /** + * Creates a new GetGameServerClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.GetGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.IGetGameServerClusterRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.GetGameServerClusterRequest} GetGameServerClusterRequest instance + */ + GetGameServerClusterRequest.create = function create(properties) { + return new GetGameServerClusterRequest(properties); + }; + + /** + * Encodes the specified GetGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.GetGameServerClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.GetGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.IGetGameServerClusterRequest} message GetGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGameServerClusterRequest.encode = function encode(message, writer) { + 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 GetGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GetGameServerClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.GetGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.IGetGameServerClusterRequest} message GetGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGameServerClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGameServerClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.GetGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.GetGameServerClusterRequest} GetGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGameServerClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.GetGameServerClusterRequest(); + 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 GetGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.GetGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.GetGameServerClusterRequest} GetGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGameServerClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGameServerClusterRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.GetGameServerClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGameServerClusterRequest.verify = function verify(message) { + if (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 GetGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.GetGameServerClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.GetGameServerClusterRequest} GetGameServerClusterRequest + */ + GetGameServerClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.GetGameServerClusterRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.GetGameServerClusterRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetGameServerClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.GetGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.GetGameServerClusterRequest} message GetGameServerClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGameServerClusterRequest.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 GetGameServerClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.GetGameServerClusterRequest + * @instance + * @returns {Object.} JSON object + */ + GetGameServerClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGameServerClusterRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.GetGameServerClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGameServerClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.GetGameServerClusterRequest"; + }; + + return GetGameServerClusterRequest; + })(); + + v1beta.CreateGameServerClusterRequest = (function() { + + /** + * Properties of a CreateGameServerClusterRequest. + * @memberof google.cloud.gaming.v1beta + * @interface ICreateGameServerClusterRequest + * @property {string|null} [parent] CreateGameServerClusterRequest parent + * @property {string|null} [gameServerClusterId] CreateGameServerClusterRequest gameServerClusterId + * @property {google.cloud.gaming.v1beta.IGameServerCluster|null} [gameServerCluster] CreateGameServerClusterRequest gameServerCluster + */ + + /** + * Constructs a new CreateGameServerClusterRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a CreateGameServerClusterRequest. + * @implements ICreateGameServerClusterRequest + * @constructor + * @param {google.cloud.gaming.v1beta.ICreateGameServerClusterRequest=} [properties] Properties to set + */ + function CreateGameServerClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateGameServerClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.gaming.v1beta.CreateGameServerClusterRequest + * @instance + */ + CreateGameServerClusterRequest.prototype.parent = ""; + + /** + * CreateGameServerClusterRequest gameServerClusterId. + * @member {string} gameServerClusterId + * @memberof google.cloud.gaming.v1beta.CreateGameServerClusterRequest + * @instance + */ + CreateGameServerClusterRequest.prototype.gameServerClusterId = ""; + + /** + * CreateGameServerClusterRequest gameServerCluster. + * @member {google.cloud.gaming.v1beta.IGameServerCluster|null|undefined} gameServerCluster + * @memberof google.cloud.gaming.v1beta.CreateGameServerClusterRequest + * @instance + */ + CreateGameServerClusterRequest.prototype.gameServerCluster = null; + + /** + * Creates a new CreateGameServerClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.CreateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.ICreateGameServerClusterRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.CreateGameServerClusterRequest} CreateGameServerClusterRequest instance + */ + CreateGameServerClusterRequest.create = function create(properties) { + return new CreateGameServerClusterRequest(properties); + }; + + /** + * Encodes the specified CreateGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.CreateGameServerClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.CreateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.ICreateGameServerClusterRequest} message CreateGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGameServerClusterRequest.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.gameServerClusterId != null && Object.hasOwnProperty.call(message, "gameServerClusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gameServerClusterId); + if (message.gameServerCluster != null && Object.hasOwnProperty.call(message, "gameServerCluster")) + $root.google.cloud.gaming.v1beta.GameServerCluster.encode(message.gameServerCluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.CreateGameServerClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.CreateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.ICreateGameServerClusterRequest} message CreateGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGameServerClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateGameServerClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.CreateGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.CreateGameServerClusterRequest} CreateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGameServerClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.CreateGameServerClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.gameServerClusterId = reader.string(); + break; + } + case 3: { + message.gameServerCluster = $root.google.cloud.gaming.v1beta.GameServerCluster.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.CreateGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.CreateGameServerClusterRequest} CreateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGameServerClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateGameServerClusterRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.CreateGameServerClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateGameServerClusterRequest.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.gameServerClusterId != null && message.hasOwnProperty("gameServerClusterId")) + if (!$util.isString(message.gameServerClusterId)) + return "gameServerClusterId: string expected"; + if (message.gameServerCluster != null && message.hasOwnProperty("gameServerCluster")) { + var error = $root.google.cloud.gaming.v1beta.GameServerCluster.verify(message.gameServerCluster); + if (error) + return "gameServerCluster." + error; + } + return null; + }; + + /** + * Creates a CreateGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.CreateGameServerClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.CreateGameServerClusterRequest} CreateGameServerClusterRequest + */ + CreateGameServerClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.CreateGameServerClusterRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.CreateGameServerClusterRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.gameServerClusterId != null) + message.gameServerClusterId = String(object.gameServerClusterId); + if (object.gameServerCluster != null) { + if (typeof object.gameServerCluster !== "object") + throw TypeError(".google.cloud.gaming.v1beta.CreateGameServerClusterRequest.gameServerCluster: object expected"); + message.gameServerCluster = $root.google.cloud.gaming.v1beta.GameServerCluster.fromObject(object.gameServerCluster); + } + return message; + }; + + /** + * Creates a plain object from a CreateGameServerClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.CreateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.CreateGameServerClusterRequest} message CreateGameServerClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateGameServerClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.gameServerClusterId = ""; + object.gameServerCluster = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.gameServerClusterId != null && message.hasOwnProperty("gameServerClusterId")) + object.gameServerClusterId = message.gameServerClusterId; + if (message.gameServerCluster != null && message.hasOwnProperty("gameServerCluster")) + object.gameServerCluster = $root.google.cloud.gaming.v1beta.GameServerCluster.toObject(message.gameServerCluster, options); + return object; + }; + + /** + * Converts this CreateGameServerClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.CreateGameServerClusterRequest + * @instance + * @returns {Object.} JSON object + */ + CreateGameServerClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateGameServerClusterRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.CreateGameServerClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateGameServerClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.CreateGameServerClusterRequest"; + }; + + return CreateGameServerClusterRequest; + })(); + + v1beta.PreviewCreateGameServerClusterRequest = (function() { + + /** + * Properties of a PreviewCreateGameServerClusterRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IPreviewCreateGameServerClusterRequest + * @property {string|null} [parent] PreviewCreateGameServerClusterRequest parent + * @property {string|null} [gameServerClusterId] PreviewCreateGameServerClusterRequest gameServerClusterId + * @property {google.cloud.gaming.v1beta.IGameServerCluster|null} [gameServerCluster] PreviewCreateGameServerClusterRequest gameServerCluster + * @property {google.protobuf.ITimestamp|null} [previewTime] PreviewCreateGameServerClusterRequest previewTime + */ + + /** + * Constructs a new PreviewCreateGameServerClusterRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a PreviewCreateGameServerClusterRequest. + * @implements IPreviewCreateGameServerClusterRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest=} [properties] Properties to set + */ + function PreviewCreateGameServerClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreviewCreateGameServerClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest + * @instance + */ + PreviewCreateGameServerClusterRequest.prototype.parent = ""; + + /** + * PreviewCreateGameServerClusterRequest gameServerClusterId. + * @member {string} gameServerClusterId + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest + * @instance + */ + PreviewCreateGameServerClusterRequest.prototype.gameServerClusterId = ""; + + /** + * PreviewCreateGameServerClusterRequest gameServerCluster. + * @member {google.cloud.gaming.v1beta.IGameServerCluster|null|undefined} gameServerCluster + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest + * @instance + */ + PreviewCreateGameServerClusterRequest.prototype.gameServerCluster = null; + + /** + * PreviewCreateGameServerClusterRequest previewTime. + * @member {google.protobuf.ITimestamp|null|undefined} previewTime + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest + * @instance + */ + PreviewCreateGameServerClusterRequest.prototype.previewTime = null; + + /** + * Creates a new PreviewCreateGameServerClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest} PreviewCreateGameServerClusterRequest instance + */ + PreviewCreateGameServerClusterRequest.create = function create(properties) { + return new PreviewCreateGameServerClusterRequest(properties); + }; + + /** + * Encodes the specified PreviewCreateGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest} message PreviewCreateGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewCreateGameServerClusterRequest.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.gameServerClusterId != null && Object.hasOwnProperty.call(message, "gameServerClusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gameServerClusterId); + if (message.gameServerCluster != null && Object.hasOwnProperty.call(message, "gameServerCluster")) + $root.google.cloud.gaming.v1beta.GameServerCluster.encode(message.gameServerCluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.previewTime != null && Object.hasOwnProperty.call(message, "previewTime")) + $root.google.protobuf.Timestamp.encode(message.previewTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreviewCreateGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest} message PreviewCreateGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewCreateGameServerClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreviewCreateGameServerClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest} PreviewCreateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewCreateGameServerClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.gameServerClusterId = reader.string(); + break; + } + case 3: { + message.gameServerCluster = $root.google.cloud.gaming.v1beta.GameServerCluster.decode(reader, reader.uint32()); + break; + } + case 4: { + message.previewTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreviewCreateGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest} PreviewCreateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewCreateGameServerClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreviewCreateGameServerClusterRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreviewCreateGameServerClusterRequest.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.gameServerClusterId != null && message.hasOwnProperty("gameServerClusterId")) + if (!$util.isString(message.gameServerClusterId)) + return "gameServerClusterId: string expected"; + if (message.gameServerCluster != null && message.hasOwnProperty("gameServerCluster")) { + var error = $root.google.cloud.gaming.v1beta.GameServerCluster.verify(message.gameServerCluster); + if (error) + return "gameServerCluster." + error; + } + if (message.previewTime != null && message.hasOwnProperty("previewTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.previewTime); + if (error) + return "previewTime." + error; + } + return null; + }; + + /** + * Creates a PreviewCreateGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest} PreviewCreateGameServerClusterRequest + */ + PreviewCreateGameServerClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.gameServerClusterId != null) + message.gameServerClusterId = String(object.gameServerClusterId); + if (object.gameServerCluster != null) { + if (typeof object.gameServerCluster !== "object") + throw TypeError(".google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest.gameServerCluster: object expected"); + message.gameServerCluster = $root.google.cloud.gaming.v1beta.GameServerCluster.fromObject(object.gameServerCluster); + } + if (object.previewTime != null) { + if (typeof object.previewTime !== "object") + throw TypeError(".google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest.previewTime: object expected"); + message.previewTime = $root.google.protobuf.Timestamp.fromObject(object.previewTime); + } + return message; + }; + + /** + * Creates a plain object from a PreviewCreateGameServerClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest} message PreviewCreateGameServerClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreviewCreateGameServerClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.gameServerClusterId = ""; + object.gameServerCluster = null; + object.previewTime = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.gameServerClusterId != null && message.hasOwnProperty("gameServerClusterId")) + object.gameServerClusterId = message.gameServerClusterId; + if (message.gameServerCluster != null && message.hasOwnProperty("gameServerCluster")) + object.gameServerCluster = $root.google.cloud.gaming.v1beta.GameServerCluster.toObject(message.gameServerCluster, options); + if (message.previewTime != null && message.hasOwnProperty("previewTime")) + object.previewTime = $root.google.protobuf.Timestamp.toObject(message.previewTime, options); + return object; + }; + + /** + * Converts this PreviewCreateGameServerClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest + * @instance + * @returns {Object.} JSON object + */ + PreviewCreateGameServerClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PreviewCreateGameServerClusterRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PreviewCreateGameServerClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest"; + }; + + return PreviewCreateGameServerClusterRequest; + })(); + + v1beta.PreviewCreateGameServerClusterResponse = (function() { + + /** + * Properties of a PreviewCreateGameServerClusterResponse. + * @memberof google.cloud.gaming.v1beta + * @interface IPreviewCreateGameServerClusterResponse + * @property {string|null} [etag] PreviewCreateGameServerClusterResponse etag + * @property {google.cloud.gaming.v1beta.ITargetState|null} [targetState] PreviewCreateGameServerClusterResponse targetState + */ + + /** + * Constructs a new PreviewCreateGameServerClusterResponse. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a PreviewCreateGameServerClusterResponse. + * @implements IPreviewCreateGameServerClusterResponse + * @constructor + * @param {google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse=} [properties] Properties to set + */ + function PreviewCreateGameServerClusterResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreviewCreateGameServerClusterResponse etag. + * @member {string} etag + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse + * @instance + */ + PreviewCreateGameServerClusterResponse.prototype.etag = ""; + + /** + * PreviewCreateGameServerClusterResponse targetState. + * @member {google.cloud.gaming.v1beta.ITargetState|null|undefined} targetState + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse + * @instance + */ + PreviewCreateGameServerClusterResponse.prototype.targetState = null; + + /** + * Creates a new PreviewCreateGameServerClusterResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse} PreviewCreateGameServerClusterResponse instance + */ + PreviewCreateGameServerClusterResponse.create = function create(properties) { + return new PreviewCreateGameServerClusterResponse(properties); + }; + + /** + * Encodes the specified PreviewCreateGameServerClusterResponse message. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse} message PreviewCreateGameServerClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewCreateGameServerClusterResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.targetState != null && Object.hasOwnProperty.call(message, "targetState")) + $root.google.cloud.gaming.v1beta.TargetState.encode(message.targetState, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreviewCreateGameServerClusterResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse} message PreviewCreateGameServerClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewCreateGameServerClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreviewCreateGameServerClusterResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse} PreviewCreateGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewCreateGameServerClusterResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.etag = reader.string(); + break; + } + case 3: { + message.targetState = $root.google.cloud.gaming.v1beta.TargetState.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreviewCreateGameServerClusterResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse} PreviewCreateGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewCreateGameServerClusterResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreviewCreateGameServerClusterResponse message. + * @function verify + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreviewCreateGameServerClusterResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.targetState != null && message.hasOwnProperty("targetState")) { + var error = $root.google.cloud.gaming.v1beta.TargetState.verify(message.targetState); + if (error) + return "targetState." + error; + } + return null; + }; + + /** + * Creates a PreviewCreateGameServerClusterResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse} PreviewCreateGameServerClusterResponse + */ + PreviewCreateGameServerClusterResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse) + return object; + var message = new $root.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse(); + if (object.etag != null) + message.etag = String(object.etag); + if (object.targetState != null) { + if (typeof object.targetState !== "object") + throw TypeError(".google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse.targetState: object expected"); + message.targetState = $root.google.cloud.gaming.v1beta.TargetState.fromObject(object.targetState); + } + return message; + }; + + /** + * Creates a plain object from a PreviewCreateGameServerClusterResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse} message PreviewCreateGameServerClusterResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreviewCreateGameServerClusterResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.etag = ""; + object.targetState = null; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.targetState != null && message.hasOwnProperty("targetState")) + object.targetState = $root.google.cloud.gaming.v1beta.TargetState.toObject(message.targetState, options); + return object; + }; + + /** + * Converts this PreviewCreateGameServerClusterResponse to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse + * @instance + * @returns {Object.} JSON object + */ + PreviewCreateGameServerClusterResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PreviewCreateGameServerClusterResponse + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PreviewCreateGameServerClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse"; + }; + + return PreviewCreateGameServerClusterResponse; + })(); + + v1beta.DeleteGameServerClusterRequest = (function() { + + /** + * Properties of a DeleteGameServerClusterRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IDeleteGameServerClusterRequest + * @property {string|null} [name] DeleteGameServerClusterRequest name + */ + + /** + * Constructs a new DeleteGameServerClusterRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a DeleteGameServerClusterRequest. + * @implements IDeleteGameServerClusterRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest=} [properties] Properties to set + */ + function DeleteGameServerClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGameServerClusterRequest name. + * @member {string} name + * @memberof google.cloud.gaming.v1beta.DeleteGameServerClusterRequest + * @instance + */ + DeleteGameServerClusterRequest.prototype.name = ""; + + /** + * Creates a new DeleteGameServerClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.DeleteGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.DeleteGameServerClusterRequest} DeleteGameServerClusterRequest instance + */ + DeleteGameServerClusterRequest.create = function create(properties) { + return new DeleteGameServerClusterRequest(properties); + }; + + /** + * Encodes the specified DeleteGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.DeleteGameServerClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.DeleteGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest} message DeleteGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGameServerClusterRequest.encode = function encode(message, writer) { + 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 DeleteGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.DeleteGameServerClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.DeleteGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest} message DeleteGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGameServerClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGameServerClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.DeleteGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.DeleteGameServerClusterRequest} DeleteGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGameServerClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest(); + 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 DeleteGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.DeleteGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.DeleteGameServerClusterRequest} DeleteGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGameServerClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGameServerClusterRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.DeleteGameServerClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGameServerClusterRequest.verify = function verify(message) { + if (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 DeleteGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.DeleteGameServerClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.DeleteGameServerClusterRequest} DeleteGameServerClusterRequest + */ + DeleteGameServerClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteGameServerClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.DeleteGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.DeleteGameServerClusterRequest} message DeleteGameServerClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGameServerClusterRequest.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 DeleteGameServerClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.DeleteGameServerClusterRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGameServerClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteGameServerClusterRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.DeleteGameServerClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteGameServerClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.DeleteGameServerClusterRequest"; + }; + + return DeleteGameServerClusterRequest; + })(); + + v1beta.PreviewDeleteGameServerClusterRequest = (function() { + + /** + * Properties of a PreviewDeleteGameServerClusterRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IPreviewDeleteGameServerClusterRequest + * @property {string|null} [name] PreviewDeleteGameServerClusterRequest name + * @property {google.protobuf.ITimestamp|null} [previewTime] PreviewDeleteGameServerClusterRequest previewTime + */ + + /** + * Constructs a new PreviewDeleteGameServerClusterRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a PreviewDeleteGameServerClusterRequest. + * @implements IPreviewDeleteGameServerClusterRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest=} [properties] Properties to set + */ + function PreviewDeleteGameServerClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreviewDeleteGameServerClusterRequest name. + * @member {string} name + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest + * @instance + */ + PreviewDeleteGameServerClusterRequest.prototype.name = ""; + + /** + * PreviewDeleteGameServerClusterRequest previewTime. + * @member {google.protobuf.ITimestamp|null|undefined} previewTime + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest + * @instance + */ + PreviewDeleteGameServerClusterRequest.prototype.previewTime = null; + + /** + * Creates a new PreviewDeleteGameServerClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest} PreviewDeleteGameServerClusterRequest instance + */ + PreviewDeleteGameServerClusterRequest.create = function create(properties) { + return new PreviewDeleteGameServerClusterRequest(properties); + }; + + /** + * Encodes the specified PreviewDeleteGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest} message PreviewDeleteGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewDeleteGameServerClusterRequest.encode = function encode(message, writer) { + 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.previewTime != null && Object.hasOwnProperty.call(message, "previewTime")) + $root.google.protobuf.Timestamp.encode(message.previewTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreviewDeleteGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest} message PreviewDeleteGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewDeleteGameServerClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreviewDeleteGameServerClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest} PreviewDeleteGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewDeleteGameServerClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.previewTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreviewDeleteGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest} PreviewDeleteGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewDeleteGameServerClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreviewDeleteGameServerClusterRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreviewDeleteGameServerClusterRequest.verify = function verify(message) { + if (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.previewTime != null && message.hasOwnProperty("previewTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.previewTime); + if (error) + return "previewTime." + error; + } + return null; + }; + + /** + * Creates a PreviewDeleteGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest} PreviewDeleteGameServerClusterRequest + */ + PreviewDeleteGameServerClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.previewTime != null) { + if (typeof object.previewTime !== "object") + throw TypeError(".google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest.previewTime: object expected"); + message.previewTime = $root.google.protobuf.Timestamp.fromObject(object.previewTime); + } + return message; + }; + + /** + * Creates a plain object from a PreviewDeleteGameServerClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest} message PreviewDeleteGameServerClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreviewDeleteGameServerClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.previewTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.previewTime != null && message.hasOwnProperty("previewTime")) + object.previewTime = $root.google.protobuf.Timestamp.toObject(message.previewTime, options); + return object; + }; + + /** + * Converts this PreviewDeleteGameServerClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest + * @instance + * @returns {Object.} JSON object + */ + PreviewDeleteGameServerClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PreviewDeleteGameServerClusterRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PreviewDeleteGameServerClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest"; + }; + + return PreviewDeleteGameServerClusterRequest; + })(); + + v1beta.PreviewDeleteGameServerClusterResponse = (function() { + + /** + * Properties of a PreviewDeleteGameServerClusterResponse. + * @memberof google.cloud.gaming.v1beta + * @interface IPreviewDeleteGameServerClusterResponse + * @property {string|null} [etag] PreviewDeleteGameServerClusterResponse etag + * @property {google.cloud.gaming.v1beta.ITargetState|null} [targetState] PreviewDeleteGameServerClusterResponse targetState + */ + + /** + * Constructs a new PreviewDeleteGameServerClusterResponse. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a PreviewDeleteGameServerClusterResponse. + * @implements IPreviewDeleteGameServerClusterResponse + * @constructor + * @param {google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse=} [properties] Properties to set + */ + function PreviewDeleteGameServerClusterResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreviewDeleteGameServerClusterResponse etag. + * @member {string} etag + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse + * @instance + */ + PreviewDeleteGameServerClusterResponse.prototype.etag = ""; + + /** + * PreviewDeleteGameServerClusterResponse targetState. + * @member {google.cloud.gaming.v1beta.ITargetState|null|undefined} targetState + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse + * @instance + */ + PreviewDeleteGameServerClusterResponse.prototype.targetState = null; + + /** + * Creates a new PreviewDeleteGameServerClusterResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse} PreviewDeleteGameServerClusterResponse instance + */ + PreviewDeleteGameServerClusterResponse.create = function create(properties) { + return new PreviewDeleteGameServerClusterResponse(properties); + }; + + /** + * Encodes the specified PreviewDeleteGameServerClusterResponse message. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse} message PreviewDeleteGameServerClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewDeleteGameServerClusterResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.targetState != null && Object.hasOwnProperty.call(message, "targetState")) + $root.google.cloud.gaming.v1beta.TargetState.encode(message.targetState, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreviewDeleteGameServerClusterResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse} message PreviewDeleteGameServerClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewDeleteGameServerClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreviewDeleteGameServerClusterResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse} PreviewDeleteGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewDeleteGameServerClusterResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.etag = reader.string(); + break; + } + case 3: { + message.targetState = $root.google.cloud.gaming.v1beta.TargetState.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreviewDeleteGameServerClusterResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse} PreviewDeleteGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewDeleteGameServerClusterResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreviewDeleteGameServerClusterResponse message. + * @function verify + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreviewDeleteGameServerClusterResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.targetState != null && message.hasOwnProperty("targetState")) { + var error = $root.google.cloud.gaming.v1beta.TargetState.verify(message.targetState); + if (error) + return "targetState." + error; + } + return null; + }; + + /** + * Creates a PreviewDeleteGameServerClusterResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse} PreviewDeleteGameServerClusterResponse + */ + PreviewDeleteGameServerClusterResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse) + return object; + var message = new $root.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse(); + if (object.etag != null) + message.etag = String(object.etag); + if (object.targetState != null) { + if (typeof object.targetState !== "object") + throw TypeError(".google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse.targetState: object expected"); + message.targetState = $root.google.cloud.gaming.v1beta.TargetState.fromObject(object.targetState); + } + return message; + }; + + /** + * Creates a plain object from a PreviewDeleteGameServerClusterResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse} message PreviewDeleteGameServerClusterResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreviewDeleteGameServerClusterResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.etag = ""; + object.targetState = null; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.targetState != null && message.hasOwnProperty("targetState")) + object.targetState = $root.google.cloud.gaming.v1beta.TargetState.toObject(message.targetState, options); + return object; + }; + + /** + * Converts this PreviewDeleteGameServerClusterResponse to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse + * @instance + * @returns {Object.} JSON object + */ + PreviewDeleteGameServerClusterResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PreviewDeleteGameServerClusterResponse + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PreviewDeleteGameServerClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse"; + }; + + return PreviewDeleteGameServerClusterResponse; + })(); + + v1beta.UpdateGameServerClusterRequest = (function() { + + /** + * Properties of an UpdateGameServerClusterRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IUpdateGameServerClusterRequest + * @property {google.cloud.gaming.v1beta.IGameServerCluster|null} [gameServerCluster] UpdateGameServerClusterRequest gameServerCluster + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateGameServerClusterRequest updateMask + */ + + /** + * Constructs a new UpdateGameServerClusterRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents an UpdateGameServerClusterRequest. + * @implements IUpdateGameServerClusterRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest=} [properties] Properties to set + */ + function UpdateGameServerClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateGameServerClusterRequest gameServerCluster. + * @member {google.cloud.gaming.v1beta.IGameServerCluster|null|undefined} gameServerCluster + * @memberof google.cloud.gaming.v1beta.UpdateGameServerClusterRequest + * @instance + */ + UpdateGameServerClusterRequest.prototype.gameServerCluster = null; + + /** + * UpdateGameServerClusterRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.gaming.v1beta.UpdateGameServerClusterRequest + * @instance + */ + UpdateGameServerClusterRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateGameServerClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.UpdateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.UpdateGameServerClusterRequest} UpdateGameServerClusterRequest instance + */ + UpdateGameServerClusterRequest.create = function create(properties) { + return new UpdateGameServerClusterRequest(properties); + }; + + /** + * Encodes the specified UpdateGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.UpdateGameServerClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.UpdateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest} message UpdateGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGameServerClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gameServerCluster != null && Object.hasOwnProperty.call(message, "gameServerCluster")) + $root.google.cloud.gaming.v1beta.GameServerCluster.encode(message.gameServerCluster, 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 UpdateGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.UpdateGameServerClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.UpdateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest} message UpdateGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGameServerClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateGameServerClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.UpdateGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.UpdateGameServerClusterRequest} UpdateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGameServerClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.UpdateGameServerClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gameServerCluster = $root.google.cloud.gaming.v1beta.GameServerCluster.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 UpdateGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.UpdateGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.UpdateGameServerClusterRequest} UpdateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGameServerClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateGameServerClusterRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.UpdateGameServerClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateGameServerClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gameServerCluster != null && message.hasOwnProperty("gameServerCluster")) { + var error = $root.google.cloud.gaming.v1beta.GameServerCluster.verify(message.gameServerCluster); + if (error) + return "gameServerCluster." + 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 UpdateGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.UpdateGameServerClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.UpdateGameServerClusterRequest} UpdateGameServerClusterRequest + */ + UpdateGameServerClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.UpdateGameServerClusterRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.UpdateGameServerClusterRequest(); + if (object.gameServerCluster != null) { + if (typeof object.gameServerCluster !== "object") + throw TypeError(".google.cloud.gaming.v1beta.UpdateGameServerClusterRequest.gameServerCluster: object expected"); + message.gameServerCluster = $root.google.cloud.gaming.v1beta.GameServerCluster.fromObject(object.gameServerCluster); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.gaming.v1beta.UpdateGameServerClusterRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateGameServerClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.UpdateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.UpdateGameServerClusterRequest} message UpdateGameServerClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateGameServerClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gameServerCluster = null; + object.updateMask = null; + } + if (message.gameServerCluster != null && message.hasOwnProperty("gameServerCluster")) + object.gameServerCluster = $root.google.cloud.gaming.v1beta.GameServerCluster.toObject(message.gameServerCluster, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateGameServerClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.UpdateGameServerClusterRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateGameServerClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateGameServerClusterRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.UpdateGameServerClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateGameServerClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.UpdateGameServerClusterRequest"; + }; + + return UpdateGameServerClusterRequest; + })(); + + v1beta.PreviewUpdateGameServerClusterRequest = (function() { + + /** + * Properties of a PreviewUpdateGameServerClusterRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IPreviewUpdateGameServerClusterRequest + * @property {google.cloud.gaming.v1beta.IGameServerCluster|null} [gameServerCluster] PreviewUpdateGameServerClusterRequest gameServerCluster + * @property {google.protobuf.IFieldMask|null} [updateMask] PreviewUpdateGameServerClusterRequest updateMask + * @property {google.protobuf.ITimestamp|null} [previewTime] PreviewUpdateGameServerClusterRequest previewTime + */ + + /** + * Constructs a new PreviewUpdateGameServerClusterRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a PreviewUpdateGameServerClusterRequest. + * @implements IPreviewUpdateGameServerClusterRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest=} [properties] Properties to set + */ + function PreviewUpdateGameServerClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreviewUpdateGameServerClusterRequest gameServerCluster. + * @member {google.cloud.gaming.v1beta.IGameServerCluster|null|undefined} gameServerCluster + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest + * @instance + */ + PreviewUpdateGameServerClusterRequest.prototype.gameServerCluster = null; + + /** + * PreviewUpdateGameServerClusterRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest + * @instance + */ + PreviewUpdateGameServerClusterRequest.prototype.updateMask = null; + + /** + * PreviewUpdateGameServerClusterRequest previewTime. + * @member {google.protobuf.ITimestamp|null|undefined} previewTime + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest + * @instance + */ + PreviewUpdateGameServerClusterRequest.prototype.previewTime = null; + + /** + * Creates a new PreviewUpdateGameServerClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest} PreviewUpdateGameServerClusterRequest instance + */ + PreviewUpdateGameServerClusterRequest.create = function create(properties) { + return new PreviewUpdateGameServerClusterRequest(properties); + }; + + /** + * Encodes the specified PreviewUpdateGameServerClusterRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest} message PreviewUpdateGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewUpdateGameServerClusterRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gameServerCluster != null && Object.hasOwnProperty.call(message, "gameServerCluster")) + $root.google.cloud.gaming.v1beta.GameServerCluster.encode(message.gameServerCluster, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.previewTime != null && Object.hasOwnProperty.call(message, "previewTime")) + $root.google.protobuf.Timestamp.encode(message.previewTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreviewUpdateGameServerClusterRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest} message PreviewUpdateGameServerClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewUpdateGameServerClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreviewUpdateGameServerClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest} PreviewUpdateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewUpdateGameServerClusterRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gameServerCluster = $root.google.cloud.gaming.v1beta.GameServerCluster.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.previewTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreviewUpdateGameServerClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest} PreviewUpdateGameServerClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewUpdateGameServerClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreviewUpdateGameServerClusterRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreviewUpdateGameServerClusterRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gameServerCluster != null && message.hasOwnProperty("gameServerCluster")) { + var error = $root.google.cloud.gaming.v1beta.GameServerCluster.verify(message.gameServerCluster); + if (error) + return "gameServerCluster." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.previewTime != null && message.hasOwnProperty("previewTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.previewTime); + if (error) + return "previewTime." + error; + } + return null; + }; + + /** + * Creates a PreviewUpdateGameServerClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest} PreviewUpdateGameServerClusterRequest + */ + PreviewUpdateGameServerClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest(); + if (object.gameServerCluster != null) { + if (typeof object.gameServerCluster !== "object") + throw TypeError(".google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest.gameServerCluster: object expected"); + message.gameServerCluster = $root.google.cloud.gaming.v1beta.GameServerCluster.fromObject(object.gameServerCluster); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.previewTime != null) { + if (typeof object.previewTime !== "object") + throw TypeError(".google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest.previewTime: object expected"); + message.previewTime = $root.google.protobuf.Timestamp.fromObject(object.previewTime); + } + return message; + }; + + /** + * Creates a plain object from a PreviewUpdateGameServerClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest + * @static + * @param {google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest} message PreviewUpdateGameServerClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreviewUpdateGameServerClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gameServerCluster = null; + object.updateMask = null; + object.previewTime = null; + } + if (message.gameServerCluster != null && message.hasOwnProperty("gameServerCluster")) + object.gameServerCluster = $root.google.cloud.gaming.v1beta.GameServerCluster.toObject(message.gameServerCluster, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.previewTime != null && message.hasOwnProperty("previewTime")) + object.previewTime = $root.google.protobuf.Timestamp.toObject(message.previewTime, options); + return object; + }; + + /** + * Converts this PreviewUpdateGameServerClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest + * @instance + * @returns {Object.} JSON object + */ + PreviewUpdateGameServerClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PreviewUpdateGameServerClusterRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PreviewUpdateGameServerClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest"; + }; + + return PreviewUpdateGameServerClusterRequest; + })(); + + v1beta.PreviewUpdateGameServerClusterResponse = (function() { + + /** + * Properties of a PreviewUpdateGameServerClusterResponse. + * @memberof google.cloud.gaming.v1beta + * @interface IPreviewUpdateGameServerClusterResponse + * @property {string|null} [etag] PreviewUpdateGameServerClusterResponse etag + * @property {google.cloud.gaming.v1beta.ITargetState|null} [targetState] PreviewUpdateGameServerClusterResponse targetState + */ + + /** + * Constructs a new PreviewUpdateGameServerClusterResponse. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a PreviewUpdateGameServerClusterResponse. + * @implements IPreviewUpdateGameServerClusterResponse + * @constructor + * @param {google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse=} [properties] Properties to set + */ + function PreviewUpdateGameServerClusterResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreviewUpdateGameServerClusterResponse etag. + * @member {string} etag + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse + * @instance + */ + PreviewUpdateGameServerClusterResponse.prototype.etag = ""; + + /** + * PreviewUpdateGameServerClusterResponse targetState. + * @member {google.cloud.gaming.v1beta.ITargetState|null|undefined} targetState + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse + * @instance + */ + PreviewUpdateGameServerClusterResponse.prototype.targetState = null; + + /** + * Creates a new PreviewUpdateGameServerClusterResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse} PreviewUpdateGameServerClusterResponse instance + */ + PreviewUpdateGameServerClusterResponse.create = function create(properties) { + return new PreviewUpdateGameServerClusterResponse(properties); + }; + + /** + * Encodes the specified PreviewUpdateGameServerClusterResponse message. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse} message PreviewUpdateGameServerClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewUpdateGameServerClusterResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.targetState != null && Object.hasOwnProperty.call(message, "targetState")) + $root.google.cloud.gaming.v1beta.TargetState.encode(message.targetState, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreviewUpdateGameServerClusterResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse} message PreviewUpdateGameServerClusterResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewUpdateGameServerClusterResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreviewUpdateGameServerClusterResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse} PreviewUpdateGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewUpdateGameServerClusterResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.etag = reader.string(); + break; + } + case 3: { + message.targetState = $root.google.cloud.gaming.v1beta.TargetState.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreviewUpdateGameServerClusterResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse} PreviewUpdateGameServerClusterResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewUpdateGameServerClusterResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreviewUpdateGameServerClusterResponse message. + * @function verify + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreviewUpdateGameServerClusterResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.targetState != null && message.hasOwnProperty("targetState")) { + var error = $root.google.cloud.gaming.v1beta.TargetState.verify(message.targetState); + if (error) + return "targetState." + error; + } + return null; + }; + + /** + * Creates a PreviewUpdateGameServerClusterResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse} PreviewUpdateGameServerClusterResponse + */ + PreviewUpdateGameServerClusterResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse) + return object; + var message = new $root.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse(); + if (object.etag != null) + message.etag = String(object.etag); + if (object.targetState != null) { + if (typeof object.targetState !== "object") + throw TypeError(".google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse.targetState: object expected"); + message.targetState = $root.google.cloud.gaming.v1beta.TargetState.fromObject(object.targetState); + } + return message; + }; + + /** + * Creates a plain object from a PreviewUpdateGameServerClusterResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse + * @static + * @param {google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse} message PreviewUpdateGameServerClusterResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreviewUpdateGameServerClusterResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.etag = ""; + object.targetState = null; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.targetState != null && message.hasOwnProperty("targetState")) + object.targetState = $root.google.cloud.gaming.v1beta.TargetState.toObject(message.targetState, options); + return object; + }; + + /** + * Converts this PreviewUpdateGameServerClusterResponse to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse + * @instance + * @returns {Object.} JSON object + */ + PreviewUpdateGameServerClusterResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PreviewUpdateGameServerClusterResponse + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PreviewUpdateGameServerClusterResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse"; + }; + + return PreviewUpdateGameServerClusterResponse; + })(); + + v1beta.GameServerClusterConnectionInfo = (function() { + + /** + * Properties of a GameServerClusterConnectionInfo. + * @memberof google.cloud.gaming.v1beta + * @interface IGameServerClusterConnectionInfo + * @property {google.cloud.gaming.v1beta.IGkeClusterReference|null} [gkeClusterReference] GameServerClusterConnectionInfo gkeClusterReference + * @property {string|null} [namespace] GameServerClusterConnectionInfo namespace + */ + + /** + * Constructs a new GameServerClusterConnectionInfo. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a GameServerClusterConnectionInfo. + * @implements IGameServerClusterConnectionInfo + * @constructor + * @param {google.cloud.gaming.v1beta.IGameServerClusterConnectionInfo=} [properties] Properties to set + */ + function GameServerClusterConnectionInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GameServerClusterConnectionInfo gkeClusterReference. + * @member {google.cloud.gaming.v1beta.IGkeClusterReference|null|undefined} gkeClusterReference + * @memberof google.cloud.gaming.v1beta.GameServerClusterConnectionInfo + * @instance + */ + GameServerClusterConnectionInfo.prototype.gkeClusterReference = null; + + /** + * GameServerClusterConnectionInfo namespace. + * @member {string} namespace + * @memberof google.cloud.gaming.v1beta.GameServerClusterConnectionInfo + * @instance + */ + GameServerClusterConnectionInfo.prototype.namespace = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GameServerClusterConnectionInfo clusterReference. + * @member {"gkeClusterReference"|undefined} clusterReference + * @memberof google.cloud.gaming.v1beta.GameServerClusterConnectionInfo + * @instance + */ + Object.defineProperty(GameServerClusterConnectionInfo.prototype, "clusterReference", { + get: $util.oneOfGetter($oneOfFields = ["gkeClusterReference"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GameServerClusterConnectionInfo instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.GameServerClusterConnectionInfo + * @static + * @param {google.cloud.gaming.v1beta.IGameServerClusterConnectionInfo=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.GameServerClusterConnectionInfo} GameServerClusterConnectionInfo instance + */ + GameServerClusterConnectionInfo.create = function create(properties) { + return new GameServerClusterConnectionInfo(properties); + }; + + /** + * Encodes the specified GameServerClusterConnectionInfo message. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerClusterConnectionInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.GameServerClusterConnectionInfo + * @static + * @param {google.cloud.gaming.v1beta.IGameServerClusterConnectionInfo} message GameServerClusterConnectionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerClusterConnectionInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.namespace != null && Object.hasOwnProperty.call(message, "namespace")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.namespace); + if (message.gkeClusterReference != null && Object.hasOwnProperty.call(message, "gkeClusterReference")) + $root.google.cloud.gaming.v1beta.GkeClusterReference.encode(message.gkeClusterReference, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GameServerClusterConnectionInfo message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerClusterConnectionInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.GameServerClusterConnectionInfo + * @static + * @param {google.cloud.gaming.v1beta.IGameServerClusterConnectionInfo} message GameServerClusterConnectionInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerClusterConnectionInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GameServerClusterConnectionInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.GameServerClusterConnectionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.GameServerClusterConnectionInfo} GameServerClusterConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerClusterConnectionInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.GameServerClusterConnectionInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 7: { + message.gkeClusterReference = $root.google.cloud.gaming.v1beta.GkeClusterReference.decode(reader, reader.uint32()); + break; + } + case 5: { + message.namespace = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GameServerClusterConnectionInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.GameServerClusterConnectionInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.GameServerClusterConnectionInfo} GameServerClusterConnectionInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerClusterConnectionInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GameServerClusterConnectionInfo message. + * @function verify + * @memberof google.cloud.gaming.v1beta.GameServerClusterConnectionInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GameServerClusterConnectionInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gkeClusterReference != null && message.hasOwnProperty("gkeClusterReference")) { + properties.clusterReference = 1; + { + var error = $root.google.cloud.gaming.v1beta.GkeClusterReference.verify(message.gkeClusterReference); + if (error) + return "gkeClusterReference." + error; + } + } + if (message.namespace != null && message.hasOwnProperty("namespace")) + if (!$util.isString(message.namespace)) + return "namespace: string expected"; + return null; + }; + + /** + * Creates a GameServerClusterConnectionInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.GameServerClusterConnectionInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.GameServerClusterConnectionInfo} GameServerClusterConnectionInfo + */ + GameServerClusterConnectionInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.GameServerClusterConnectionInfo) + return object; + var message = new $root.google.cloud.gaming.v1beta.GameServerClusterConnectionInfo(); + if (object.gkeClusterReference != null) { + if (typeof object.gkeClusterReference !== "object") + throw TypeError(".google.cloud.gaming.v1beta.GameServerClusterConnectionInfo.gkeClusterReference: object expected"); + message.gkeClusterReference = $root.google.cloud.gaming.v1beta.GkeClusterReference.fromObject(object.gkeClusterReference); + } + if (object.namespace != null) + message.namespace = String(object.namespace); + return message; + }; + + /** + * Creates a plain object from a GameServerClusterConnectionInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.GameServerClusterConnectionInfo + * @static + * @param {google.cloud.gaming.v1beta.GameServerClusterConnectionInfo} message GameServerClusterConnectionInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GameServerClusterConnectionInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.namespace = ""; + if (message.namespace != null && message.hasOwnProperty("namespace")) + object.namespace = message.namespace; + if (message.gkeClusterReference != null && message.hasOwnProperty("gkeClusterReference")) { + object.gkeClusterReference = $root.google.cloud.gaming.v1beta.GkeClusterReference.toObject(message.gkeClusterReference, options); + if (options.oneofs) + object.clusterReference = "gkeClusterReference"; + } + return object; + }; + + /** + * Converts this GameServerClusterConnectionInfo to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.GameServerClusterConnectionInfo + * @instance + * @returns {Object.} JSON object + */ + GameServerClusterConnectionInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GameServerClusterConnectionInfo + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.GameServerClusterConnectionInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GameServerClusterConnectionInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.GameServerClusterConnectionInfo"; + }; + + return GameServerClusterConnectionInfo; + })(); + + v1beta.GkeClusterReference = (function() { + + /** + * Properties of a GkeClusterReference. + * @memberof google.cloud.gaming.v1beta + * @interface IGkeClusterReference + * @property {string|null} [cluster] GkeClusterReference cluster + */ + + /** + * Constructs a new GkeClusterReference. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a GkeClusterReference. + * @implements IGkeClusterReference + * @constructor + * @param {google.cloud.gaming.v1beta.IGkeClusterReference=} [properties] Properties to set + */ + function GkeClusterReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GkeClusterReference cluster. + * @member {string} cluster + * @memberof google.cloud.gaming.v1beta.GkeClusterReference + * @instance + */ + GkeClusterReference.prototype.cluster = ""; + + /** + * Creates a new GkeClusterReference instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.GkeClusterReference + * @static + * @param {google.cloud.gaming.v1beta.IGkeClusterReference=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.GkeClusterReference} GkeClusterReference instance + */ + GkeClusterReference.create = function create(properties) { + return new GkeClusterReference(properties); + }; + + /** + * Encodes the specified GkeClusterReference message. Does not implicitly {@link google.cloud.gaming.v1beta.GkeClusterReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.GkeClusterReference + * @static + * @param {google.cloud.gaming.v1beta.IGkeClusterReference} message GkeClusterReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GkeClusterReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cluster); + return writer; + }; + + /** + * Encodes the specified GkeClusterReference message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GkeClusterReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.GkeClusterReference + * @static + * @param {google.cloud.gaming.v1beta.IGkeClusterReference} message GkeClusterReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GkeClusterReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GkeClusterReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.GkeClusterReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.GkeClusterReference} GkeClusterReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GkeClusterReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.GkeClusterReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cluster = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GkeClusterReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.GkeClusterReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.GkeClusterReference} GkeClusterReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GkeClusterReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GkeClusterReference message. + * @function verify + * @memberof google.cloud.gaming.v1beta.GkeClusterReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GkeClusterReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) + if (!$util.isString(message.cluster)) + return "cluster: string expected"; + return null; + }; + + /** + * Creates a GkeClusterReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.GkeClusterReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.GkeClusterReference} GkeClusterReference + */ + GkeClusterReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.GkeClusterReference) + return object; + var message = new $root.google.cloud.gaming.v1beta.GkeClusterReference(); + if (object.cluster != null) + message.cluster = String(object.cluster); + return message; + }; + + /** + * Creates a plain object from a GkeClusterReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.GkeClusterReference + * @static + * @param {google.cloud.gaming.v1beta.GkeClusterReference} message GkeClusterReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GkeClusterReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.cluster = ""; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = message.cluster; + return object; + }; + + /** + * Converts this GkeClusterReference to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.GkeClusterReference + * @instance + * @returns {Object.} JSON object + */ + GkeClusterReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GkeClusterReference + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.GkeClusterReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GkeClusterReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.GkeClusterReference"; + }; + + return GkeClusterReference; + })(); + + v1beta.GameServerCluster = (function() { + + /** + * Properties of a GameServerCluster. + * @memberof google.cloud.gaming.v1beta + * @interface IGameServerCluster + * @property {string|null} [name] GameServerCluster name + * @property {google.protobuf.ITimestamp|null} [createTime] GameServerCluster createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] GameServerCluster updateTime + * @property {Object.|null} [labels] GameServerCluster labels + * @property {google.cloud.gaming.v1beta.IGameServerClusterConnectionInfo|null} [connectionInfo] GameServerCluster connectionInfo + * @property {string|null} [etag] GameServerCluster etag + * @property {string|null} [description] GameServerCluster description + */ + + /** + * Constructs a new GameServerCluster. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a GameServerCluster. + * @implements IGameServerCluster + * @constructor + * @param {google.cloud.gaming.v1beta.IGameServerCluster=} [properties] Properties to set + */ + function GameServerCluster(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]]; + } + + /** + * GameServerCluster name. + * @member {string} name + * @memberof google.cloud.gaming.v1beta.GameServerCluster + * @instance + */ + GameServerCluster.prototype.name = ""; + + /** + * GameServerCluster createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.gaming.v1beta.GameServerCluster + * @instance + */ + GameServerCluster.prototype.createTime = null; + + /** + * GameServerCluster updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.gaming.v1beta.GameServerCluster + * @instance + */ + GameServerCluster.prototype.updateTime = null; + + /** + * GameServerCluster labels. + * @member {Object.} labels + * @memberof google.cloud.gaming.v1beta.GameServerCluster + * @instance + */ + GameServerCluster.prototype.labels = $util.emptyObject; + + /** + * GameServerCluster connectionInfo. + * @member {google.cloud.gaming.v1beta.IGameServerClusterConnectionInfo|null|undefined} connectionInfo + * @memberof google.cloud.gaming.v1beta.GameServerCluster + * @instance + */ + GameServerCluster.prototype.connectionInfo = null; + + /** + * GameServerCluster etag. + * @member {string} etag + * @memberof google.cloud.gaming.v1beta.GameServerCluster + * @instance + */ + GameServerCluster.prototype.etag = ""; + + /** + * GameServerCluster description. + * @member {string} description + * @memberof google.cloud.gaming.v1beta.GameServerCluster + * @instance + */ + GameServerCluster.prototype.description = ""; + + /** + * Creates a new GameServerCluster instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.GameServerCluster + * @static + * @param {google.cloud.gaming.v1beta.IGameServerCluster=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.GameServerCluster} GameServerCluster instance + */ + GameServerCluster.create = function create(properties) { + return new GameServerCluster(properties); + }; + + /** + * Encodes the specified GameServerCluster message. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerCluster.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.GameServerCluster + * @static + * @param {google.cloud.gaming.v1beta.IGameServerCluster} message GameServerCluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerCluster.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.connectionInfo != null && Object.hasOwnProperty.call(message, "connectionInfo")) + $root.google.cloud.gaming.v1beta.GameServerClusterConnectionInfo.encode(message.connectionInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); + return writer; + }; + + /** + * Encodes the specified GameServerCluster message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerCluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.GameServerCluster + * @static + * @param {google.cloud.gaming.v1beta.IGameServerCluster} message GameServerCluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerCluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GameServerCluster message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.GameServerCluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.GameServerCluster} GameServerCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerCluster.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.GameServerCluster(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + message.connectionInfo = $root.google.cloud.gaming.v1beta.GameServerClusterConnectionInfo.decode(reader, reader.uint32()); + break; + } + case 6: { + message.etag = reader.string(); + break; + } + case 7: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GameServerCluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.GameServerCluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.GameServerCluster} GameServerCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerCluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GameServerCluster message. + * @function verify + * @memberof google.cloud.gaming.v1beta.GameServerCluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GameServerCluster.verify = function verify(message) { + if (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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.connectionInfo != null && message.hasOwnProperty("connectionInfo")) { + var error = $root.google.cloud.gaming.v1beta.GameServerClusterConnectionInfo.verify(message.connectionInfo); + if (error) + return "connectionInfo." + error; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a GameServerCluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.GameServerCluster + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.GameServerCluster} GameServerCluster + */ + GameServerCluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.GameServerCluster) + return object; + var message = new $root.google.cloud.gaming.v1beta.GameServerCluster(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.gaming.v1beta.GameServerCluster.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.gaming.v1beta.GameServerCluster.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.gaming.v1beta.GameServerCluster.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.connectionInfo != null) { + if (typeof object.connectionInfo !== "object") + throw TypeError(".google.cloud.gaming.v1beta.GameServerCluster.connectionInfo: object expected"); + message.connectionInfo = $root.google.cloud.gaming.v1beta.GameServerClusterConnectionInfo.fromObject(object.connectionInfo); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a GameServerCluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.GameServerCluster + * @static + * @param {google.cloud.gaming.v1beta.GameServerCluster} message GameServerCluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GameServerCluster.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.connectionInfo = null; + object.etag = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.connectionInfo != null && message.hasOwnProperty("connectionInfo")) + object.connectionInfo = $root.google.cloud.gaming.v1beta.GameServerClusterConnectionInfo.toObject(message.connectionInfo, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this GameServerCluster to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.GameServerCluster + * @instance + * @returns {Object.} JSON object + */ + GameServerCluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GameServerCluster + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.GameServerCluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GameServerCluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.GameServerCluster"; + }; + + return GameServerCluster; + })(); + + v1beta.GameServerClustersService = (function() { + + /** + * Constructs a new GameServerClustersService service. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a GameServerClustersService + * @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 GameServerClustersService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (GameServerClustersService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GameServerClustersService; + + /** + * Creates new GameServerClustersService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @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 {GameServerClustersService} RPC service. Useful where requests and/or responses are streamed. + */ + GameServerClustersService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|listGameServerClusters}. + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @typedef ListGameServerClustersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1beta.ListGameServerClustersResponse} [response] ListGameServerClustersResponse + */ + + /** + * Calls ListGameServerClusters. + * @function listGameServerClusters + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1beta.IListGameServerClustersRequest} request ListGameServerClustersRequest message or plain object + * @param {google.cloud.gaming.v1beta.GameServerClustersService.ListGameServerClustersCallback} callback Node-style callback called with the error, if any, and ListGameServerClustersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerClustersService.prototype.listGameServerClusters = function listGameServerClusters(request, callback) { + return this.rpcCall(listGameServerClusters, $root.google.cloud.gaming.v1beta.ListGameServerClustersRequest, $root.google.cloud.gaming.v1beta.ListGameServerClustersResponse, request, callback); + }, "name", { value: "ListGameServerClusters" }); + + /** + * Calls ListGameServerClusters. + * @function listGameServerClusters + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1beta.IListGameServerClustersRequest} request ListGameServerClustersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|getGameServerCluster}. + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @typedef GetGameServerClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1beta.GameServerCluster} [response] GameServerCluster + */ + + /** + * Calls GetGameServerCluster. + * @function getGameServerCluster + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1beta.IGetGameServerClusterRequest} request GetGameServerClusterRequest message or plain object + * @param {google.cloud.gaming.v1beta.GameServerClustersService.GetGameServerClusterCallback} callback Node-style callback called with the error, if any, and GameServerCluster + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerClustersService.prototype.getGameServerCluster = function getGameServerCluster(request, callback) { + return this.rpcCall(getGameServerCluster, $root.google.cloud.gaming.v1beta.GetGameServerClusterRequest, $root.google.cloud.gaming.v1beta.GameServerCluster, request, callback); + }, "name", { value: "GetGameServerCluster" }); + + /** + * Calls GetGameServerCluster. + * @function getGameServerCluster + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1beta.IGetGameServerClusterRequest} request GetGameServerClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|createGameServerCluster}. + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @typedef CreateGameServerClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateGameServerCluster. + * @function createGameServerCluster + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1beta.ICreateGameServerClusterRequest} request CreateGameServerClusterRequest message or plain object + * @param {google.cloud.gaming.v1beta.GameServerClustersService.CreateGameServerClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerClustersService.prototype.createGameServerCluster = function createGameServerCluster(request, callback) { + return this.rpcCall(createGameServerCluster, $root.google.cloud.gaming.v1beta.CreateGameServerClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateGameServerCluster" }); + + /** + * Calls CreateGameServerCluster. + * @function createGameServerCluster + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1beta.ICreateGameServerClusterRequest} request CreateGameServerClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|previewCreateGameServerCluster}. + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @typedef PreviewCreateGameServerClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse} [response] PreviewCreateGameServerClusterResponse + */ + + /** + * Calls PreviewCreateGameServerCluster. + * @function previewCreateGameServerCluster + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest} request PreviewCreateGameServerClusterRequest message or plain object + * @param {google.cloud.gaming.v1beta.GameServerClustersService.PreviewCreateGameServerClusterCallback} callback Node-style callback called with the error, if any, and PreviewCreateGameServerClusterResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerClustersService.prototype.previewCreateGameServerCluster = function previewCreateGameServerCluster(request, callback) { + return this.rpcCall(previewCreateGameServerCluster, $root.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest, $root.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse, request, callback); + }, "name", { value: "PreviewCreateGameServerCluster" }); + + /** + * Calls PreviewCreateGameServerCluster. + * @function previewCreateGameServerCluster + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest} request PreviewCreateGameServerClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|deleteGameServerCluster}. + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @typedef DeleteGameServerClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteGameServerCluster. + * @function deleteGameServerCluster + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest} request DeleteGameServerClusterRequest message or plain object + * @param {google.cloud.gaming.v1beta.GameServerClustersService.DeleteGameServerClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerClustersService.prototype.deleteGameServerCluster = function deleteGameServerCluster(request, callback) { + return this.rpcCall(deleteGameServerCluster, $root.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteGameServerCluster" }); + + /** + * Calls DeleteGameServerCluster. + * @function deleteGameServerCluster + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest} request DeleteGameServerClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|previewDeleteGameServerCluster}. + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @typedef PreviewDeleteGameServerClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse} [response] PreviewDeleteGameServerClusterResponse + */ + + /** + * Calls PreviewDeleteGameServerCluster. + * @function previewDeleteGameServerCluster + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest} request PreviewDeleteGameServerClusterRequest message or plain object + * @param {google.cloud.gaming.v1beta.GameServerClustersService.PreviewDeleteGameServerClusterCallback} callback Node-style callback called with the error, if any, and PreviewDeleteGameServerClusterResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerClustersService.prototype.previewDeleteGameServerCluster = function previewDeleteGameServerCluster(request, callback) { + return this.rpcCall(previewDeleteGameServerCluster, $root.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest, $root.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse, request, callback); + }, "name", { value: "PreviewDeleteGameServerCluster" }); + + /** + * Calls PreviewDeleteGameServerCluster. + * @function previewDeleteGameServerCluster + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest} request PreviewDeleteGameServerClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|updateGameServerCluster}. + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @typedef UpdateGameServerClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateGameServerCluster. + * @function updateGameServerCluster + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest} request UpdateGameServerClusterRequest message or plain object + * @param {google.cloud.gaming.v1beta.GameServerClustersService.UpdateGameServerClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerClustersService.prototype.updateGameServerCluster = function updateGameServerCluster(request, callback) { + return this.rpcCall(updateGameServerCluster, $root.google.cloud.gaming.v1beta.UpdateGameServerClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateGameServerCluster" }); + + /** + * Calls UpdateGameServerCluster. + * @function updateGameServerCluster + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest} request UpdateGameServerClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|previewUpdateGameServerCluster}. + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @typedef PreviewUpdateGameServerClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse} [response] PreviewUpdateGameServerClusterResponse + */ + + /** + * Calls PreviewUpdateGameServerCluster. + * @function previewUpdateGameServerCluster + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest} request PreviewUpdateGameServerClusterRequest message or plain object + * @param {google.cloud.gaming.v1beta.GameServerClustersService.PreviewUpdateGameServerClusterCallback} callback Node-style callback called with the error, if any, and PreviewUpdateGameServerClusterResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerClustersService.prototype.previewUpdateGameServerCluster = function previewUpdateGameServerCluster(request, callback) { + return this.rpcCall(previewUpdateGameServerCluster, $root.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest, $root.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse, request, callback); + }, "name", { value: "PreviewUpdateGameServerCluster" }); + + /** + * Calls PreviewUpdateGameServerCluster. + * @function previewUpdateGameServerCluster + * @memberof google.cloud.gaming.v1beta.GameServerClustersService + * @instance + * @param {google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest} request PreviewUpdateGameServerClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return GameServerClustersService; + })(); + + v1beta.ListGameServerConfigsRequest = (function() { + + /** + * Properties of a ListGameServerConfigsRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IListGameServerConfigsRequest + * @property {string|null} [parent] ListGameServerConfigsRequest parent + * @property {number|null} [pageSize] ListGameServerConfigsRequest pageSize + * @property {string|null} [pageToken] ListGameServerConfigsRequest pageToken + * @property {string|null} [filter] ListGameServerConfigsRequest filter + * @property {string|null} [orderBy] ListGameServerConfigsRequest orderBy + */ + + /** + * Constructs a new ListGameServerConfigsRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a ListGameServerConfigsRequest. + * @implements IListGameServerConfigsRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IListGameServerConfigsRequest=} [properties] Properties to set + */ + function ListGameServerConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGameServerConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsRequest + * @instance + */ + ListGameServerConfigsRequest.prototype.parent = ""; + + /** + * ListGameServerConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsRequest + * @instance + */ + ListGameServerConfigsRequest.prototype.pageSize = 0; + + /** + * ListGameServerConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsRequest + * @instance + */ + ListGameServerConfigsRequest.prototype.pageToken = ""; + + /** + * ListGameServerConfigsRequest filter. + * @member {string} filter + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsRequest + * @instance + */ + ListGameServerConfigsRequest.prototype.filter = ""; + + /** + * ListGameServerConfigsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsRequest + * @instance + */ + ListGameServerConfigsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListGameServerConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsRequest + * @static + * @param {google.cloud.gaming.v1beta.IListGameServerConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.ListGameServerConfigsRequest} ListGameServerConfigsRequest instance + */ + ListGameServerConfigsRequest.create = function create(properties) { + return new ListGameServerConfigsRequest(properties); + }; + + /** + * Encodes the specified ListGameServerConfigsRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsRequest + * @static + * @param {google.cloud.gaming.v1beta.IListGameServerConfigsRequest} message ListGameServerConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerConfigsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListGameServerConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsRequest + * @static + * @param {google.cloud.gaming.v1beta.IListGameServerConfigsRequest} message ListGameServerConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGameServerConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.ListGameServerConfigsRequest} ListGameServerConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerConfigsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.ListGameServerConfigsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGameServerConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.ListGameServerConfigsRequest} ListGameServerConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGameServerConfigsRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGameServerConfigsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListGameServerConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.ListGameServerConfigsRequest} ListGameServerConfigsRequest + */ + ListGameServerConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.ListGameServerConfigsRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.ListGameServerConfigsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListGameServerConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsRequest + * @static + * @param {google.cloud.gaming.v1beta.ListGameServerConfigsRequest} message ListGameServerConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGameServerConfigsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListGameServerConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListGameServerConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGameServerConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGameServerConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.ListGameServerConfigsRequest"; + }; + + return ListGameServerConfigsRequest; + })(); + + v1beta.ListGameServerConfigsResponse = (function() { + + /** + * Properties of a ListGameServerConfigsResponse. + * @memberof google.cloud.gaming.v1beta + * @interface IListGameServerConfigsResponse + * @property {Array.|null} [gameServerConfigs] ListGameServerConfigsResponse gameServerConfigs + * @property {string|null} [nextPageToken] ListGameServerConfigsResponse nextPageToken + * @property {Array.|null} [unreachable] ListGameServerConfigsResponse unreachable + */ + + /** + * Constructs a new ListGameServerConfigsResponse. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a ListGameServerConfigsResponse. + * @implements IListGameServerConfigsResponse + * @constructor + * @param {google.cloud.gaming.v1beta.IListGameServerConfigsResponse=} [properties] Properties to set + */ + function ListGameServerConfigsResponse(properties) { + this.gameServerConfigs = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGameServerConfigsResponse gameServerConfigs. + * @member {Array.} gameServerConfigs + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsResponse + * @instance + */ + ListGameServerConfigsResponse.prototype.gameServerConfigs = $util.emptyArray; + + /** + * ListGameServerConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsResponse + * @instance + */ + ListGameServerConfigsResponse.prototype.nextPageToken = ""; + + /** + * ListGameServerConfigsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsResponse + * @instance + */ + ListGameServerConfigsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListGameServerConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsResponse + * @static + * @param {google.cloud.gaming.v1beta.IListGameServerConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.ListGameServerConfigsResponse} ListGameServerConfigsResponse instance + */ + ListGameServerConfigsResponse.create = function create(properties) { + return new ListGameServerConfigsResponse(properties); + }; + + /** + * Encodes the specified ListGameServerConfigsResponse message. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsResponse + * @static + * @param {google.cloud.gaming.v1beta.IListGameServerConfigsResponse} message ListGameServerConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gameServerConfigs != null && message.gameServerConfigs.length) + for (var i = 0; i < message.gameServerConfigs.length; ++i) + $root.google.cloud.gaming.v1beta.GameServerConfig.encode(message.gameServerConfigs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListGameServerConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsResponse + * @static + * @param {google.cloud.gaming.v1beta.IListGameServerConfigsResponse} message ListGameServerConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGameServerConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.ListGameServerConfigsResponse} ListGameServerConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerConfigsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.ListGameServerConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.gameServerConfigs && message.gameServerConfigs.length)) + message.gameServerConfigs = []; + message.gameServerConfigs.push($root.google.cloud.gaming.v1beta.GameServerConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGameServerConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.ListGameServerConfigsResponse} ListGameServerConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGameServerConfigsResponse message. + * @function verify + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGameServerConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gameServerConfigs != null && message.hasOwnProperty("gameServerConfigs")) { + if (!Array.isArray(message.gameServerConfigs)) + return "gameServerConfigs: array expected"; + for (var i = 0; i < message.gameServerConfigs.length; ++i) { + var error = $root.google.cloud.gaming.v1beta.GameServerConfig.verify(message.gameServerConfigs[i]); + if (error) + return "gameServerConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListGameServerConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.ListGameServerConfigsResponse} ListGameServerConfigsResponse + */ + ListGameServerConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.ListGameServerConfigsResponse) + return object; + var message = new $root.google.cloud.gaming.v1beta.ListGameServerConfigsResponse(); + if (object.gameServerConfigs) { + if (!Array.isArray(object.gameServerConfigs)) + throw TypeError(".google.cloud.gaming.v1beta.ListGameServerConfigsResponse.gameServerConfigs: array expected"); + message.gameServerConfigs = []; + for (var i = 0; i < object.gameServerConfigs.length; ++i) { + if (typeof object.gameServerConfigs[i] !== "object") + throw TypeError(".google.cloud.gaming.v1beta.ListGameServerConfigsResponse.gameServerConfigs: object expected"); + message.gameServerConfigs[i] = $root.google.cloud.gaming.v1beta.GameServerConfig.fromObject(object.gameServerConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.gaming.v1beta.ListGameServerConfigsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListGameServerConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsResponse + * @static + * @param {google.cloud.gaming.v1beta.ListGameServerConfigsResponse} message ListGameServerConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGameServerConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.gameServerConfigs = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.gameServerConfigs && message.gameServerConfigs.length) { + object.gameServerConfigs = []; + for (var j = 0; j < message.gameServerConfigs.length; ++j) + object.gameServerConfigs[j] = $root.google.cloud.gaming.v1beta.GameServerConfig.toObject(message.gameServerConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListGameServerConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListGameServerConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGameServerConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.ListGameServerConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGameServerConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.ListGameServerConfigsResponse"; + }; + + return ListGameServerConfigsResponse; + })(); + + v1beta.GetGameServerConfigRequest = (function() { + + /** + * Properties of a GetGameServerConfigRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IGetGameServerConfigRequest + * @property {string|null} [name] GetGameServerConfigRequest name + */ + + /** + * Constructs a new GetGameServerConfigRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a GetGameServerConfigRequest. + * @implements IGetGameServerConfigRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IGetGameServerConfigRequest=} [properties] Properties to set + */ + function GetGameServerConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGameServerConfigRequest name. + * @member {string} name + * @memberof google.cloud.gaming.v1beta.GetGameServerConfigRequest + * @instance + */ + GetGameServerConfigRequest.prototype.name = ""; + + /** + * Creates a new GetGameServerConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.GetGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1beta.IGetGameServerConfigRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.GetGameServerConfigRequest} GetGameServerConfigRequest instance + */ + GetGameServerConfigRequest.create = function create(properties) { + return new GetGameServerConfigRequest(properties); + }; + + /** + * Encodes the specified GetGameServerConfigRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.GetGameServerConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.GetGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1beta.IGetGameServerConfigRequest} message GetGameServerConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGameServerConfigRequest.encode = function encode(message, writer) { + 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 GetGameServerConfigRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GetGameServerConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.GetGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1beta.IGetGameServerConfigRequest} message GetGameServerConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGameServerConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGameServerConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.GetGameServerConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.GetGameServerConfigRequest} GetGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGameServerConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.GetGameServerConfigRequest(); + 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 GetGameServerConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.GetGameServerConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.GetGameServerConfigRequest} GetGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGameServerConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGameServerConfigRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.GetGameServerConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGameServerConfigRequest.verify = function verify(message) { + if (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 GetGameServerConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.GetGameServerConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.GetGameServerConfigRequest} GetGameServerConfigRequest + */ + GetGameServerConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.GetGameServerConfigRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.GetGameServerConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetGameServerConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.GetGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1beta.GetGameServerConfigRequest} message GetGameServerConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGameServerConfigRequest.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 GetGameServerConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.GetGameServerConfigRequest + * @instance + * @returns {Object.} JSON object + */ + GetGameServerConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGameServerConfigRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.GetGameServerConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGameServerConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.GetGameServerConfigRequest"; + }; + + return GetGameServerConfigRequest; + })(); + + v1beta.CreateGameServerConfigRequest = (function() { + + /** + * Properties of a CreateGameServerConfigRequest. + * @memberof google.cloud.gaming.v1beta + * @interface ICreateGameServerConfigRequest + * @property {string|null} [parent] CreateGameServerConfigRequest parent + * @property {string|null} [configId] CreateGameServerConfigRequest configId + * @property {google.cloud.gaming.v1beta.IGameServerConfig|null} [gameServerConfig] CreateGameServerConfigRequest gameServerConfig + */ + + /** + * Constructs a new CreateGameServerConfigRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a CreateGameServerConfigRequest. + * @implements ICreateGameServerConfigRequest + * @constructor + * @param {google.cloud.gaming.v1beta.ICreateGameServerConfigRequest=} [properties] Properties to set + */ + function CreateGameServerConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateGameServerConfigRequest parent. + * @member {string} parent + * @memberof google.cloud.gaming.v1beta.CreateGameServerConfigRequest + * @instance + */ + CreateGameServerConfigRequest.prototype.parent = ""; + + /** + * CreateGameServerConfigRequest configId. + * @member {string} configId + * @memberof google.cloud.gaming.v1beta.CreateGameServerConfigRequest + * @instance + */ + CreateGameServerConfigRequest.prototype.configId = ""; + + /** + * CreateGameServerConfigRequest gameServerConfig. + * @member {google.cloud.gaming.v1beta.IGameServerConfig|null|undefined} gameServerConfig + * @memberof google.cloud.gaming.v1beta.CreateGameServerConfigRequest + * @instance + */ + CreateGameServerConfigRequest.prototype.gameServerConfig = null; + + /** + * Creates a new CreateGameServerConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.CreateGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1beta.ICreateGameServerConfigRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.CreateGameServerConfigRequest} CreateGameServerConfigRequest instance + */ + CreateGameServerConfigRequest.create = function create(properties) { + return new CreateGameServerConfigRequest(properties); + }; + + /** + * Encodes the specified CreateGameServerConfigRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.CreateGameServerConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.CreateGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1beta.ICreateGameServerConfigRequest} message CreateGameServerConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGameServerConfigRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.configId != null && Object.hasOwnProperty.call(message, "configId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.configId); + if (message.gameServerConfig != null && Object.hasOwnProperty.call(message, "gameServerConfig")) + $root.google.cloud.gaming.v1beta.GameServerConfig.encode(message.gameServerConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateGameServerConfigRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.CreateGameServerConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.CreateGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1beta.ICreateGameServerConfigRequest} message CreateGameServerConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGameServerConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateGameServerConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.CreateGameServerConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.CreateGameServerConfigRequest} CreateGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGameServerConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.CreateGameServerConfigRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.configId = reader.string(); + break; + } + case 3: { + message.gameServerConfig = $root.google.cloud.gaming.v1beta.GameServerConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateGameServerConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.CreateGameServerConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.CreateGameServerConfigRequest} CreateGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGameServerConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateGameServerConfigRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.CreateGameServerConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateGameServerConfigRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.configId != null && message.hasOwnProperty("configId")) + if (!$util.isString(message.configId)) + return "configId: string expected"; + if (message.gameServerConfig != null && message.hasOwnProperty("gameServerConfig")) { + var error = $root.google.cloud.gaming.v1beta.GameServerConfig.verify(message.gameServerConfig); + if (error) + return "gameServerConfig." + error; + } + return null; + }; + + /** + * Creates a CreateGameServerConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.CreateGameServerConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.CreateGameServerConfigRequest} CreateGameServerConfigRequest + */ + CreateGameServerConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.CreateGameServerConfigRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.CreateGameServerConfigRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.configId != null) + message.configId = String(object.configId); + if (object.gameServerConfig != null) { + if (typeof object.gameServerConfig !== "object") + throw TypeError(".google.cloud.gaming.v1beta.CreateGameServerConfigRequest.gameServerConfig: object expected"); + message.gameServerConfig = $root.google.cloud.gaming.v1beta.GameServerConfig.fromObject(object.gameServerConfig); + } + return message; + }; + + /** + * Creates a plain object from a CreateGameServerConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.CreateGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1beta.CreateGameServerConfigRequest} message CreateGameServerConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateGameServerConfigRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.configId = ""; + object.gameServerConfig = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.configId != null && message.hasOwnProperty("configId")) + object.configId = message.configId; + if (message.gameServerConfig != null && message.hasOwnProperty("gameServerConfig")) + object.gameServerConfig = $root.google.cloud.gaming.v1beta.GameServerConfig.toObject(message.gameServerConfig, options); + return object; + }; + + /** + * Converts this CreateGameServerConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.CreateGameServerConfigRequest + * @instance + * @returns {Object.} JSON object + */ + CreateGameServerConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateGameServerConfigRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.CreateGameServerConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateGameServerConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.CreateGameServerConfigRequest"; + }; + + return CreateGameServerConfigRequest; + })(); + + v1beta.DeleteGameServerConfigRequest = (function() { + + /** + * Properties of a DeleteGameServerConfigRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IDeleteGameServerConfigRequest + * @property {string|null} [name] DeleteGameServerConfigRequest name + */ + + /** + * Constructs a new DeleteGameServerConfigRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a DeleteGameServerConfigRequest. + * @implements IDeleteGameServerConfigRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest=} [properties] Properties to set + */ + function DeleteGameServerConfigRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGameServerConfigRequest name. + * @member {string} name + * @memberof google.cloud.gaming.v1beta.DeleteGameServerConfigRequest + * @instance + */ + DeleteGameServerConfigRequest.prototype.name = ""; + + /** + * Creates a new DeleteGameServerConfigRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.DeleteGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.DeleteGameServerConfigRequest} DeleteGameServerConfigRequest instance + */ + DeleteGameServerConfigRequest.create = function create(properties) { + return new DeleteGameServerConfigRequest(properties); + }; + + /** + * Encodes the specified DeleteGameServerConfigRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.DeleteGameServerConfigRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.DeleteGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest} message DeleteGameServerConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGameServerConfigRequest.encode = function encode(message, writer) { + 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 DeleteGameServerConfigRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.DeleteGameServerConfigRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.DeleteGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest} message DeleteGameServerConfigRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGameServerConfigRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGameServerConfigRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.DeleteGameServerConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.DeleteGameServerConfigRequest} DeleteGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGameServerConfigRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest(); + 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 DeleteGameServerConfigRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.DeleteGameServerConfigRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.DeleteGameServerConfigRequest} DeleteGameServerConfigRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGameServerConfigRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGameServerConfigRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.DeleteGameServerConfigRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGameServerConfigRequest.verify = function verify(message) { + if (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 DeleteGameServerConfigRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.DeleteGameServerConfigRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.DeleteGameServerConfigRequest} DeleteGameServerConfigRequest + */ + DeleteGameServerConfigRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteGameServerConfigRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.DeleteGameServerConfigRequest + * @static + * @param {google.cloud.gaming.v1beta.DeleteGameServerConfigRequest} message DeleteGameServerConfigRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGameServerConfigRequest.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 DeleteGameServerConfigRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.DeleteGameServerConfigRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGameServerConfigRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteGameServerConfigRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.DeleteGameServerConfigRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteGameServerConfigRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.DeleteGameServerConfigRequest"; + }; + + return DeleteGameServerConfigRequest; + })(); + + v1beta.ScalingConfig = (function() { + + /** + * Properties of a ScalingConfig. + * @memberof google.cloud.gaming.v1beta + * @interface IScalingConfig + * @property {string|null} [name] ScalingConfig name + * @property {string|null} [fleetAutoscalerSpec] ScalingConfig fleetAutoscalerSpec + * @property {Array.|null} [selectors] ScalingConfig selectors + * @property {Array.|null} [schedules] ScalingConfig schedules + */ + + /** + * Constructs a new ScalingConfig. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a ScalingConfig. + * @implements IScalingConfig + * @constructor + * @param {google.cloud.gaming.v1beta.IScalingConfig=} [properties] Properties to set + */ + function ScalingConfig(properties) { + this.selectors = []; + this.schedules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ScalingConfig name. + * @member {string} name + * @memberof google.cloud.gaming.v1beta.ScalingConfig + * @instance + */ + ScalingConfig.prototype.name = ""; + + /** + * ScalingConfig fleetAutoscalerSpec. + * @member {string} fleetAutoscalerSpec + * @memberof google.cloud.gaming.v1beta.ScalingConfig + * @instance + */ + ScalingConfig.prototype.fleetAutoscalerSpec = ""; + + /** + * ScalingConfig selectors. + * @member {Array.} selectors + * @memberof google.cloud.gaming.v1beta.ScalingConfig + * @instance + */ + ScalingConfig.prototype.selectors = $util.emptyArray; + + /** + * ScalingConfig schedules. + * @member {Array.} schedules + * @memberof google.cloud.gaming.v1beta.ScalingConfig + * @instance + */ + ScalingConfig.prototype.schedules = $util.emptyArray; + + /** + * Creates a new ScalingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.ScalingConfig + * @static + * @param {google.cloud.gaming.v1beta.IScalingConfig=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.ScalingConfig} ScalingConfig instance + */ + ScalingConfig.create = function create(properties) { + return new ScalingConfig(properties); + }; + + /** + * Encodes the specified ScalingConfig message. Does not implicitly {@link google.cloud.gaming.v1beta.ScalingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.ScalingConfig + * @static + * @param {google.cloud.gaming.v1beta.IScalingConfig} message ScalingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScalingConfig.encode = function encode(message, writer) { + 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.fleetAutoscalerSpec != null && Object.hasOwnProperty.call(message, "fleetAutoscalerSpec")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fleetAutoscalerSpec); + if (message.selectors != null && message.selectors.length) + for (var i = 0; i < message.selectors.length; ++i) + $root.google.cloud.gaming.v1beta.LabelSelector.encode(message.selectors[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.schedules != null && message.schedules.length) + for (var i = 0; i < message.schedules.length; ++i) + $root.google.cloud.gaming.v1beta.Schedule.encode(message.schedules[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ScalingConfig message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.ScalingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.ScalingConfig + * @static + * @param {google.cloud.gaming.v1beta.IScalingConfig} message ScalingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ScalingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ScalingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.ScalingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.ScalingConfig} ScalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScalingConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.ScalingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.fleetAutoscalerSpec = reader.string(); + break; + } + case 4: { + if (!(message.selectors && message.selectors.length)) + message.selectors = []; + message.selectors.push($root.google.cloud.gaming.v1beta.LabelSelector.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.schedules && message.schedules.length)) + message.schedules = []; + message.schedules.push($root.google.cloud.gaming.v1beta.Schedule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ScalingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.ScalingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.ScalingConfig} ScalingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ScalingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ScalingConfig message. + * @function verify + * @memberof google.cloud.gaming.v1beta.ScalingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ScalingConfig.verify = function verify(message) { + if (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.fleetAutoscalerSpec != null && message.hasOwnProperty("fleetAutoscalerSpec")) + if (!$util.isString(message.fleetAutoscalerSpec)) + return "fleetAutoscalerSpec: string expected"; + if (message.selectors != null && message.hasOwnProperty("selectors")) { + if (!Array.isArray(message.selectors)) + return "selectors: array expected"; + for (var i = 0; i < message.selectors.length; ++i) { + var error = $root.google.cloud.gaming.v1beta.LabelSelector.verify(message.selectors[i]); + if (error) + return "selectors." + error; + } + } + if (message.schedules != null && message.hasOwnProperty("schedules")) { + if (!Array.isArray(message.schedules)) + return "schedules: array expected"; + for (var i = 0; i < message.schedules.length; ++i) { + var error = $root.google.cloud.gaming.v1beta.Schedule.verify(message.schedules[i]); + if (error) + return "schedules." + error; + } + } + return null; + }; + + /** + * Creates a ScalingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.ScalingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.ScalingConfig} ScalingConfig + */ + ScalingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.ScalingConfig) + return object; + var message = new $root.google.cloud.gaming.v1beta.ScalingConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.fleetAutoscalerSpec != null) + message.fleetAutoscalerSpec = String(object.fleetAutoscalerSpec); + if (object.selectors) { + if (!Array.isArray(object.selectors)) + throw TypeError(".google.cloud.gaming.v1beta.ScalingConfig.selectors: array expected"); + message.selectors = []; + for (var i = 0; i < object.selectors.length; ++i) { + if (typeof object.selectors[i] !== "object") + throw TypeError(".google.cloud.gaming.v1beta.ScalingConfig.selectors: object expected"); + message.selectors[i] = $root.google.cloud.gaming.v1beta.LabelSelector.fromObject(object.selectors[i]); + } + } + if (object.schedules) { + if (!Array.isArray(object.schedules)) + throw TypeError(".google.cloud.gaming.v1beta.ScalingConfig.schedules: array expected"); + message.schedules = []; + for (var i = 0; i < object.schedules.length; ++i) { + if (typeof object.schedules[i] !== "object") + throw TypeError(".google.cloud.gaming.v1beta.ScalingConfig.schedules: object expected"); + message.schedules[i] = $root.google.cloud.gaming.v1beta.Schedule.fromObject(object.schedules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ScalingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.ScalingConfig + * @static + * @param {google.cloud.gaming.v1beta.ScalingConfig} message ScalingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ScalingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.selectors = []; + object.schedules = []; + } + if (options.defaults) { + object.name = ""; + object.fleetAutoscalerSpec = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.fleetAutoscalerSpec != null && message.hasOwnProperty("fleetAutoscalerSpec")) + object.fleetAutoscalerSpec = message.fleetAutoscalerSpec; + if (message.selectors && message.selectors.length) { + object.selectors = []; + for (var j = 0; j < message.selectors.length; ++j) + object.selectors[j] = $root.google.cloud.gaming.v1beta.LabelSelector.toObject(message.selectors[j], options); + } + if (message.schedules && message.schedules.length) { + object.schedules = []; + for (var j = 0; j < message.schedules.length; ++j) + object.schedules[j] = $root.google.cloud.gaming.v1beta.Schedule.toObject(message.schedules[j], options); + } + return object; + }; + + /** + * Converts this ScalingConfig to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.ScalingConfig + * @instance + * @returns {Object.} JSON object + */ + ScalingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ScalingConfig + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.ScalingConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ScalingConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.ScalingConfig"; + }; + + return ScalingConfig; + })(); + + v1beta.FleetConfig = (function() { + + /** + * Properties of a FleetConfig. + * @memberof google.cloud.gaming.v1beta + * @interface IFleetConfig + * @property {string|null} [fleetSpec] FleetConfig fleetSpec + * @property {string|null} [name] FleetConfig name + */ + + /** + * Constructs a new FleetConfig. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a FleetConfig. + * @implements IFleetConfig + * @constructor + * @param {google.cloud.gaming.v1beta.IFleetConfig=} [properties] Properties to set + */ + function FleetConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FleetConfig fleetSpec. + * @member {string} fleetSpec + * @memberof google.cloud.gaming.v1beta.FleetConfig + * @instance + */ + FleetConfig.prototype.fleetSpec = ""; + + /** + * FleetConfig name. + * @member {string} name + * @memberof google.cloud.gaming.v1beta.FleetConfig + * @instance + */ + FleetConfig.prototype.name = ""; + + /** + * Creates a new FleetConfig instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.FleetConfig + * @static + * @param {google.cloud.gaming.v1beta.IFleetConfig=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.FleetConfig} FleetConfig instance + */ + FleetConfig.create = function create(properties) { + return new FleetConfig(properties); + }; + + /** + * Encodes the specified FleetConfig message. Does not implicitly {@link google.cloud.gaming.v1beta.FleetConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.FleetConfig + * @static + * @param {google.cloud.gaming.v1beta.IFleetConfig} message FleetConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FleetConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fleetSpec != null && Object.hasOwnProperty.call(message, "fleetSpec")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fleetSpec); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + return writer; + }; + + /** + * Encodes the specified FleetConfig message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.FleetConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.FleetConfig + * @static + * @param {google.cloud.gaming.v1beta.IFleetConfig} message FleetConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FleetConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FleetConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.FleetConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.FleetConfig} FleetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FleetConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.FleetConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.fleetSpec = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FleetConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.FleetConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.FleetConfig} FleetConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FleetConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FleetConfig message. + * @function verify + * @memberof google.cloud.gaming.v1beta.FleetConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FleetConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fleetSpec != null && message.hasOwnProperty("fleetSpec")) + if (!$util.isString(message.fleetSpec)) + return "fleetSpec: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a FleetConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.FleetConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.FleetConfig} FleetConfig + */ + FleetConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.FleetConfig) + return object; + var message = new $root.google.cloud.gaming.v1beta.FleetConfig(); + if (object.fleetSpec != null) + message.fleetSpec = String(object.fleetSpec); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a FleetConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.FleetConfig + * @static + * @param {google.cloud.gaming.v1beta.FleetConfig} message FleetConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FleetConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fleetSpec = ""; + object.name = ""; + } + if (message.fleetSpec != null && message.hasOwnProperty("fleetSpec")) + object.fleetSpec = message.fleetSpec; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this FleetConfig to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.FleetConfig + * @instance + * @returns {Object.} JSON object + */ + FleetConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FleetConfig + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.FleetConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FleetConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.FleetConfig"; + }; + + return FleetConfig; + })(); + + v1beta.GameServerConfig = (function() { + + /** + * Properties of a GameServerConfig. + * @memberof google.cloud.gaming.v1beta + * @interface IGameServerConfig + * @property {string|null} [name] GameServerConfig name + * @property {google.protobuf.ITimestamp|null} [createTime] GameServerConfig createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] GameServerConfig updateTime + * @property {Object.|null} [labels] GameServerConfig labels + * @property {Array.|null} [fleetConfigs] GameServerConfig fleetConfigs + * @property {Array.|null} [scalingConfigs] GameServerConfig scalingConfigs + * @property {string|null} [description] GameServerConfig description + */ + + /** + * Constructs a new GameServerConfig. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a GameServerConfig. + * @implements IGameServerConfig + * @constructor + * @param {google.cloud.gaming.v1beta.IGameServerConfig=} [properties] Properties to set + */ + function GameServerConfig(properties) { + this.labels = {}; + this.fleetConfigs = []; + this.scalingConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GameServerConfig name. + * @member {string} name + * @memberof google.cloud.gaming.v1beta.GameServerConfig + * @instance + */ + GameServerConfig.prototype.name = ""; + + /** + * GameServerConfig createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.gaming.v1beta.GameServerConfig + * @instance + */ + GameServerConfig.prototype.createTime = null; + + /** + * GameServerConfig updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.gaming.v1beta.GameServerConfig + * @instance + */ + GameServerConfig.prototype.updateTime = null; + + /** + * GameServerConfig labels. + * @member {Object.} labels + * @memberof google.cloud.gaming.v1beta.GameServerConfig + * @instance + */ + GameServerConfig.prototype.labels = $util.emptyObject; + + /** + * GameServerConfig fleetConfigs. + * @member {Array.} fleetConfigs + * @memberof google.cloud.gaming.v1beta.GameServerConfig + * @instance + */ + GameServerConfig.prototype.fleetConfigs = $util.emptyArray; + + /** + * GameServerConfig scalingConfigs. + * @member {Array.} scalingConfigs + * @memberof google.cloud.gaming.v1beta.GameServerConfig + * @instance + */ + GameServerConfig.prototype.scalingConfigs = $util.emptyArray; + + /** + * GameServerConfig description. + * @member {string} description + * @memberof google.cloud.gaming.v1beta.GameServerConfig + * @instance + */ + GameServerConfig.prototype.description = ""; + + /** + * Creates a new GameServerConfig instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.GameServerConfig + * @static + * @param {google.cloud.gaming.v1beta.IGameServerConfig=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.GameServerConfig} GameServerConfig instance + */ + GameServerConfig.create = function create(properties) { + return new GameServerConfig(properties); + }; + + /** + * Encodes the specified GameServerConfig message. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.GameServerConfig + * @static + * @param {google.cloud.gaming.v1beta.IGameServerConfig} message GameServerConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.fleetConfigs != null && message.fleetConfigs.length) + for (var i = 0; i < message.fleetConfigs.length; ++i) + $root.google.cloud.gaming.v1beta.FleetConfig.encode(message.fleetConfigs[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.scalingConfigs != null && message.scalingConfigs.length) + for (var i = 0; i < message.scalingConfigs.length; ++i) + $root.google.cloud.gaming.v1beta.ScalingConfig.encode(message.scalingConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); + return writer; + }; + + /** + * Encodes the specified GameServerConfig message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.GameServerConfig + * @static + * @param {google.cloud.gaming.v1beta.IGameServerConfig} message GameServerConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GameServerConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.GameServerConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.GameServerConfig} GameServerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.GameServerConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + if (!(message.fleetConfigs && message.fleetConfigs.length)) + message.fleetConfigs = []; + message.fleetConfigs.push($root.google.cloud.gaming.v1beta.FleetConfig.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.scalingConfigs && message.scalingConfigs.length)) + message.scalingConfigs = []; + message.scalingConfigs.push($root.google.cloud.gaming.v1beta.ScalingConfig.decode(reader, reader.uint32())); + break; + } + case 7: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GameServerConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.GameServerConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.GameServerConfig} GameServerConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GameServerConfig message. + * @function verify + * @memberof google.cloud.gaming.v1beta.GameServerConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GameServerConfig.verify = function verify(message) { + if (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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.fleetConfigs != null && message.hasOwnProperty("fleetConfigs")) { + if (!Array.isArray(message.fleetConfigs)) + return "fleetConfigs: array expected"; + for (var i = 0; i < message.fleetConfigs.length; ++i) { + var error = $root.google.cloud.gaming.v1beta.FleetConfig.verify(message.fleetConfigs[i]); + if (error) + return "fleetConfigs." + error; + } + } + if (message.scalingConfigs != null && message.hasOwnProperty("scalingConfigs")) { + if (!Array.isArray(message.scalingConfigs)) + return "scalingConfigs: array expected"; + for (var i = 0; i < message.scalingConfigs.length; ++i) { + var error = $root.google.cloud.gaming.v1beta.ScalingConfig.verify(message.scalingConfigs[i]); + if (error) + return "scalingConfigs." + error; + } + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a GameServerConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.GameServerConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.GameServerConfig} GameServerConfig + */ + GameServerConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.GameServerConfig) + return object; + var message = new $root.google.cloud.gaming.v1beta.GameServerConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.gaming.v1beta.GameServerConfig.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.gaming.v1beta.GameServerConfig.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.gaming.v1beta.GameServerConfig.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.fleetConfigs) { + if (!Array.isArray(object.fleetConfigs)) + throw TypeError(".google.cloud.gaming.v1beta.GameServerConfig.fleetConfigs: array expected"); + message.fleetConfigs = []; + for (var i = 0; i < object.fleetConfigs.length; ++i) { + if (typeof object.fleetConfigs[i] !== "object") + throw TypeError(".google.cloud.gaming.v1beta.GameServerConfig.fleetConfigs: object expected"); + message.fleetConfigs[i] = $root.google.cloud.gaming.v1beta.FleetConfig.fromObject(object.fleetConfigs[i]); + } + } + if (object.scalingConfigs) { + if (!Array.isArray(object.scalingConfigs)) + throw TypeError(".google.cloud.gaming.v1beta.GameServerConfig.scalingConfigs: array expected"); + message.scalingConfigs = []; + for (var i = 0; i < object.scalingConfigs.length; ++i) { + if (typeof object.scalingConfigs[i] !== "object") + throw TypeError(".google.cloud.gaming.v1beta.GameServerConfig.scalingConfigs: object expected"); + message.scalingConfigs[i] = $root.google.cloud.gaming.v1beta.ScalingConfig.fromObject(object.scalingConfigs[i]); + } + } + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a GameServerConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.GameServerConfig + * @static + * @param {google.cloud.gaming.v1beta.GameServerConfig} message GameServerConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GameServerConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.fleetConfigs = []; + object.scalingConfigs = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.fleetConfigs && message.fleetConfigs.length) { + object.fleetConfigs = []; + for (var j = 0; j < message.fleetConfigs.length; ++j) + object.fleetConfigs[j] = $root.google.cloud.gaming.v1beta.FleetConfig.toObject(message.fleetConfigs[j], options); + } + if (message.scalingConfigs && message.scalingConfigs.length) { + object.scalingConfigs = []; + for (var j = 0; j < message.scalingConfigs.length; ++j) + object.scalingConfigs[j] = $root.google.cloud.gaming.v1beta.ScalingConfig.toObject(message.scalingConfigs[j], options); + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this GameServerConfig to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.GameServerConfig + * @instance + * @returns {Object.} JSON object + */ + GameServerConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GameServerConfig + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.GameServerConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GameServerConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.GameServerConfig"; + }; + + return GameServerConfig; + })(); + + v1beta.GameServerConfigsService = (function() { + + /** + * Constructs a new GameServerConfigsService service. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a GameServerConfigsService + * @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 GameServerConfigsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (GameServerConfigsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GameServerConfigsService; + + /** + * Creates new GameServerConfigsService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.gaming.v1beta.GameServerConfigsService + * @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 {GameServerConfigsService} RPC service. Useful where requests and/or responses are streamed. + */ + GameServerConfigsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerConfigsService|listGameServerConfigs}. + * @memberof google.cloud.gaming.v1beta.GameServerConfigsService + * @typedef ListGameServerConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1beta.ListGameServerConfigsResponse} [response] ListGameServerConfigsResponse + */ + + /** + * Calls ListGameServerConfigs. + * @function listGameServerConfigs + * @memberof google.cloud.gaming.v1beta.GameServerConfigsService + * @instance + * @param {google.cloud.gaming.v1beta.IListGameServerConfigsRequest} request ListGameServerConfigsRequest message or plain object + * @param {google.cloud.gaming.v1beta.GameServerConfigsService.ListGameServerConfigsCallback} callback Node-style callback called with the error, if any, and ListGameServerConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerConfigsService.prototype.listGameServerConfigs = function listGameServerConfigs(request, callback) { + return this.rpcCall(listGameServerConfigs, $root.google.cloud.gaming.v1beta.ListGameServerConfigsRequest, $root.google.cloud.gaming.v1beta.ListGameServerConfigsResponse, request, callback); + }, "name", { value: "ListGameServerConfigs" }); + + /** + * Calls ListGameServerConfigs. + * @function listGameServerConfigs + * @memberof google.cloud.gaming.v1beta.GameServerConfigsService + * @instance + * @param {google.cloud.gaming.v1beta.IListGameServerConfigsRequest} request ListGameServerConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerConfigsService|getGameServerConfig}. + * @memberof google.cloud.gaming.v1beta.GameServerConfigsService + * @typedef GetGameServerConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1beta.GameServerConfig} [response] GameServerConfig + */ + + /** + * Calls GetGameServerConfig. + * @function getGameServerConfig + * @memberof google.cloud.gaming.v1beta.GameServerConfigsService + * @instance + * @param {google.cloud.gaming.v1beta.IGetGameServerConfigRequest} request GetGameServerConfigRequest message or plain object + * @param {google.cloud.gaming.v1beta.GameServerConfigsService.GetGameServerConfigCallback} callback Node-style callback called with the error, if any, and GameServerConfig + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerConfigsService.prototype.getGameServerConfig = function getGameServerConfig(request, callback) { + return this.rpcCall(getGameServerConfig, $root.google.cloud.gaming.v1beta.GetGameServerConfigRequest, $root.google.cloud.gaming.v1beta.GameServerConfig, request, callback); + }, "name", { value: "GetGameServerConfig" }); + + /** + * Calls GetGameServerConfig. + * @function getGameServerConfig + * @memberof google.cloud.gaming.v1beta.GameServerConfigsService + * @instance + * @param {google.cloud.gaming.v1beta.IGetGameServerConfigRequest} request GetGameServerConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerConfigsService|createGameServerConfig}. + * @memberof google.cloud.gaming.v1beta.GameServerConfigsService + * @typedef CreateGameServerConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateGameServerConfig. + * @function createGameServerConfig + * @memberof google.cloud.gaming.v1beta.GameServerConfigsService + * @instance + * @param {google.cloud.gaming.v1beta.ICreateGameServerConfigRequest} request CreateGameServerConfigRequest message or plain object + * @param {google.cloud.gaming.v1beta.GameServerConfigsService.CreateGameServerConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerConfigsService.prototype.createGameServerConfig = function createGameServerConfig(request, callback) { + return this.rpcCall(createGameServerConfig, $root.google.cloud.gaming.v1beta.CreateGameServerConfigRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateGameServerConfig" }); + + /** + * Calls CreateGameServerConfig. + * @function createGameServerConfig + * @memberof google.cloud.gaming.v1beta.GameServerConfigsService + * @instance + * @param {google.cloud.gaming.v1beta.ICreateGameServerConfigRequest} request CreateGameServerConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerConfigsService|deleteGameServerConfig}. + * @memberof google.cloud.gaming.v1beta.GameServerConfigsService + * @typedef DeleteGameServerConfigCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteGameServerConfig. + * @function deleteGameServerConfig + * @memberof google.cloud.gaming.v1beta.GameServerConfigsService + * @instance + * @param {google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest} request DeleteGameServerConfigRequest message or plain object + * @param {google.cloud.gaming.v1beta.GameServerConfigsService.DeleteGameServerConfigCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerConfigsService.prototype.deleteGameServerConfig = function deleteGameServerConfig(request, callback) { + return this.rpcCall(deleteGameServerConfig, $root.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteGameServerConfig" }); + + /** + * Calls DeleteGameServerConfig. + * @function deleteGameServerConfig + * @memberof google.cloud.gaming.v1beta.GameServerConfigsService + * @instance + * @param {google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest} request DeleteGameServerConfigRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return GameServerConfigsService; + })(); + + v1beta.ListGameServerDeploymentsRequest = (function() { + + /** + * Properties of a ListGameServerDeploymentsRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IListGameServerDeploymentsRequest + * @property {string|null} [parent] ListGameServerDeploymentsRequest parent + * @property {number|null} [pageSize] ListGameServerDeploymentsRequest pageSize + * @property {string|null} [pageToken] ListGameServerDeploymentsRequest pageToken + * @property {string|null} [filter] ListGameServerDeploymentsRequest filter + * @property {string|null} [orderBy] ListGameServerDeploymentsRequest orderBy + */ + + /** + * Constructs a new ListGameServerDeploymentsRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a ListGameServerDeploymentsRequest. + * @implements IListGameServerDeploymentsRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest=} [properties] Properties to set + */ + function ListGameServerDeploymentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGameServerDeploymentsRequest parent. + * @member {string} parent + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest + * @instance + */ + ListGameServerDeploymentsRequest.prototype.parent = ""; + + /** + * ListGameServerDeploymentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest + * @instance + */ + ListGameServerDeploymentsRequest.prototype.pageSize = 0; + + /** + * ListGameServerDeploymentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest + * @instance + */ + ListGameServerDeploymentsRequest.prototype.pageToken = ""; + + /** + * ListGameServerDeploymentsRequest filter. + * @member {string} filter + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest + * @instance + */ + ListGameServerDeploymentsRequest.prototype.filter = ""; + + /** + * ListGameServerDeploymentsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest + * @instance + */ + ListGameServerDeploymentsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListGameServerDeploymentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest + * @static + * @param {google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest} ListGameServerDeploymentsRequest instance + */ + ListGameServerDeploymentsRequest.create = function create(properties) { + return new ListGameServerDeploymentsRequest(properties); + }; + + /** + * Encodes the specified ListGameServerDeploymentsRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest + * @static + * @param {google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest} message ListGameServerDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerDeploymentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListGameServerDeploymentsRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest + * @static + * @param {google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest} message ListGameServerDeploymentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerDeploymentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGameServerDeploymentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest} ListGameServerDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerDeploymentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGameServerDeploymentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest} ListGameServerDeploymentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerDeploymentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGameServerDeploymentsRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGameServerDeploymentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListGameServerDeploymentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest} ListGameServerDeploymentsRequest + */ + ListGameServerDeploymentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListGameServerDeploymentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest + * @static + * @param {google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest} message ListGameServerDeploymentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGameServerDeploymentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListGameServerDeploymentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListGameServerDeploymentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGameServerDeploymentsRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGameServerDeploymentsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest"; + }; + + return ListGameServerDeploymentsRequest; + })(); + + v1beta.ListGameServerDeploymentsResponse = (function() { + + /** + * Properties of a ListGameServerDeploymentsResponse. + * @memberof google.cloud.gaming.v1beta + * @interface IListGameServerDeploymentsResponse + * @property {Array.|null} [gameServerDeployments] ListGameServerDeploymentsResponse gameServerDeployments + * @property {string|null} [nextPageToken] ListGameServerDeploymentsResponse nextPageToken + * @property {Array.|null} [unreachable] ListGameServerDeploymentsResponse unreachable + */ + + /** + * Constructs a new ListGameServerDeploymentsResponse. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a ListGameServerDeploymentsResponse. + * @implements IListGameServerDeploymentsResponse + * @constructor + * @param {google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse=} [properties] Properties to set + */ + function ListGameServerDeploymentsResponse(properties) { + this.gameServerDeployments = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListGameServerDeploymentsResponse gameServerDeployments. + * @member {Array.} gameServerDeployments + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse + * @instance + */ + ListGameServerDeploymentsResponse.prototype.gameServerDeployments = $util.emptyArray; + + /** + * ListGameServerDeploymentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse + * @instance + */ + ListGameServerDeploymentsResponse.prototype.nextPageToken = ""; + + /** + * ListGameServerDeploymentsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse + * @instance + */ + ListGameServerDeploymentsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListGameServerDeploymentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse + * @static + * @param {google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse} ListGameServerDeploymentsResponse instance + */ + ListGameServerDeploymentsResponse.create = function create(properties) { + return new ListGameServerDeploymentsResponse(properties); + }; + + /** + * Encodes the specified ListGameServerDeploymentsResponse message. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse + * @static + * @param {google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse} message ListGameServerDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerDeploymentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gameServerDeployments != null && message.gameServerDeployments.length) + for (var i = 0; i < message.gameServerDeployments.length; ++i) + $root.google.cloud.gaming.v1beta.GameServerDeployment.encode(message.gameServerDeployments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListGameServerDeploymentsResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse + * @static + * @param {google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse} message ListGameServerDeploymentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGameServerDeploymentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGameServerDeploymentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse} ListGameServerDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerDeploymentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.gameServerDeployments && message.gameServerDeployments.length)) + message.gameServerDeployments = []; + message.gameServerDeployments.push($root.google.cloud.gaming.v1beta.GameServerDeployment.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 4: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGameServerDeploymentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse} ListGameServerDeploymentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGameServerDeploymentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGameServerDeploymentsResponse message. + * @function verify + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGameServerDeploymentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gameServerDeployments != null && message.hasOwnProperty("gameServerDeployments")) { + if (!Array.isArray(message.gameServerDeployments)) + return "gameServerDeployments: array expected"; + for (var i = 0; i < message.gameServerDeployments.length; ++i) { + var error = $root.google.cloud.gaming.v1beta.GameServerDeployment.verify(message.gameServerDeployments[i]); + if (error) + return "gameServerDeployments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListGameServerDeploymentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse} ListGameServerDeploymentsResponse + */ + ListGameServerDeploymentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse) + return object; + var message = new $root.google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse(); + if (object.gameServerDeployments) { + if (!Array.isArray(object.gameServerDeployments)) + throw TypeError(".google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse.gameServerDeployments: array expected"); + message.gameServerDeployments = []; + for (var i = 0; i < object.gameServerDeployments.length; ++i) { + if (typeof object.gameServerDeployments[i] !== "object") + throw TypeError(".google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse.gameServerDeployments: object expected"); + message.gameServerDeployments[i] = $root.google.cloud.gaming.v1beta.GameServerDeployment.fromObject(object.gameServerDeployments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListGameServerDeploymentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse + * @static + * @param {google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse} message ListGameServerDeploymentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGameServerDeploymentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.gameServerDeployments = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.gameServerDeployments && message.gameServerDeployments.length) { + object.gameServerDeployments = []; + for (var j = 0; j < message.gameServerDeployments.length; ++j) + object.gameServerDeployments[j] = $root.google.cloud.gaming.v1beta.GameServerDeployment.toObject(message.gameServerDeployments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListGameServerDeploymentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListGameServerDeploymentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGameServerDeploymentsResponse + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGameServerDeploymentsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse"; + }; + + return ListGameServerDeploymentsResponse; + })(); + + v1beta.GetGameServerDeploymentRequest = (function() { + + /** + * Properties of a GetGameServerDeploymentRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IGetGameServerDeploymentRequest + * @property {string|null} [name] GetGameServerDeploymentRequest name + */ + + /** + * Constructs a new GetGameServerDeploymentRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a GetGameServerDeploymentRequest. + * @implements IGetGameServerDeploymentRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest=} [properties] Properties to set + */ + function GetGameServerDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGameServerDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.gaming.v1beta.GetGameServerDeploymentRequest + * @instance + */ + GetGameServerDeploymentRequest.prototype.name = ""; + + /** + * Creates a new GetGameServerDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.GetGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.GetGameServerDeploymentRequest} GetGameServerDeploymentRequest instance + */ + GetGameServerDeploymentRequest.create = function create(properties) { + return new GetGameServerDeploymentRequest(properties); + }; + + /** + * Encodes the specified GetGameServerDeploymentRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.GetGameServerDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.GetGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest} message GetGameServerDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGameServerDeploymentRequest.encode = function encode(message, writer) { + 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 GetGameServerDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GetGameServerDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.GetGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest} message GetGameServerDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGameServerDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGameServerDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.GetGameServerDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.GetGameServerDeploymentRequest} GetGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGameServerDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest(); + 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 GetGameServerDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.GetGameServerDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.GetGameServerDeploymentRequest} GetGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGameServerDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGameServerDeploymentRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.GetGameServerDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGameServerDeploymentRequest.verify = function verify(message) { + if (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 GetGameServerDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.GetGameServerDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.GetGameServerDeploymentRequest} GetGameServerDeploymentRequest + */ + GetGameServerDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetGameServerDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.GetGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1beta.GetGameServerDeploymentRequest} message GetGameServerDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGameServerDeploymentRequest.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 GetGameServerDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.GetGameServerDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + GetGameServerDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGameServerDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.GetGameServerDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGameServerDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.GetGameServerDeploymentRequest"; + }; + + return GetGameServerDeploymentRequest; + })(); + + v1beta.GetGameServerDeploymentRolloutRequest = (function() { + + /** + * Properties of a GetGameServerDeploymentRolloutRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IGetGameServerDeploymentRolloutRequest + * @property {string|null} [name] GetGameServerDeploymentRolloutRequest name + */ + + /** + * Constructs a new GetGameServerDeploymentRolloutRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a GetGameServerDeploymentRolloutRequest. + * @implements IGetGameServerDeploymentRolloutRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest=} [properties] Properties to set + */ + function GetGameServerDeploymentRolloutRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetGameServerDeploymentRolloutRequest name. + * @member {string} name + * @memberof google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest + * @instance + */ + GetGameServerDeploymentRolloutRequest.prototype.name = ""; + + /** + * Creates a new GetGameServerDeploymentRolloutRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest} GetGameServerDeploymentRolloutRequest instance + */ + GetGameServerDeploymentRolloutRequest.create = function create(properties) { + return new GetGameServerDeploymentRolloutRequest(properties); + }; + + /** + * Encodes the specified GetGameServerDeploymentRolloutRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest} message GetGameServerDeploymentRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGameServerDeploymentRolloutRequest.encode = function encode(message, writer) { + 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 GetGameServerDeploymentRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest} message GetGameServerDeploymentRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetGameServerDeploymentRolloutRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetGameServerDeploymentRolloutRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest} GetGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGameServerDeploymentRolloutRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest(); + 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 GetGameServerDeploymentRolloutRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest} GetGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetGameServerDeploymentRolloutRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetGameServerDeploymentRolloutRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetGameServerDeploymentRolloutRequest.verify = function verify(message) { + if (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 GetGameServerDeploymentRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest} GetGameServerDeploymentRolloutRequest + */ + GetGameServerDeploymentRolloutRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetGameServerDeploymentRolloutRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest} message GetGameServerDeploymentRolloutRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetGameServerDeploymentRolloutRequest.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 GetGameServerDeploymentRolloutRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest + * @instance + * @returns {Object.} JSON object + */ + GetGameServerDeploymentRolloutRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetGameServerDeploymentRolloutRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetGameServerDeploymentRolloutRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest"; + }; + + return GetGameServerDeploymentRolloutRequest; + })(); + + v1beta.CreateGameServerDeploymentRequest = (function() { + + /** + * Properties of a CreateGameServerDeploymentRequest. + * @memberof google.cloud.gaming.v1beta + * @interface ICreateGameServerDeploymentRequest + * @property {string|null} [parent] CreateGameServerDeploymentRequest parent + * @property {string|null} [deploymentId] CreateGameServerDeploymentRequest deploymentId + * @property {google.cloud.gaming.v1beta.IGameServerDeployment|null} [gameServerDeployment] CreateGameServerDeploymentRequest gameServerDeployment + */ + + /** + * Constructs a new CreateGameServerDeploymentRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a CreateGameServerDeploymentRequest. + * @implements ICreateGameServerDeploymentRequest + * @constructor + * @param {google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest=} [properties] Properties to set + */ + function CreateGameServerDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateGameServerDeploymentRequest parent. + * @member {string} parent + * @memberof google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest + * @instance + */ + CreateGameServerDeploymentRequest.prototype.parent = ""; + + /** + * CreateGameServerDeploymentRequest deploymentId. + * @member {string} deploymentId + * @memberof google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest + * @instance + */ + CreateGameServerDeploymentRequest.prototype.deploymentId = ""; + + /** + * CreateGameServerDeploymentRequest gameServerDeployment. + * @member {google.cloud.gaming.v1beta.IGameServerDeployment|null|undefined} gameServerDeployment + * @memberof google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest + * @instance + */ + CreateGameServerDeploymentRequest.prototype.gameServerDeployment = null; + + /** + * Creates a new CreateGameServerDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest} CreateGameServerDeploymentRequest instance + */ + CreateGameServerDeploymentRequest.create = function create(properties) { + return new CreateGameServerDeploymentRequest(properties); + }; + + /** + * Encodes the specified CreateGameServerDeploymentRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest} message CreateGameServerDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGameServerDeploymentRequest.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.deploymentId != null && Object.hasOwnProperty.call(message, "deploymentId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deploymentId); + if (message.gameServerDeployment != null && Object.hasOwnProperty.call(message, "gameServerDeployment")) + $root.google.cloud.gaming.v1beta.GameServerDeployment.encode(message.gameServerDeployment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateGameServerDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest} message CreateGameServerDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateGameServerDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateGameServerDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest} CreateGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGameServerDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.deploymentId = reader.string(); + break; + } + case 3: { + message.gameServerDeployment = $root.google.cloud.gaming.v1beta.GameServerDeployment.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateGameServerDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest} CreateGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateGameServerDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateGameServerDeploymentRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateGameServerDeploymentRequest.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.deploymentId != null && message.hasOwnProperty("deploymentId")) + if (!$util.isString(message.deploymentId)) + return "deploymentId: string expected"; + if (message.gameServerDeployment != null && message.hasOwnProperty("gameServerDeployment")) { + var error = $root.google.cloud.gaming.v1beta.GameServerDeployment.verify(message.gameServerDeployment); + if (error) + return "gameServerDeployment." + error; + } + return null; + }; + + /** + * Creates a CreateGameServerDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest} CreateGameServerDeploymentRequest + */ + CreateGameServerDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.deploymentId != null) + message.deploymentId = String(object.deploymentId); + if (object.gameServerDeployment != null) { + if (typeof object.gameServerDeployment !== "object") + throw TypeError(".google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest.gameServerDeployment: object expected"); + message.gameServerDeployment = $root.google.cloud.gaming.v1beta.GameServerDeployment.fromObject(object.gameServerDeployment); + } + return message; + }; + + /** + * Creates a plain object from a CreateGameServerDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest} message CreateGameServerDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateGameServerDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.deploymentId = ""; + object.gameServerDeployment = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.deploymentId != null && message.hasOwnProperty("deploymentId")) + object.deploymentId = message.deploymentId; + if (message.gameServerDeployment != null && message.hasOwnProperty("gameServerDeployment")) + object.gameServerDeployment = $root.google.cloud.gaming.v1beta.GameServerDeployment.toObject(message.gameServerDeployment, options); + return object; + }; + + /** + * Converts this CreateGameServerDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateGameServerDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateGameServerDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateGameServerDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest"; + }; + + return CreateGameServerDeploymentRequest; + })(); + + v1beta.DeleteGameServerDeploymentRequest = (function() { + + /** + * Properties of a DeleteGameServerDeploymentRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IDeleteGameServerDeploymentRequest + * @property {string|null} [name] DeleteGameServerDeploymentRequest name + */ + + /** + * Constructs a new DeleteGameServerDeploymentRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a DeleteGameServerDeploymentRequest. + * @implements IDeleteGameServerDeploymentRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest=} [properties] Properties to set + */ + function DeleteGameServerDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteGameServerDeploymentRequest name. + * @member {string} name + * @memberof google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest + * @instance + */ + DeleteGameServerDeploymentRequest.prototype.name = ""; + + /** + * Creates a new DeleteGameServerDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest} DeleteGameServerDeploymentRequest instance + */ + DeleteGameServerDeploymentRequest.create = function create(properties) { + return new DeleteGameServerDeploymentRequest(properties); + }; + + /** + * Encodes the specified DeleteGameServerDeploymentRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest} message DeleteGameServerDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGameServerDeploymentRequest.encode = function encode(message, writer) { + 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 DeleteGameServerDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest} message DeleteGameServerDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteGameServerDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteGameServerDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest} DeleteGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGameServerDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest(); + 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 DeleteGameServerDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest} DeleteGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteGameServerDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteGameServerDeploymentRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteGameServerDeploymentRequest.verify = function verify(message) { + if (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 DeleteGameServerDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest} DeleteGameServerDeploymentRequest + */ + DeleteGameServerDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteGameServerDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest} message DeleteGameServerDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteGameServerDeploymentRequest.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 DeleteGameServerDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteGameServerDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteGameServerDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteGameServerDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest"; + }; + + return DeleteGameServerDeploymentRequest; + })(); + + v1beta.UpdateGameServerDeploymentRequest = (function() { + + /** + * Properties of an UpdateGameServerDeploymentRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IUpdateGameServerDeploymentRequest + * @property {google.cloud.gaming.v1beta.IGameServerDeployment|null} [gameServerDeployment] UpdateGameServerDeploymentRequest gameServerDeployment + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateGameServerDeploymentRequest updateMask + */ + + /** + * Constructs a new UpdateGameServerDeploymentRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents an UpdateGameServerDeploymentRequest. + * @implements IUpdateGameServerDeploymentRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest=} [properties] Properties to set + */ + function UpdateGameServerDeploymentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateGameServerDeploymentRequest gameServerDeployment. + * @member {google.cloud.gaming.v1beta.IGameServerDeployment|null|undefined} gameServerDeployment + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest + * @instance + */ + UpdateGameServerDeploymentRequest.prototype.gameServerDeployment = null; + + /** + * UpdateGameServerDeploymentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest + * @instance + */ + UpdateGameServerDeploymentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateGameServerDeploymentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest} UpdateGameServerDeploymentRequest instance + */ + UpdateGameServerDeploymentRequest.create = function create(properties) { + return new UpdateGameServerDeploymentRequest(properties); + }; + + /** + * Encodes the specified UpdateGameServerDeploymentRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest} message UpdateGameServerDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGameServerDeploymentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gameServerDeployment != null && Object.hasOwnProperty.call(message, "gameServerDeployment")) + $root.google.cloud.gaming.v1beta.GameServerDeployment.encode(message.gameServerDeployment, 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 UpdateGameServerDeploymentRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest} message UpdateGameServerDeploymentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGameServerDeploymentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateGameServerDeploymentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest} UpdateGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGameServerDeploymentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.gameServerDeployment = $root.google.cloud.gaming.v1beta.GameServerDeployment.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 UpdateGameServerDeploymentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest} UpdateGameServerDeploymentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGameServerDeploymentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateGameServerDeploymentRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateGameServerDeploymentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gameServerDeployment != null && message.hasOwnProperty("gameServerDeployment")) { + var error = $root.google.cloud.gaming.v1beta.GameServerDeployment.verify(message.gameServerDeployment); + if (error) + return "gameServerDeployment." + 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 UpdateGameServerDeploymentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest} UpdateGameServerDeploymentRequest + */ + UpdateGameServerDeploymentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest(); + if (object.gameServerDeployment != null) { + if (typeof object.gameServerDeployment !== "object") + throw TypeError(".google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest.gameServerDeployment: object expected"); + message.gameServerDeployment = $root.google.cloud.gaming.v1beta.GameServerDeployment.fromObject(object.gameServerDeployment); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateGameServerDeploymentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest + * @static + * @param {google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest} message UpdateGameServerDeploymentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateGameServerDeploymentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gameServerDeployment = null; + object.updateMask = null; + } + if (message.gameServerDeployment != null && message.hasOwnProperty("gameServerDeployment")) + object.gameServerDeployment = $root.google.cloud.gaming.v1beta.GameServerDeployment.toObject(message.gameServerDeployment, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateGameServerDeploymentRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateGameServerDeploymentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateGameServerDeploymentRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateGameServerDeploymentRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest"; + }; + + return UpdateGameServerDeploymentRequest; + })(); + + v1beta.UpdateGameServerDeploymentRolloutRequest = (function() { + + /** + * Properties of an UpdateGameServerDeploymentRolloutRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IUpdateGameServerDeploymentRolloutRequest + * @property {google.cloud.gaming.v1beta.IGameServerDeploymentRollout|null} [rollout] UpdateGameServerDeploymentRolloutRequest rollout + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateGameServerDeploymentRolloutRequest updateMask + */ + + /** + * Constructs a new UpdateGameServerDeploymentRolloutRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents an UpdateGameServerDeploymentRolloutRequest. + * @implements IUpdateGameServerDeploymentRolloutRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest=} [properties] Properties to set + */ + function UpdateGameServerDeploymentRolloutRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateGameServerDeploymentRolloutRequest rollout. + * @member {google.cloud.gaming.v1beta.IGameServerDeploymentRollout|null|undefined} rollout + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest + * @instance + */ + UpdateGameServerDeploymentRolloutRequest.prototype.rollout = null; + + /** + * UpdateGameServerDeploymentRolloutRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest + * @instance + */ + UpdateGameServerDeploymentRolloutRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateGameServerDeploymentRolloutRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest} UpdateGameServerDeploymentRolloutRequest instance + */ + UpdateGameServerDeploymentRolloutRequest.create = function create(properties) { + return new UpdateGameServerDeploymentRolloutRequest(properties); + }; + + /** + * Encodes the specified UpdateGameServerDeploymentRolloutRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest} message UpdateGameServerDeploymentRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGameServerDeploymentRolloutRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rollout != null && Object.hasOwnProperty.call(message, "rollout")) + $root.google.cloud.gaming.v1beta.GameServerDeploymentRollout.encode(message.rollout, 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 UpdateGameServerDeploymentRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest} message UpdateGameServerDeploymentRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateGameServerDeploymentRolloutRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateGameServerDeploymentRolloutRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest} UpdateGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGameServerDeploymentRolloutRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rollout = $root.google.cloud.gaming.v1beta.GameServerDeploymentRollout.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 UpdateGameServerDeploymentRolloutRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest} UpdateGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateGameServerDeploymentRolloutRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateGameServerDeploymentRolloutRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateGameServerDeploymentRolloutRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rollout != null && message.hasOwnProperty("rollout")) { + var error = $root.google.cloud.gaming.v1beta.GameServerDeploymentRollout.verify(message.rollout); + if (error) + return "rollout." + 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 UpdateGameServerDeploymentRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest} UpdateGameServerDeploymentRolloutRequest + */ + UpdateGameServerDeploymentRolloutRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest(); + if (object.rollout != null) { + if (typeof object.rollout !== "object") + throw TypeError(".google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest.rollout: object expected"); + message.rollout = $root.google.cloud.gaming.v1beta.GameServerDeploymentRollout.fromObject(object.rollout); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateGameServerDeploymentRolloutRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest} message UpdateGameServerDeploymentRolloutRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateGameServerDeploymentRolloutRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rollout = null; + object.updateMask = null; + } + if (message.rollout != null && message.hasOwnProperty("rollout")) + object.rollout = $root.google.cloud.gaming.v1beta.GameServerDeploymentRollout.toObject(message.rollout, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateGameServerDeploymentRolloutRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateGameServerDeploymentRolloutRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateGameServerDeploymentRolloutRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateGameServerDeploymentRolloutRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest"; + }; + + return UpdateGameServerDeploymentRolloutRequest; + })(); + + v1beta.FetchDeploymentStateRequest = (function() { + + /** + * Properties of a FetchDeploymentStateRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IFetchDeploymentStateRequest + * @property {string|null} [name] FetchDeploymentStateRequest name + */ + + /** + * Constructs a new FetchDeploymentStateRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a FetchDeploymentStateRequest. + * @implements IFetchDeploymentStateRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IFetchDeploymentStateRequest=} [properties] Properties to set + */ + function FetchDeploymentStateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchDeploymentStateRequest name. + * @member {string} name + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateRequest + * @instance + */ + FetchDeploymentStateRequest.prototype.name = ""; + + /** + * Creates a new FetchDeploymentStateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateRequest + * @static + * @param {google.cloud.gaming.v1beta.IFetchDeploymentStateRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.FetchDeploymentStateRequest} FetchDeploymentStateRequest instance + */ + FetchDeploymentStateRequest.create = function create(properties) { + return new FetchDeploymentStateRequest(properties); + }; + + /** + * Encodes the specified FetchDeploymentStateRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.FetchDeploymentStateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateRequest + * @static + * @param {google.cloud.gaming.v1beta.IFetchDeploymentStateRequest} message FetchDeploymentStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchDeploymentStateRequest.encode = function encode(message, writer) { + 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 FetchDeploymentStateRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.FetchDeploymentStateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateRequest + * @static + * @param {google.cloud.gaming.v1beta.IFetchDeploymentStateRequest} message FetchDeploymentStateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchDeploymentStateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchDeploymentStateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.FetchDeploymentStateRequest} FetchDeploymentStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchDeploymentStateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.FetchDeploymentStateRequest(); + 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 FetchDeploymentStateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.FetchDeploymentStateRequest} FetchDeploymentStateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchDeploymentStateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchDeploymentStateRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchDeploymentStateRequest.verify = function verify(message) { + if (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 FetchDeploymentStateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.FetchDeploymentStateRequest} FetchDeploymentStateRequest + */ + FetchDeploymentStateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.FetchDeploymentStateRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.FetchDeploymentStateRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a FetchDeploymentStateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateRequest + * @static + * @param {google.cloud.gaming.v1beta.FetchDeploymentStateRequest} message FetchDeploymentStateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchDeploymentStateRequest.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 FetchDeploymentStateRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateRequest + * @instance + * @returns {Object.} JSON object + */ + FetchDeploymentStateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchDeploymentStateRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchDeploymentStateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.FetchDeploymentStateRequest"; + }; + + return FetchDeploymentStateRequest; + })(); + + v1beta.FetchDeploymentStateResponse = (function() { + + /** + * Properties of a FetchDeploymentStateResponse. + * @memberof google.cloud.gaming.v1beta + * @interface IFetchDeploymentStateResponse + * @property {Array.|null} [clusterState] FetchDeploymentStateResponse clusterState + * @property {Array.|null} [unavailable] FetchDeploymentStateResponse unavailable + */ + + /** + * Constructs a new FetchDeploymentStateResponse. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a FetchDeploymentStateResponse. + * @implements IFetchDeploymentStateResponse + * @constructor + * @param {google.cloud.gaming.v1beta.IFetchDeploymentStateResponse=} [properties] Properties to set + */ + function FetchDeploymentStateResponse(properties) { + this.clusterState = []; + this.unavailable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchDeploymentStateResponse clusterState. + * @member {Array.} clusterState + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse + * @instance + */ + FetchDeploymentStateResponse.prototype.clusterState = $util.emptyArray; + + /** + * FetchDeploymentStateResponse unavailable. + * @member {Array.} unavailable + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse + * @instance + */ + FetchDeploymentStateResponse.prototype.unavailable = $util.emptyArray; + + /** + * Creates a new FetchDeploymentStateResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse + * @static + * @param {google.cloud.gaming.v1beta.IFetchDeploymentStateResponse=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.FetchDeploymentStateResponse} FetchDeploymentStateResponse instance + */ + FetchDeploymentStateResponse.create = function create(properties) { + return new FetchDeploymentStateResponse(properties); + }; + + /** + * Encodes the specified FetchDeploymentStateResponse message. Does not implicitly {@link google.cloud.gaming.v1beta.FetchDeploymentStateResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse + * @static + * @param {google.cloud.gaming.v1beta.IFetchDeploymentStateResponse} message FetchDeploymentStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchDeploymentStateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusterState != null && message.clusterState.length) + for (var i = 0; i < message.clusterState.length; ++i) + $root.google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState.encode(message.clusterState[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.unavailable != null && message.unavailable.length) + for (var i = 0; i < message.unavailable.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.unavailable[i]); + return writer; + }; + + /** + * Encodes the specified FetchDeploymentStateResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.FetchDeploymentStateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse + * @static + * @param {google.cloud.gaming.v1beta.IFetchDeploymentStateResponse} message FetchDeploymentStateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchDeploymentStateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchDeploymentStateResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.FetchDeploymentStateResponse} FetchDeploymentStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchDeploymentStateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.FetchDeploymentStateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.clusterState && message.clusterState.length)) + message.clusterState = []; + message.clusterState.push($root.google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.unavailable && message.unavailable.length)) + message.unavailable = []; + message.unavailable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchDeploymentStateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.FetchDeploymentStateResponse} FetchDeploymentStateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchDeploymentStateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchDeploymentStateResponse message. + * @function verify + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchDeploymentStateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusterState != null && message.hasOwnProperty("clusterState")) { + if (!Array.isArray(message.clusterState)) + return "clusterState: array expected"; + for (var i = 0; i < message.clusterState.length; ++i) { + var error = $root.google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState.verify(message.clusterState[i]); + if (error) + return "clusterState." + error; + } + } + if (message.unavailable != null && message.hasOwnProperty("unavailable")) { + if (!Array.isArray(message.unavailable)) + return "unavailable: array expected"; + for (var i = 0; i < message.unavailable.length; ++i) + if (!$util.isString(message.unavailable[i])) + return "unavailable: string[] expected"; + } + return null; + }; + + /** + * Creates a FetchDeploymentStateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.FetchDeploymentStateResponse} FetchDeploymentStateResponse + */ + FetchDeploymentStateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.FetchDeploymentStateResponse) + return object; + var message = new $root.google.cloud.gaming.v1beta.FetchDeploymentStateResponse(); + if (object.clusterState) { + if (!Array.isArray(object.clusterState)) + throw TypeError(".google.cloud.gaming.v1beta.FetchDeploymentStateResponse.clusterState: array expected"); + message.clusterState = []; + for (var i = 0; i < object.clusterState.length; ++i) { + if (typeof object.clusterState[i] !== "object") + throw TypeError(".google.cloud.gaming.v1beta.FetchDeploymentStateResponse.clusterState: object expected"); + message.clusterState[i] = $root.google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState.fromObject(object.clusterState[i]); + } + } + if (object.unavailable) { + if (!Array.isArray(object.unavailable)) + throw TypeError(".google.cloud.gaming.v1beta.FetchDeploymentStateResponse.unavailable: array expected"); + message.unavailable = []; + for (var i = 0; i < object.unavailable.length; ++i) + message.unavailable[i] = String(object.unavailable[i]); + } + return message; + }; + + /** + * Creates a plain object from a FetchDeploymentStateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse + * @static + * @param {google.cloud.gaming.v1beta.FetchDeploymentStateResponse} message FetchDeploymentStateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchDeploymentStateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.clusterState = []; + object.unavailable = []; + } + if (message.clusterState && message.clusterState.length) { + object.clusterState = []; + for (var j = 0; j < message.clusterState.length; ++j) + object.clusterState[j] = $root.google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState.toObject(message.clusterState[j], options); + } + if (message.unavailable && message.unavailable.length) { + object.unavailable = []; + for (var j = 0; j < message.unavailable.length; ++j) + object.unavailable[j] = message.unavailable[j]; + } + return object; + }; + + /** + * Converts this FetchDeploymentStateResponse to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse + * @instance + * @returns {Object.} JSON object + */ + FetchDeploymentStateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchDeploymentStateResponse + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchDeploymentStateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.FetchDeploymentStateResponse"; + }; + + FetchDeploymentStateResponse.DeployedClusterState = (function() { + + /** + * Properties of a DeployedClusterState. + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse + * @interface IDeployedClusterState + * @property {string|null} [cluster] DeployedClusterState cluster + * @property {Array.|null} [fleetDetails] DeployedClusterState fleetDetails + */ + + /** + * Constructs a new DeployedClusterState. + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse + * @classdesc Represents a DeployedClusterState. + * @implements IDeployedClusterState + * @constructor + * @param {google.cloud.gaming.v1beta.FetchDeploymentStateResponse.IDeployedClusterState=} [properties] Properties to set + */ + function DeployedClusterState(properties) { + this.fleetDetails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeployedClusterState cluster. + * @member {string} cluster + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState + * @instance + */ + DeployedClusterState.prototype.cluster = ""; + + /** + * DeployedClusterState fleetDetails. + * @member {Array.} fleetDetails + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState + * @instance + */ + DeployedClusterState.prototype.fleetDetails = $util.emptyArray; + + /** + * Creates a new DeployedClusterState instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState + * @static + * @param {google.cloud.gaming.v1beta.FetchDeploymentStateResponse.IDeployedClusterState=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState} DeployedClusterState instance + */ + DeployedClusterState.create = function create(properties) { + return new DeployedClusterState(properties); + }; + + /** + * Encodes the specified DeployedClusterState message. Does not implicitly {@link google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState + * @static + * @param {google.cloud.gaming.v1beta.FetchDeploymentStateResponse.IDeployedClusterState} message DeployedClusterState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployedClusterState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cluster); + if (message.fleetDetails != null && message.fleetDetails.length) + for (var i = 0; i < message.fleetDetails.length; ++i) + $root.google.cloud.gaming.v1beta.DeployedFleetDetails.encode(message.fleetDetails[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DeployedClusterState message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState + * @static + * @param {google.cloud.gaming.v1beta.FetchDeploymentStateResponse.IDeployedClusterState} message DeployedClusterState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeployedClusterState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeployedClusterState message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState} DeployedClusterState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployedClusterState.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.cluster = reader.string(); + break; + } + case 2: { + if (!(message.fleetDetails && message.fleetDetails.length)) + message.fleetDetails = []; + message.fleetDetails.push($root.google.cloud.gaming.v1beta.DeployedFleetDetails.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeployedClusterState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState} DeployedClusterState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeployedClusterState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeployedClusterState message. + * @function verify + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeployedClusterState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) + if (!$util.isString(message.cluster)) + return "cluster: string expected"; + if (message.fleetDetails != null && message.hasOwnProperty("fleetDetails")) { + if (!Array.isArray(message.fleetDetails)) + return "fleetDetails: array expected"; + for (var i = 0; i < message.fleetDetails.length; ++i) { + var error = $root.google.cloud.gaming.v1beta.DeployedFleetDetails.verify(message.fleetDetails[i]); + if (error) + return "fleetDetails." + error; + } + } + return null; + }; + + /** + * Creates a DeployedClusterState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState} DeployedClusterState + */ + DeployedClusterState.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState) + return object; + var message = new $root.google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState(); + if (object.cluster != null) + message.cluster = String(object.cluster); + if (object.fleetDetails) { + if (!Array.isArray(object.fleetDetails)) + throw TypeError(".google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState.fleetDetails: array expected"); + message.fleetDetails = []; + for (var i = 0; i < object.fleetDetails.length; ++i) { + if (typeof object.fleetDetails[i] !== "object") + throw TypeError(".google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState.fleetDetails: object expected"); + message.fleetDetails[i] = $root.google.cloud.gaming.v1beta.DeployedFleetDetails.fromObject(object.fleetDetails[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DeployedClusterState message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState + * @static + * @param {google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState} message DeployedClusterState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeployedClusterState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fleetDetails = []; + if (options.defaults) + object.cluster = ""; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = message.cluster; + if (message.fleetDetails && message.fleetDetails.length) { + object.fleetDetails = []; + for (var j = 0; j < message.fleetDetails.length; ++j) + object.fleetDetails[j] = $root.google.cloud.gaming.v1beta.DeployedFleetDetails.toObject(message.fleetDetails[j], options); + } + return object; + }; + + /** + * Converts this DeployedClusterState to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState + * @instance + * @returns {Object.} JSON object + */ + DeployedClusterState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeployedClusterState + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeployedClusterState.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.FetchDeploymentStateResponse.DeployedClusterState"; + }; + + return DeployedClusterState; + })(); + + return FetchDeploymentStateResponse; + })(); + + v1beta.GameServerDeployment = (function() { + + /** + * Properties of a GameServerDeployment. + * @memberof google.cloud.gaming.v1beta + * @interface IGameServerDeployment + * @property {string|null} [name] GameServerDeployment name + * @property {google.protobuf.ITimestamp|null} [createTime] GameServerDeployment createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] GameServerDeployment updateTime + * @property {Object.|null} [labels] GameServerDeployment labels + * @property {string|null} [etag] GameServerDeployment etag + * @property {string|null} [description] GameServerDeployment description + */ + + /** + * Constructs a new GameServerDeployment. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a GameServerDeployment. + * @implements IGameServerDeployment + * @constructor + * @param {google.cloud.gaming.v1beta.IGameServerDeployment=} [properties] Properties to set + */ + function GameServerDeployment(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]]; + } + + /** + * GameServerDeployment name. + * @member {string} name + * @memberof google.cloud.gaming.v1beta.GameServerDeployment + * @instance + */ + GameServerDeployment.prototype.name = ""; + + /** + * GameServerDeployment createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.gaming.v1beta.GameServerDeployment + * @instance + */ + GameServerDeployment.prototype.createTime = null; + + /** + * GameServerDeployment updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.gaming.v1beta.GameServerDeployment + * @instance + */ + GameServerDeployment.prototype.updateTime = null; + + /** + * GameServerDeployment labels. + * @member {Object.} labels + * @memberof google.cloud.gaming.v1beta.GameServerDeployment + * @instance + */ + GameServerDeployment.prototype.labels = $util.emptyObject; + + /** + * GameServerDeployment etag. + * @member {string} etag + * @memberof google.cloud.gaming.v1beta.GameServerDeployment + * @instance + */ + GameServerDeployment.prototype.etag = ""; + + /** + * GameServerDeployment description. + * @member {string} description + * @memberof google.cloud.gaming.v1beta.GameServerDeployment + * @instance + */ + GameServerDeployment.prototype.description = ""; + + /** + * Creates a new GameServerDeployment instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.GameServerDeployment + * @static + * @param {google.cloud.gaming.v1beta.IGameServerDeployment=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.GameServerDeployment} GameServerDeployment instance + */ + GameServerDeployment.create = function create(properties) { + return new GameServerDeployment(properties); + }; + + /** + * Encodes the specified GameServerDeployment message. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerDeployment.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.GameServerDeployment + * @static + * @param {google.cloud.gaming.v1beta.IGameServerDeployment} message GameServerDeployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerDeployment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.description); + return writer; + }; + + /** + * Encodes the specified GameServerDeployment message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerDeployment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.GameServerDeployment + * @static + * @param {google.cloud.gaming.v1beta.IGameServerDeployment} message GameServerDeployment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerDeployment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GameServerDeployment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.GameServerDeployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.GameServerDeployment} GameServerDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerDeployment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.GameServerDeployment(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 7: { + message.etag = reader.string(); + break; + } + case 8: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GameServerDeployment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.GameServerDeployment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.GameServerDeployment} GameServerDeployment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerDeployment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GameServerDeployment message. + * @function verify + * @memberof google.cloud.gaming.v1beta.GameServerDeployment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GameServerDeployment.verify = function verify(message) { + if (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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a GameServerDeployment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.GameServerDeployment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.GameServerDeployment} GameServerDeployment + */ + GameServerDeployment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.GameServerDeployment) + return object; + var message = new $root.google.cloud.gaming.v1beta.GameServerDeployment(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.gaming.v1beta.GameServerDeployment.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.gaming.v1beta.GameServerDeployment.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.gaming.v1beta.GameServerDeployment.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a GameServerDeployment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.GameServerDeployment + * @static + * @param {google.cloud.gaming.v1beta.GameServerDeployment} message GameServerDeployment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GameServerDeployment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.etag = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this GameServerDeployment to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.GameServerDeployment + * @instance + * @returns {Object.} JSON object + */ + GameServerDeployment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GameServerDeployment + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.GameServerDeployment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GameServerDeployment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.GameServerDeployment"; + }; + + return GameServerDeployment; + })(); + + v1beta.GameServerConfigOverride = (function() { + + /** + * Properties of a GameServerConfigOverride. + * @memberof google.cloud.gaming.v1beta + * @interface IGameServerConfigOverride + * @property {google.cloud.gaming.v1beta.IRealmSelector|null} [realmsSelector] GameServerConfigOverride realmsSelector + * @property {string|null} [configVersion] GameServerConfigOverride configVersion + */ + + /** + * Constructs a new GameServerConfigOverride. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a GameServerConfigOverride. + * @implements IGameServerConfigOverride + * @constructor + * @param {google.cloud.gaming.v1beta.IGameServerConfigOverride=} [properties] Properties to set + */ + function GameServerConfigOverride(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GameServerConfigOverride realmsSelector. + * @member {google.cloud.gaming.v1beta.IRealmSelector|null|undefined} realmsSelector + * @memberof google.cloud.gaming.v1beta.GameServerConfigOverride + * @instance + */ + GameServerConfigOverride.prototype.realmsSelector = null; + + /** + * GameServerConfigOverride configVersion. + * @member {string|null|undefined} configVersion + * @memberof google.cloud.gaming.v1beta.GameServerConfigOverride + * @instance + */ + GameServerConfigOverride.prototype.configVersion = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GameServerConfigOverride selector. + * @member {"realmsSelector"|undefined} selector + * @memberof google.cloud.gaming.v1beta.GameServerConfigOverride + * @instance + */ + Object.defineProperty(GameServerConfigOverride.prototype, "selector", { + get: $util.oneOfGetter($oneOfFields = ["realmsSelector"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * GameServerConfigOverride change. + * @member {"configVersion"|undefined} change + * @memberof google.cloud.gaming.v1beta.GameServerConfigOverride + * @instance + */ + Object.defineProperty(GameServerConfigOverride.prototype, "change", { + get: $util.oneOfGetter($oneOfFields = ["configVersion"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GameServerConfigOverride instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.GameServerConfigOverride + * @static + * @param {google.cloud.gaming.v1beta.IGameServerConfigOverride=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.GameServerConfigOverride} GameServerConfigOverride instance + */ + GameServerConfigOverride.create = function create(properties) { + return new GameServerConfigOverride(properties); + }; + + /** + * Encodes the specified GameServerConfigOverride message. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerConfigOverride.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.GameServerConfigOverride + * @static + * @param {google.cloud.gaming.v1beta.IGameServerConfigOverride} message GameServerConfigOverride message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerConfigOverride.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.realmsSelector != null && Object.hasOwnProperty.call(message, "realmsSelector")) + $root.google.cloud.gaming.v1beta.RealmSelector.encode(message.realmsSelector, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.configVersion != null && Object.hasOwnProperty.call(message, "configVersion")) + writer.uint32(/* id 100, wireType 2 =*/802).string(message.configVersion); + return writer; + }; + + /** + * Encodes the specified GameServerConfigOverride message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerConfigOverride.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.GameServerConfigOverride + * @static + * @param {google.cloud.gaming.v1beta.IGameServerConfigOverride} message GameServerConfigOverride message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerConfigOverride.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GameServerConfigOverride message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.GameServerConfigOverride + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.GameServerConfigOverride} GameServerConfigOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerConfigOverride.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.GameServerConfigOverride(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.realmsSelector = $root.google.cloud.gaming.v1beta.RealmSelector.decode(reader, reader.uint32()); + break; + } + case 100: { + message.configVersion = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GameServerConfigOverride message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.GameServerConfigOverride + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.GameServerConfigOverride} GameServerConfigOverride + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerConfigOverride.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GameServerConfigOverride message. + * @function verify + * @memberof google.cloud.gaming.v1beta.GameServerConfigOverride + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GameServerConfigOverride.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.realmsSelector != null && message.hasOwnProperty("realmsSelector")) { + properties.selector = 1; + { + var error = $root.google.cloud.gaming.v1beta.RealmSelector.verify(message.realmsSelector); + if (error) + return "realmsSelector." + error; + } + } + if (message.configVersion != null && message.hasOwnProperty("configVersion")) { + properties.change = 1; + if (!$util.isString(message.configVersion)) + return "configVersion: string expected"; + } + return null; + }; + + /** + * Creates a GameServerConfigOverride message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.GameServerConfigOverride + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.GameServerConfigOverride} GameServerConfigOverride + */ + GameServerConfigOverride.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.GameServerConfigOverride) + return object; + var message = new $root.google.cloud.gaming.v1beta.GameServerConfigOverride(); + if (object.realmsSelector != null) { + if (typeof object.realmsSelector !== "object") + throw TypeError(".google.cloud.gaming.v1beta.GameServerConfigOverride.realmsSelector: object expected"); + message.realmsSelector = $root.google.cloud.gaming.v1beta.RealmSelector.fromObject(object.realmsSelector); + } + if (object.configVersion != null) + message.configVersion = String(object.configVersion); + return message; + }; + + /** + * Creates a plain object from a GameServerConfigOverride message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.GameServerConfigOverride + * @static + * @param {google.cloud.gaming.v1beta.GameServerConfigOverride} message GameServerConfigOverride + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GameServerConfigOverride.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.realmsSelector != null && message.hasOwnProperty("realmsSelector")) { + object.realmsSelector = $root.google.cloud.gaming.v1beta.RealmSelector.toObject(message.realmsSelector, options); + if (options.oneofs) + object.selector = "realmsSelector"; + } + if (message.configVersion != null && message.hasOwnProperty("configVersion")) { + object.configVersion = message.configVersion; + if (options.oneofs) + object.change = "configVersion"; + } + return object; + }; + + /** + * Converts this GameServerConfigOverride to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.GameServerConfigOverride + * @instance + * @returns {Object.} JSON object + */ + GameServerConfigOverride.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GameServerConfigOverride + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.GameServerConfigOverride + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GameServerConfigOverride.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.GameServerConfigOverride"; + }; + + return GameServerConfigOverride; + })(); + + v1beta.GameServerDeploymentRollout = (function() { + + /** + * Properties of a GameServerDeploymentRollout. + * @memberof google.cloud.gaming.v1beta + * @interface IGameServerDeploymentRollout + * @property {string|null} [name] GameServerDeploymentRollout name + * @property {google.protobuf.ITimestamp|null} [createTime] GameServerDeploymentRollout createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] GameServerDeploymentRollout updateTime + * @property {string|null} [defaultGameServerConfig] GameServerDeploymentRollout defaultGameServerConfig + * @property {Array.|null} [gameServerConfigOverrides] GameServerDeploymentRollout gameServerConfigOverrides + * @property {string|null} [etag] GameServerDeploymentRollout etag + */ + + /** + * Constructs a new GameServerDeploymentRollout. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a GameServerDeploymentRollout. + * @implements IGameServerDeploymentRollout + * @constructor + * @param {google.cloud.gaming.v1beta.IGameServerDeploymentRollout=} [properties] Properties to set + */ + function GameServerDeploymentRollout(properties) { + this.gameServerConfigOverrides = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GameServerDeploymentRollout name. + * @member {string} name + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentRollout + * @instance + */ + GameServerDeploymentRollout.prototype.name = ""; + + /** + * GameServerDeploymentRollout createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentRollout + * @instance + */ + GameServerDeploymentRollout.prototype.createTime = null; + + /** + * GameServerDeploymentRollout updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentRollout + * @instance + */ + GameServerDeploymentRollout.prototype.updateTime = null; + + /** + * GameServerDeploymentRollout defaultGameServerConfig. + * @member {string} defaultGameServerConfig + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentRollout + * @instance + */ + GameServerDeploymentRollout.prototype.defaultGameServerConfig = ""; + + /** + * GameServerDeploymentRollout gameServerConfigOverrides. + * @member {Array.} gameServerConfigOverrides + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentRollout + * @instance + */ + GameServerDeploymentRollout.prototype.gameServerConfigOverrides = $util.emptyArray; + + /** + * GameServerDeploymentRollout etag. + * @member {string} etag + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentRollout + * @instance + */ + GameServerDeploymentRollout.prototype.etag = ""; + + /** + * Creates a new GameServerDeploymentRollout instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentRollout + * @static + * @param {google.cloud.gaming.v1beta.IGameServerDeploymentRollout=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.GameServerDeploymentRollout} GameServerDeploymentRollout instance + */ + GameServerDeploymentRollout.create = function create(properties) { + return new GameServerDeploymentRollout(properties); + }; + + /** + * Encodes the specified GameServerDeploymentRollout message. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerDeploymentRollout.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentRollout + * @static + * @param {google.cloud.gaming.v1beta.IGameServerDeploymentRollout} message GameServerDeploymentRollout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerDeploymentRollout.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.defaultGameServerConfig != null && Object.hasOwnProperty.call(message, "defaultGameServerConfig")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.defaultGameServerConfig); + if (message.gameServerConfigOverrides != null && message.gameServerConfigOverrides.length) + for (var i = 0; i < message.gameServerConfigOverrides.length; ++i) + $root.google.cloud.gaming.v1beta.GameServerConfigOverride.encode(message.gameServerConfigOverrides[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + return writer; + }; + + /** + * Encodes the specified GameServerDeploymentRollout message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GameServerDeploymentRollout.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentRollout + * @static + * @param {google.cloud.gaming.v1beta.IGameServerDeploymentRollout} message GameServerDeploymentRollout message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GameServerDeploymentRollout.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GameServerDeploymentRollout message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentRollout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.GameServerDeploymentRollout} GameServerDeploymentRollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerDeploymentRollout.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.GameServerDeploymentRollout(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.defaultGameServerConfig = reader.string(); + break; + } + case 5: { + if (!(message.gameServerConfigOverrides && message.gameServerConfigOverrides.length)) + message.gameServerConfigOverrides = []; + message.gameServerConfigOverrides.push($root.google.cloud.gaming.v1beta.GameServerConfigOverride.decode(reader, reader.uint32())); + break; + } + case 6: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GameServerDeploymentRollout message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentRollout + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.GameServerDeploymentRollout} GameServerDeploymentRollout + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GameServerDeploymentRollout.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GameServerDeploymentRollout message. + * @function verify + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentRollout + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GameServerDeploymentRollout.verify = function verify(message) { + if (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.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.defaultGameServerConfig != null && message.hasOwnProperty("defaultGameServerConfig")) + if (!$util.isString(message.defaultGameServerConfig)) + return "defaultGameServerConfig: string expected"; + if (message.gameServerConfigOverrides != null && message.hasOwnProperty("gameServerConfigOverrides")) { + if (!Array.isArray(message.gameServerConfigOverrides)) + return "gameServerConfigOverrides: array expected"; + for (var i = 0; i < message.gameServerConfigOverrides.length; ++i) { + var error = $root.google.cloud.gaming.v1beta.GameServerConfigOverride.verify(message.gameServerConfigOverrides[i]); + if (error) + return "gameServerConfigOverrides." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a GameServerDeploymentRollout message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentRollout + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.GameServerDeploymentRollout} GameServerDeploymentRollout + */ + GameServerDeploymentRollout.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.GameServerDeploymentRollout) + return object; + var message = new $root.google.cloud.gaming.v1beta.GameServerDeploymentRollout(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.gaming.v1beta.GameServerDeploymentRollout.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.gaming.v1beta.GameServerDeploymentRollout.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.defaultGameServerConfig != null) + message.defaultGameServerConfig = String(object.defaultGameServerConfig); + if (object.gameServerConfigOverrides) { + if (!Array.isArray(object.gameServerConfigOverrides)) + throw TypeError(".google.cloud.gaming.v1beta.GameServerDeploymentRollout.gameServerConfigOverrides: array expected"); + message.gameServerConfigOverrides = []; + for (var i = 0; i < object.gameServerConfigOverrides.length; ++i) { + if (typeof object.gameServerConfigOverrides[i] !== "object") + throw TypeError(".google.cloud.gaming.v1beta.GameServerDeploymentRollout.gameServerConfigOverrides: object expected"); + message.gameServerConfigOverrides[i] = $root.google.cloud.gaming.v1beta.GameServerConfigOverride.fromObject(object.gameServerConfigOverrides[i]); + } + } + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a GameServerDeploymentRollout message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentRollout + * @static + * @param {google.cloud.gaming.v1beta.GameServerDeploymentRollout} message GameServerDeploymentRollout + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GameServerDeploymentRollout.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.gameServerConfigOverrides = []; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.defaultGameServerConfig = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.defaultGameServerConfig != null && message.hasOwnProperty("defaultGameServerConfig")) + object.defaultGameServerConfig = message.defaultGameServerConfig; + if (message.gameServerConfigOverrides && message.gameServerConfigOverrides.length) { + object.gameServerConfigOverrides = []; + for (var j = 0; j < message.gameServerConfigOverrides.length; ++j) + object.gameServerConfigOverrides[j] = $root.google.cloud.gaming.v1beta.GameServerConfigOverride.toObject(message.gameServerConfigOverrides[j], options); + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this GameServerDeploymentRollout to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentRollout + * @instance + * @returns {Object.} JSON object + */ + GameServerDeploymentRollout.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GameServerDeploymentRollout + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentRollout + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GameServerDeploymentRollout.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.GameServerDeploymentRollout"; + }; + + return GameServerDeploymentRollout; + })(); + + v1beta.PreviewGameServerDeploymentRolloutRequest = (function() { + + /** + * Properties of a PreviewGameServerDeploymentRolloutRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IPreviewGameServerDeploymentRolloutRequest + * @property {google.cloud.gaming.v1beta.IGameServerDeploymentRollout|null} [rollout] PreviewGameServerDeploymentRolloutRequest rollout + * @property {google.protobuf.IFieldMask|null} [updateMask] PreviewGameServerDeploymentRolloutRequest updateMask + * @property {google.protobuf.ITimestamp|null} [previewTime] PreviewGameServerDeploymentRolloutRequest previewTime + */ + + /** + * Constructs a new PreviewGameServerDeploymentRolloutRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a PreviewGameServerDeploymentRolloutRequest. + * @implements IPreviewGameServerDeploymentRolloutRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest=} [properties] Properties to set + */ + function PreviewGameServerDeploymentRolloutRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreviewGameServerDeploymentRolloutRequest rollout. + * @member {google.cloud.gaming.v1beta.IGameServerDeploymentRollout|null|undefined} rollout + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest + * @instance + */ + PreviewGameServerDeploymentRolloutRequest.prototype.rollout = null; + + /** + * PreviewGameServerDeploymentRolloutRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest + * @instance + */ + PreviewGameServerDeploymentRolloutRequest.prototype.updateMask = null; + + /** + * PreviewGameServerDeploymentRolloutRequest previewTime. + * @member {google.protobuf.ITimestamp|null|undefined} previewTime + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest + * @instance + */ + PreviewGameServerDeploymentRolloutRequest.prototype.previewTime = null; + + /** + * Creates a new PreviewGameServerDeploymentRolloutRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest} PreviewGameServerDeploymentRolloutRequest instance + */ + PreviewGameServerDeploymentRolloutRequest.create = function create(properties) { + return new PreviewGameServerDeploymentRolloutRequest(properties); + }; + + /** + * Encodes the specified PreviewGameServerDeploymentRolloutRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest} message PreviewGameServerDeploymentRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewGameServerDeploymentRolloutRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rollout != null && Object.hasOwnProperty.call(message, "rollout")) + $root.google.cloud.gaming.v1beta.GameServerDeploymentRollout.encode(message.rollout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.previewTime != null && Object.hasOwnProperty.call(message, "previewTime")) + $root.google.protobuf.Timestamp.encode(message.previewTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreviewGameServerDeploymentRolloutRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest} message PreviewGameServerDeploymentRolloutRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewGameServerDeploymentRolloutRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreviewGameServerDeploymentRolloutRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest} PreviewGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewGameServerDeploymentRolloutRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.rollout = $root.google.cloud.gaming.v1beta.GameServerDeploymentRollout.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.previewTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreviewGameServerDeploymentRolloutRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest} PreviewGameServerDeploymentRolloutRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewGameServerDeploymentRolloutRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreviewGameServerDeploymentRolloutRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreviewGameServerDeploymentRolloutRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rollout != null && message.hasOwnProperty("rollout")) { + var error = $root.google.cloud.gaming.v1beta.GameServerDeploymentRollout.verify(message.rollout); + if (error) + return "rollout." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.previewTime != null && message.hasOwnProperty("previewTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.previewTime); + if (error) + return "previewTime." + error; + } + return null; + }; + + /** + * Creates a PreviewGameServerDeploymentRolloutRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest} PreviewGameServerDeploymentRolloutRequest + */ + PreviewGameServerDeploymentRolloutRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest(); + if (object.rollout != null) { + if (typeof object.rollout !== "object") + throw TypeError(".google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest.rollout: object expected"); + message.rollout = $root.google.cloud.gaming.v1beta.GameServerDeploymentRollout.fromObject(object.rollout); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.previewTime != null) { + if (typeof object.previewTime !== "object") + throw TypeError(".google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest.previewTime: object expected"); + message.previewTime = $root.google.protobuf.Timestamp.fromObject(object.previewTime); + } + return message; + }; + + /** + * Creates a plain object from a PreviewGameServerDeploymentRolloutRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest + * @static + * @param {google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest} message PreviewGameServerDeploymentRolloutRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreviewGameServerDeploymentRolloutRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.rollout = null; + object.updateMask = null; + object.previewTime = null; + } + if (message.rollout != null && message.hasOwnProperty("rollout")) + object.rollout = $root.google.cloud.gaming.v1beta.GameServerDeploymentRollout.toObject(message.rollout, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.previewTime != null && message.hasOwnProperty("previewTime")) + object.previewTime = $root.google.protobuf.Timestamp.toObject(message.previewTime, options); + return object; + }; + + /** + * Converts this PreviewGameServerDeploymentRolloutRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest + * @instance + * @returns {Object.} JSON object + */ + PreviewGameServerDeploymentRolloutRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PreviewGameServerDeploymentRolloutRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PreviewGameServerDeploymentRolloutRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest"; + }; + + return PreviewGameServerDeploymentRolloutRequest; + })(); + + v1beta.PreviewGameServerDeploymentRolloutResponse = (function() { + + /** + * Properties of a PreviewGameServerDeploymentRolloutResponse. + * @memberof google.cloud.gaming.v1beta + * @interface IPreviewGameServerDeploymentRolloutResponse + * @property {Array.|null} [unavailable] PreviewGameServerDeploymentRolloutResponse unavailable + * @property {string|null} [etag] PreviewGameServerDeploymentRolloutResponse etag + * @property {google.cloud.gaming.v1beta.ITargetState|null} [targetState] PreviewGameServerDeploymentRolloutResponse targetState + */ + + /** + * Constructs a new PreviewGameServerDeploymentRolloutResponse. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a PreviewGameServerDeploymentRolloutResponse. + * @implements IPreviewGameServerDeploymentRolloutResponse + * @constructor + * @param {google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse=} [properties] Properties to set + */ + function PreviewGameServerDeploymentRolloutResponse(properties) { + this.unavailable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreviewGameServerDeploymentRolloutResponse unavailable. + * @member {Array.} unavailable + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse + * @instance + */ + PreviewGameServerDeploymentRolloutResponse.prototype.unavailable = $util.emptyArray; + + /** + * PreviewGameServerDeploymentRolloutResponse etag. + * @member {string} etag + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse + * @instance + */ + PreviewGameServerDeploymentRolloutResponse.prototype.etag = ""; + + /** + * PreviewGameServerDeploymentRolloutResponse targetState. + * @member {google.cloud.gaming.v1beta.ITargetState|null|undefined} targetState + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse + * @instance + */ + PreviewGameServerDeploymentRolloutResponse.prototype.targetState = null; + + /** + * Creates a new PreviewGameServerDeploymentRolloutResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse + * @static + * @param {google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse} PreviewGameServerDeploymentRolloutResponse instance + */ + PreviewGameServerDeploymentRolloutResponse.create = function create(properties) { + return new PreviewGameServerDeploymentRolloutResponse(properties); + }; + + /** + * Encodes the specified PreviewGameServerDeploymentRolloutResponse message. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse + * @static + * @param {google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse} message PreviewGameServerDeploymentRolloutResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewGameServerDeploymentRolloutResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.unavailable != null && message.unavailable.length) + for (var i = 0; i < message.unavailable.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.unavailable[i]); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.targetState != null && Object.hasOwnProperty.call(message, "targetState")) + $root.google.cloud.gaming.v1beta.TargetState.encode(message.targetState, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreviewGameServerDeploymentRolloutResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse + * @static + * @param {google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse} message PreviewGameServerDeploymentRolloutResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewGameServerDeploymentRolloutResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreviewGameServerDeploymentRolloutResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse} PreviewGameServerDeploymentRolloutResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewGameServerDeploymentRolloutResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.unavailable && message.unavailable.length)) + message.unavailable = []; + message.unavailable.push(reader.string()); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + case 4: { + message.targetState = $root.google.cloud.gaming.v1beta.TargetState.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreviewGameServerDeploymentRolloutResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse} PreviewGameServerDeploymentRolloutResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewGameServerDeploymentRolloutResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreviewGameServerDeploymentRolloutResponse message. + * @function verify + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreviewGameServerDeploymentRolloutResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.unavailable != null && message.hasOwnProperty("unavailable")) { + if (!Array.isArray(message.unavailable)) + return "unavailable: array expected"; + for (var i = 0; i < message.unavailable.length; ++i) + if (!$util.isString(message.unavailable[i])) + return "unavailable: string[] expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.targetState != null && message.hasOwnProperty("targetState")) { + var error = $root.google.cloud.gaming.v1beta.TargetState.verify(message.targetState); + if (error) + return "targetState." + error; + } + return null; + }; + + /** + * Creates a PreviewGameServerDeploymentRolloutResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse} PreviewGameServerDeploymentRolloutResponse + */ + PreviewGameServerDeploymentRolloutResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse) + return object; + var message = new $root.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse(); + if (object.unavailable) { + if (!Array.isArray(object.unavailable)) + throw TypeError(".google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse.unavailable: array expected"); + message.unavailable = []; + for (var i = 0; i < object.unavailable.length; ++i) + message.unavailable[i] = String(object.unavailable[i]); + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.targetState != null) { + if (typeof object.targetState !== "object") + throw TypeError(".google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse.targetState: object expected"); + message.targetState = $root.google.cloud.gaming.v1beta.TargetState.fromObject(object.targetState); + } + return message; + }; + + /** + * Creates a plain object from a PreviewGameServerDeploymentRolloutResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse + * @static + * @param {google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse} message PreviewGameServerDeploymentRolloutResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreviewGameServerDeploymentRolloutResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.unavailable = []; + if (options.defaults) { + object.etag = ""; + object.targetState = null; + } + if (message.unavailable && message.unavailable.length) { + object.unavailable = []; + for (var j = 0; j < message.unavailable.length; ++j) + object.unavailable[j] = message.unavailable[j]; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.targetState != null && message.hasOwnProperty("targetState")) + object.targetState = $root.google.cloud.gaming.v1beta.TargetState.toObject(message.targetState, options); + return object; + }; + + /** + * Converts this PreviewGameServerDeploymentRolloutResponse to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse + * @instance + * @returns {Object.} JSON object + */ + PreviewGameServerDeploymentRolloutResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PreviewGameServerDeploymentRolloutResponse + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PreviewGameServerDeploymentRolloutResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse"; + }; + + return PreviewGameServerDeploymentRolloutResponse; + })(); + + v1beta.GameServerDeploymentsService = (function() { + + /** + * Constructs a new GameServerDeploymentsService service. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a GameServerDeploymentsService + * @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 GameServerDeploymentsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (GameServerDeploymentsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = GameServerDeploymentsService; + + /** + * Creates new GameServerDeploymentsService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @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 {GameServerDeploymentsService} RPC service. Useful where requests and/or responses are streamed. + */ + GameServerDeploymentsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|listGameServerDeployments}. + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @typedef ListGameServerDeploymentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse} [response] ListGameServerDeploymentsResponse + */ + + /** + * Calls ListGameServerDeployments. + * @function listGameServerDeployments + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest} request ListGameServerDeploymentsRequest message or plain object + * @param {google.cloud.gaming.v1beta.GameServerDeploymentsService.ListGameServerDeploymentsCallback} callback Node-style callback called with the error, if any, and ListGameServerDeploymentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerDeploymentsService.prototype.listGameServerDeployments = function listGameServerDeployments(request, callback) { + return this.rpcCall(listGameServerDeployments, $root.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest, $root.google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse, request, callback); + }, "name", { value: "ListGameServerDeployments" }); + + /** + * Calls ListGameServerDeployments. + * @function listGameServerDeployments + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest} request ListGameServerDeploymentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|getGameServerDeployment}. + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @typedef GetGameServerDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1beta.GameServerDeployment} [response] GameServerDeployment + */ + + /** + * Calls GetGameServerDeployment. + * @function getGameServerDeployment + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest} request GetGameServerDeploymentRequest message or plain object + * @param {google.cloud.gaming.v1beta.GameServerDeploymentsService.GetGameServerDeploymentCallback} callback Node-style callback called with the error, if any, and GameServerDeployment + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerDeploymentsService.prototype.getGameServerDeployment = function getGameServerDeployment(request, callback) { + return this.rpcCall(getGameServerDeployment, $root.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest, $root.google.cloud.gaming.v1beta.GameServerDeployment, request, callback); + }, "name", { value: "GetGameServerDeployment" }); + + /** + * Calls GetGameServerDeployment. + * @function getGameServerDeployment + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest} request GetGameServerDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|createGameServerDeployment}. + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @typedef CreateGameServerDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateGameServerDeployment. + * @function createGameServerDeployment + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest} request CreateGameServerDeploymentRequest message or plain object + * @param {google.cloud.gaming.v1beta.GameServerDeploymentsService.CreateGameServerDeploymentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerDeploymentsService.prototype.createGameServerDeployment = function createGameServerDeployment(request, callback) { + return this.rpcCall(createGameServerDeployment, $root.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateGameServerDeployment" }); + + /** + * Calls CreateGameServerDeployment. + * @function createGameServerDeployment + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest} request CreateGameServerDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|deleteGameServerDeployment}. + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @typedef DeleteGameServerDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteGameServerDeployment. + * @function deleteGameServerDeployment + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest} request DeleteGameServerDeploymentRequest message or plain object + * @param {google.cloud.gaming.v1beta.GameServerDeploymentsService.DeleteGameServerDeploymentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerDeploymentsService.prototype.deleteGameServerDeployment = function deleteGameServerDeployment(request, callback) { + return this.rpcCall(deleteGameServerDeployment, $root.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteGameServerDeployment" }); + + /** + * Calls DeleteGameServerDeployment. + * @function deleteGameServerDeployment + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest} request DeleteGameServerDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|updateGameServerDeployment}. + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @typedef UpdateGameServerDeploymentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateGameServerDeployment. + * @function updateGameServerDeployment + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest} request UpdateGameServerDeploymentRequest message or plain object + * @param {google.cloud.gaming.v1beta.GameServerDeploymentsService.UpdateGameServerDeploymentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerDeploymentsService.prototype.updateGameServerDeployment = function updateGameServerDeployment(request, callback) { + return this.rpcCall(updateGameServerDeployment, $root.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateGameServerDeployment" }); + + /** + * Calls UpdateGameServerDeployment. + * @function updateGameServerDeployment + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest} request UpdateGameServerDeploymentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|getGameServerDeploymentRollout}. + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @typedef GetGameServerDeploymentRolloutCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1beta.GameServerDeploymentRollout} [response] GameServerDeploymentRollout + */ + + /** + * Calls GetGameServerDeploymentRollout. + * @function getGameServerDeploymentRollout + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest} request GetGameServerDeploymentRolloutRequest message or plain object + * @param {google.cloud.gaming.v1beta.GameServerDeploymentsService.GetGameServerDeploymentRolloutCallback} callback Node-style callback called with the error, if any, and GameServerDeploymentRollout + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerDeploymentsService.prototype.getGameServerDeploymentRollout = function getGameServerDeploymentRollout(request, callback) { + return this.rpcCall(getGameServerDeploymentRollout, $root.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest, $root.google.cloud.gaming.v1beta.GameServerDeploymentRollout, request, callback); + }, "name", { value: "GetGameServerDeploymentRollout" }); + + /** + * Calls GetGameServerDeploymentRollout. + * @function getGameServerDeploymentRollout + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest} request GetGameServerDeploymentRolloutRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|updateGameServerDeploymentRollout}. + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @typedef UpdateGameServerDeploymentRolloutCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateGameServerDeploymentRollout. + * @function updateGameServerDeploymentRollout + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest} request UpdateGameServerDeploymentRolloutRequest message or plain object + * @param {google.cloud.gaming.v1beta.GameServerDeploymentsService.UpdateGameServerDeploymentRolloutCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerDeploymentsService.prototype.updateGameServerDeploymentRollout = function updateGameServerDeploymentRollout(request, callback) { + return this.rpcCall(updateGameServerDeploymentRollout, $root.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateGameServerDeploymentRollout" }); + + /** + * Calls UpdateGameServerDeploymentRollout. + * @function updateGameServerDeploymentRollout + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest} request UpdateGameServerDeploymentRolloutRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|previewGameServerDeploymentRollout}. + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @typedef PreviewGameServerDeploymentRolloutCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse} [response] PreviewGameServerDeploymentRolloutResponse + */ + + /** + * Calls PreviewGameServerDeploymentRollout. + * @function previewGameServerDeploymentRollout + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest} request PreviewGameServerDeploymentRolloutRequest message or plain object + * @param {google.cloud.gaming.v1beta.GameServerDeploymentsService.PreviewGameServerDeploymentRolloutCallback} callback Node-style callback called with the error, if any, and PreviewGameServerDeploymentRolloutResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerDeploymentsService.prototype.previewGameServerDeploymentRollout = function previewGameServerDeploymentRollout(request, callback) { + return this.rpcCall(previewGameServerDeploymentRollout, $root.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest, $root.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse, request, callback); + }, "name", { value: "PreviewGameServerDeploymentRollout" }); + + /** + * Calls PreviewGameServerDeploymentRollout. + * @function previewGameServerDeploymentRollout + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest} request PreviewGameServerDeploymentRolloutRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|fetchDeploymentState}. + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @typedef FetchDeploymentStateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1beta.FetchDeploymentStateResponse} [response] FetchDeploymentStateResponse + */ + + /** + * Calls FetchDeploymentState. + * @function fetchDeploymentState + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1beta.IFetchDeploymentStateRequest} request FetchDeploymentStateRequest message or plain object + * @param {google.cloud.gaming.v1beta.GameServerDeploymentsService.FetchDeploymentStateCallback} callback Node-style callback called with the error, if any, and FetchDeploymentStateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(GameServerDeploymentsService.prototype.fetchDeploymentState = function fetchDeploymentState(request, callback) { + return this.rpcCall(fetchDeploymentState, $root.google.cloud.gaming.v1beta.FetchDeploymentStateRequest, $root.google.cloud.gaming.v1beta.FetchDeploymentStateResponse, request, callback); + }, "name", { value: "FetchDeploymentState" }); + + /** + * Calls FetchDeploymentState. + * @function fetchDeploymentState + * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService + * @instance + * @param {google.cloud.gaming.v1beta.IFetchDeploymentStateRequest} request FetchDeploymentStateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return GameServerDeploymentsService; + })(); + + v1beta.ListRealmsRequest = (function() { + + /** + * Properties of a ListRealmsRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IListRealmsRequest + * @property {string|null} [parent] ListRealmsRequest parent + * @property {number|null} [pageSize] ListRealmsRequest pageSize + * @property {string|null} [pageToken] ListRealmsRequest pageToken + * @property {string|null} [filter] ListRealmsRequest filter + * @property {string|null} [orderBy] ListRealmsRequest orderBy + */ + + /** + * Constructs a new ListRealmsRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a ListRealmsRequest. + * @implements IListRealmsRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IListRealmsRequest=} [properties] Properties to set + */ + function ListRealmsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRealmsRequest parent. + * @member {string} parent + * @memberof google.cloud.gaming.v1beta.ListRealmsRequest + * @instance + */ + ListRealmsRequest.prototype.parent = ""; + + /** + * ListRealmsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.gaming.v1beta.ListRealmsRequest + * @instance + */ + ListRealmsRequest.prototype.pageSize = 0; + + /** + * ListRealmsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.gaming.v1beta.ListRealmsRequest + * @instance + */ + ListRealmsRequest.prototype.pageToken = ""; + + /** + * ListRealmsRequest filter. + * @member {string} filter + * @memberof google.cloud.gaming.v1beta.ListRealmsRequest + * @instance + */ + ListRealmsRequest.prototype.filter = ""; + + /** + * ListRealmsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.gaming.v1beta.ListRealmsRequest + * @instance + */ + ListRealmsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListRealmsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.ListRealmsRequest + * @static + * @param {google.cloud.gaming.v1beta.IListRealmsRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.ListRealmsRequest} ListRealmsRequest instance + */ + ListRealmsRequest.create = function create(properties) { + return new ListRealmsRequest(properties); + }; + + /** + * Encodes the specified ListRealmsRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.ListRealmsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.ListRealmsRequest + * @static + * @param {google.cloud.gaming.v1beta.IListRealmsRequest} message ListRealmsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRealmsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListRealmsRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.ListRealmsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.ListRealmsRequest + * @static + * @param {google.cloud.gaming.v1beta.IListRealmsRequest} message ListRealmsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRealmsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRealmsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.ListRealmsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.ListRealmsRequest} ListRealmsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRealmsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.ListRealmsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRealmsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.ListRealmsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.ListRealmsRequest} ListRealmsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRealmsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRealmsRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.ListRealmsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRealmsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListRealmsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.ListRealmsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.ListRealmsRequest} ListRealmsRequest + */ + ListRealmsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.ListRealmsRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.ListRealmsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListRealmsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.ListRealmsRequest + * @static + * @param {google.cloud.gaming.v1beta.ListRealmsRequest} message ListRealmsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRealmsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListRealmsRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.ListRealmsRequest + * @instance + * @returns {Object.} JSON object + */ + ListRealmsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRealmsRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.ListRealmsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRealmsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.ListRealmsRequest"; + }; + + return ListRealmsRequest; + })(); + + v1beta.ListRealmsResponse = (function() { + + /** + * Properties of a ListRealmsResponse. + * @memberof google.cloud.gaming.v1beta + * @interface IListRealmsResponse + * @property {Array.|null} [realms] ListRealmsResponse realms + * @property {string|null} [nextPageToken] ListRealmsResponse nextPageToken + * @property {Array.|null} [unreachable] ListRealmsResponse unreachable + */ + + /** + * Constructs a new ListRealmsResponse. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a ListRealmsResponse. + * @implements IListRealmsResponse + * @constructor + * @param {google.cloud.gaming.v1beta.IListRealmsResponse=} [properties] Properties to set + */ + function ListRealmsResponse(properties) { + this.realms = []; + this.unreachable = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListRealmsResponse realms. + * @member {Array.} realms + * @memberof google.cloud.gaming.v1beta.ListRealmsResponse + * @instance + */ + ListRealmsResponse.prototype.realms = $util.emptyArray; + + /** + * ListRealmsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.gaming.v1beta.ListRealmsResponse + * @instance + */ + ListRealmsResponse.prototype.nextPageToken = ""; + + /** + * ListRealmsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.gaming.v1beta.ListRealmsResponse + * @instance + */ + ListRealmsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListRealmsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.ListRealmsResponse + * @static + * @param {google.cloud.gaming.v1beta.IListRealmsResponse=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.ListRealmsResponse} ListRealmsResponse instance + */ + ListRealmsResponse.create = function create(properties) { + return new ListRealmsResponse(properties); + }; + + /** + * Encodes the specified ListRealmsResponse message. Does not implicitly {@link google.cloud.gaming.v1beta.ListRealmsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.ListRealmsResponse + * @static + * @param {google.cloud.gaming.v1beta.IListRealmsResponse} message ListRealmsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRealmsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.realms != null && message.realms.length) + for (var i = 0; i < message.realms.length; ++i) + $root.google.cloud.gaming.v1beta.Realm.encode(message.realms[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListRealmsResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.ListRealmsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.ListRealmsResponse + * @static + * @param {google.cloud.gaming.v1beta.IListRealmsResponse} message ListRealmsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRealmsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRealmsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.ListRealmsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.ListRealmsResponse} ListRealmsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRealmsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.ListRealmsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.realms && message.realms.length)) + message.realms = []; + message.realms.push($root.google.cloud.gaming.v1beta.Realm.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRealmsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.ListRealmsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.ListRealmsResponse} ListRealmsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRealmsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRealmsResponse message. + * @function verify + * @memberof google.cloud.gaming.v1beta.ListRealmsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRealmsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.realms != null && message.hasOwnProperty("realms")) { + if (!Array.isArray(message.realms)) + return "realms: array expected"; + for (var i = 0; i < message.realms.length; ++i) { + var error = $root.google.cloud.gaming.v1beta.Realm.verify(message.realms[i]); + if (error) + return "realms." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListRealmsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.ListRealmsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.ListRealmsResponse} ListRealmsResponse + */ + ListRealmsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.ListRealmsResponse) + return object; + var message = new $root.google.cloud.gaming.v1beta.ListRealmsResponse(); + if (object.realms) { + if (!Array.isArray(object.realms)) + throw TypeError(".google.cloud.gaming.v1beta.ListRealmsResponse.realms: array expected"); + message.realms = []; + for (var i = 0; i < object.realms.length; ++i) { + if (typeof object.realms[i] !== "object") + throw TypeError(".google.cloud.gaming.v1beta.ListRealmsResponse.realms: object expected"); + message.realms[i] = $root.google.cloud.gaming.v1beta.Realm.fromObject(object.realms[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.gaming.v1beta.ListRealmsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListRealmsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.ListRealmsResponse + * @static + * @param {google.cloud.gaming.v1beta.ListRealmsResponse} message ListRealmsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRealmsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.realms = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.realms && message.realms.length) { + object.realms = []; + for (var j = 0; j < message.realms.length; ++j) + object.realms[j] = $root.google.cloud.gaming.v1beta.Realm.toObject(message.realms[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListRealmsResponse to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.ListRealmsResponse + * @instance + * @returns {Object.} JSON object + */ + ListRealmsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRealmsResponse + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.ListRealmsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRealmsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.ListRealmsResponse"; + }; + + return ListRealmsResponse; + })(); + + v1beta.GetRealmRequest = (function() { + + /** + * Properties of a GetRealmRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IGetRealmRequest + * @property {string|null} [name] GetRealmRequest name + */ + + /** + * Constructs a new GetRealmRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a GetRealmRequest. + * @implements IGetRealmRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IGetRealmRequest=} [properties] Properties to set + */ + function GetRealmRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetRealmRequest name. + * @member {string} name + * @memberof google.cloud.gaming.v1beta.GetRealmRequest + * @instance + */ + GetRealmRequest.prototype.name = ""; + + /** + * Creates a new GetRealmRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.GetRealmRequest + * @static + * @param {google.cloud.gaming.v1beta.IGetRealmRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.GetRealmRequest} GetRealmRequest instance + */ + GetRealmRequest.create = function create(properties) { + return new GetRealmRequest(properties); + }; + + /** + * Encodes the specified GetRealmRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.GetRealmRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.GetRealmRequest + * @static + * @param {google.cloud.gaming.v1beta.IGetRealmRequest} message GetRealmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRealmRequest.encode = function encode(message, writer) { + 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 GetRealmRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.GetRealmRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.GetRealmRequest + * @static + * @param {google.cloud.gaming.v1beta.IGetRealmRequest} message GetRealmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRealmRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRealmRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.GetRealmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.GetRealmRequest} GetRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRealmRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.GetRealmRequest(); + 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 GetRealmRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.GetRealmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.GetRealmRequest} GetRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRealmRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRealmRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.GetRealmRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRealmRequest.verify = function verify(message) { + if (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 GetRealmRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.GetRealmRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.GetRealmRequest} GetRealmRequest + */ + GetRealmRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.GetRealmRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.GetRealmRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetRealmRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.GetRealmRequest + * @static + * @param {google.cloud.gaming.v1beta.GetRealmRequest} message GetRealmRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRealmRequest.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 GetRealmRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.GetRealmRequest + * @instance + * @returns {Object.} JSON object + */ + GetRealmRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetRealmRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.GetRealmRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetRealmRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.GetRealmRequest"; + }; + + return GetRealmRequest; + })(); + + v1beta.CreateRealmRequest = (function() { + + /** + * Properties of a CreateRealmRequest. + * @memberof google.cloud.gaming.v1beta + * @interface ICreateRealmRequest + * @property {string|null} [parent] CreateRealmRequest parent + * @property {string|null} [realmId] CreateRealmRequest realmId + * @property {google.cloud.gaming.v1beta.IRealm|null} [realm] CreateRealmRequest realm + */ + + /** + * Constructs a new CreateRealmRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a CreateRealmRequest. + * @implements ICreateRealmRequest + * @constructor + * @param {google.cloud.gaming.v1beta.ICreateRealmRequest=} [properties] Properties to set + */ + function CreateRealmRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateRealmRequest parent. + * @member {string} parent + * @memberof google.cloud.gaming.v1beta.CreateRealmRequest + * @instance + */ + CreateRealmRequest.prototype.parent = ""; + + /** + * CreateRealmRequest realmId. + * @member {string} realmId + * @memberof google.cloud.gaming.v1beta.CreateRealmRequest + * @instance + */ + CreateRealmRequest.prototype.realmId = ""; + + /** + * CreateRealmRequest realm. + * @member {google.cloud.gaming.v1beta.IRealm|null|undefined} realm + * @memberof google.cloud.gaming.v1beta.CreateRealmRequest + * @instance + */ + CreateRealmRequest.prototype.realm = null; + + /** + * Creates a new CreateRealmRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.CreateRealmRequest + * @static + * @param {google.cloud.gaming.v1beta.ICreateRealmRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.CreateRealmRequest} CreateRealmRequest instance + */ + CreateRealmRequest.create = function create(properties) { + return new CreateRealmRequest(properties); + }; + + /** + * Encodes the specified CreateRealmRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.CreateRealmRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.CreateRealmRequest + * @static + * @param {google.cloud.gaming.v1beta.ICreateRealmRequest} message CreateRealmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRealmRequest.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.realmId != null && Object.hasOwnProperty.call(message, "realmId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.realmId); + if (message.realm != null && Object.hasOwnProperty.call(message, "realm")) + $root.google.cloud.gaming.v1beta.Realm.encode(message.realm, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateRealmRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.CreateRealmRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.CreateRealmRequest + * @static + * @param {google.cloud.gaming.v1beta.ICreateRealmRequest} message CreateRealmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateRealmRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateRealmRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.CreateRealmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.CreateRealmRequest} CreateRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRealmRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.CreateRealmRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.realmId = reader.string(); + break; + } + case 3: { + message.realm = $root.google.cloud.gaming.v1beta.Realm.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateRealmRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.CreateRealmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.CreateRealmRequest} CreateRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateRealmRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateRealmRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.CreateRealmRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateRealmRequest.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.realmId != null && message.hasOwnProperty("realmId")) + if (!$util.isString(message.realmId)) + return "realmId: string expected"; + if (message.realm != null && message.hasOwnProperty("realm")) { + var error = $root.google.cloud.gaming.v1beta.Realm.verify(message.realm); + if (error) + return "realm." + error; + } + return null; + }; + + /** + * Creates a CreateRealmRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.CreateRealmRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.CreateRealmRequest} CreateRealmRequest + */ + CreateRealmRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.CreateRealmRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.CreateRealmRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.realmId != null) + message.realmId = String(object.realmId); + if (object.realm != null) { + if (typeof object.realm !== "object") + throw TypeError(".google.cloud.gaming.v1beta.CreateRealmRequest.realm: object expected"); + message.realm = $root.google.cloud.gaming.v1beta.Realm.fromObject(object.realm); + } + return message; + }; + + /** + * Creates a plain object from a CreateRealmRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.CreateRealmRequest + * @static + * @param {google.cloud.gaming.v1beta.CreateRealmRequest} message CreateRealmRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateRealmRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.realmId = ""; + object.realm = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.realmId != null && message.hasOwnProperty("realmId")) + object.realmId = message.realmId; + if (message.realm != null && message.hasOwnProperty("realm")) + object.realm = $root.google.cloud.gaming.v1beta.Realm.toObject(message.realm, options); + return object; + }; + + /** + * Converts this CreateRealmRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.CreateRealmRequest + * @instance + * @returns {Object.} JSON object + */ + CreateRealmRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateRealmRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.CreateRealmRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateRealmRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.CreateRealmRequest"; + }; + + return CreateRealmRequest; + })(); + + v1beta.DeleteRealmRequest = (function() { + + /** + * Properties of a DeleteRealmRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IDeleteRealmRequest + * @property {string|null} [name] DeleteRealmRequest name + */ + + /** + * Constructs a new DeleteRealmRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a DeleteRealmRequest. + * @implements IDeleteRealmRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IDeleteRealmRequest=} [properties] Properties to set + */ + function DeleteRealmRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteRealmRequest name. + * @member {string} name + * @memberof google.cloud.gaming.v1beta.DeleteRealmRequest + * @instance + */ + DeleteRealmRequest.prototype.name = ""; + + /** + * Creates a new DeleteRealmRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.DeleteRealmRequest + * @static + * @param {google.cloud.gaming.v1beta.IDeleteRealmRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.DeleteRealmRequest} DeleteRealmRequest instance + */ + DeleteRealmRequest.create = function create(properties) { + return new DeleteRealmRequest(properties); + }; + + /** + * Encodes the specified DeleteRealmRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.DeleteRealmRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.DeleteRealmRequest + * @static + * @param {google.cloud.gaming.v1beta.IDeleteRealmRequest} message DeleteRealmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRealmRequest.encode = function encode(message, writer) { + 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 DeleteRealmRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.DeleteRealmRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.DeleteRealmRequest + * @static + * @param {google.cloud.gaming.v1beta.IDeleteRealmRequest} message DeleteRealmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteRealmRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteRealmRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.DeleteRealmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.DeleteRealmRequest} DeleteRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRealmRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.DeleteRealmRequest(); + 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 DeleteRealmRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.DeleteRealmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.DeleteRealmRequest} DeleteRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteRealmRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteRealmRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.DeleteRealmRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteRealmRequest.verify = function verify(message) { + if (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 DeleteRealmRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.DeleteRealmRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.DeleteRealmRequest} DeleteRealmRequest + */ + DeleteRealmRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.DeleteRealmRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.DeleteRealmRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteRealmRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.DeleteRealmRequest + * @static + * @param {google.cloud.gaming.v1beta.DeleteRealmRequest} message DeleteRealmRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteRealmRequest.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 DeleteRealmRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.DeleteRealmRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteRealmRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteRealmRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.DeleteRealmRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteRealmRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.DeleteRealmRequest"; + }; + + return DeleteRealmRequest; + })(); + + v1beta.UpdateRealmRequest = (function() { + + /** + * Properties of an UpdateRealmRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IUpdateRealmRequest + * @property {google.cloud.gaming.v1beta.IRealm|null} [realm] UpdateRealmRequest realm + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateRealmRequest updateMask + */ + + /** + * Constructs a new UpdateRealmRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents an UpdateRealmRequest. + * @implements IUpdateRealmRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IUpdateRealmRequest=} [properties] Properties to set + */ + function UpdateRealmRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateRealmRequest realm. + * @member {google.cloud.gaming.v1beta.IRealm|null|undefined} realm + * @memberof google.cloud.gaming.v1beta.UpdateRealmRequest + * @instance + */ + UpdateRealmRequest.prototype.realm = null; + + /** + * UpdateRealmRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.gaming.v1beta.UpdateRealmRequest + * @instance + */ + UpdateRealmRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateRealmRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.UpdateRealmRequest + * @static + * @param {google.cloud.gaming.v1beta.IUpdateRealmRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.UpdateRealmRequest} UpdateRealmRequest instance + */ + UpdateRealmRequest.create = function create(properties) { + return new UpdateRealmRequest(properties); + }; + + /** + * Encodes the specified UpdateRealmRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.UpdateRealmRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.UpdateRealmRequest + * @static + * @param {google.cloud.gaming.v1beta.IUpdateRealmRequest} message UpdateRealmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRealmRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.realm != null && Object.hasOwnProperty.call(message, "realm")) + $root.google.cloud.gaming.v1beta.Realm.encode(message.realm, 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 UpdateRealmRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.UpdateRealmRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.UpdateRealmRequest + * @static + * @param {google.cloud.gaming.v1beta.IUpdateRealmRequest} message UpdateRealmRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateRealmRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateRealmRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.UpdateRealmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.UpdateRealmRequest} UpdateRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRealmRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.UpdateRealmRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.realm = $root.google.cloud.gaming.v1beta.Realm.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 UpdateRealmRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.UpdateRealmRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.UpdateRealmRequest} UpdateRealmRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateRealmRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateRealmRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.UpdateRealmRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateRealmRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.realm != null && message.hasOwnProperty("realm")) { + var error = $root.google.cloud.gaming.v1beta.Realm.verify(message.realm); + if (error) + return "realm." + 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 UpdateRealmRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.UpdateRealmRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.UpdateRealmRequest} UpdateRealmRequest + */ + UpdateRealmRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.UpdateRealmRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.UpdateRealmRequest(); + if (object.realm != null) { + if (typeof object.realm !== "object") + throw TypeError(".google.cloud.gaming.v1beta.UpdateRealmRequest.realm: object expected"); + message.realm = $root.google.cloud.gaming.v1beta.Realm.fromObject(object.realm); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.gaming.v1beta.UpdateRealmRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateRealmRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.UpdateRealmRequest + * @static + * @param {google.cloud.gaming.v1beta.UpdateRealmRequest} message UpdateRealmRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateRealmRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.realm = null; + object.updateMask = null; + } + if (message.realm != null && message.hasOwnProperty("realm")) + object.realm = $root.google.cloud.gaming.v1beta.Realm.toObject(message.realm, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateRealmRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.UpdateRealmRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateRealmRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateRealmRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.UpdateRealmRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateRealmRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.UpdateRealmRequest"; + }; + + return UpdateRealmRequest; + })(); + + v1beta.PreviewRealmUpdateRequest = (function() { + + /** + * Properties of a PreviewRealmUpdateRequest. + * @memberof google.cloud.gaming.v1beta + * @interface IPreviewRealmUpdateRequest + * @property {google.cloud.gaming.v1beta.IRealm|null} [realm] PreviewRealmUpdateRequest realm + * @property {google.protobuf.IFieldMask|null} [updateMask] PreviewRealmUpdateRequest updateMask + * @property {google.protobuf.ITimestamp|null} [previewTime] PreviewRealmUpdateRequest previewTime + */ + + /** + * Constructs a new PreviewRealmUpdateRequest. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a PreviewRealmUpdateRequest. + * @implements IPreviewRealmUpdateRequest + * @constructor + * @param {google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest=} [properties] Properties to set + */ + function PreviewRealmUpdateRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreviewRealmUpdateRequest realm. + * @member {google.cloud.gaming.v1beta.IRealm|null|undefined} realm + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateRequest + * @instance + */ + PreviewRealmUpdateRequest.prototype.realm = null; + + /** + * PreviewRealmUpdateRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateRequest + * @instance + */ + PreviewRealmUpdateRequest.prototype.updateMask = null; + + /** + * PreviewRealmUpdateRequest previewTime. + * @member {google.protobuf.ITimestamp|null|undefined} previewTime + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateRequest + * @instance + */ + PreviewRealmUpdateRequest.prototype.previewTime = null; + + /** + * Creates a new PreviewRealmUpdateRequest instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateRequest + * @static + * @param {google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.PreviewRealmUpdateRequest} PreviewRealmUpdateRequest instance + */ + PreviewRealmUpdateRequest.create = function create(properties) { + return new PreviewRealmUpdateRequest(properties); + }; + + /** + * Encodes the specified PreviewRealmUpdateRequest message. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewRealmUpdateRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateRequest + * @static + * @param {google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest} message PreviewRealmUpdateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewRealmUpdateRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.realm != null && Object.hasOwnProperty.call(message, "realm")) + $root.google.cloud.gaming.v1beta.Realm.encode(message.realm, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.previewTime != null && Object.hasOwnProperty.call(message, "previewTime")) + $root.google.protobuf.Timestamp.encode(message.previewTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreviewRealmUpdateRequest message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewRealmUpdateRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateRequest + * @static + * @param {google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest} message PreviewRealmUpdateRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewRealmUpdateRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreviewRealmUpdateRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.PreviewRealmUpdateRequest} PreviewRealmUpdateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewRealmUpdateRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.realm = $root.google.cloud.gaming.v1beta.Realm.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.previewTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreviewRealmUpdateRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.PreviewRealmUpdateRequest} PreviewRealmUpdateRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewRealmUpdateRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreviewRealmUpdateRequest message. + * @function verify + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreviewRealmUpdateRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.realm != null && message.hasOwnProperty("realm")) { + var error = $root.google.cloud.gaming.v1beta.Realm.verify(message.realm); + if (error) + return "realm." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.previewTime != null && message.hasOwnProperty("previewTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.previewTime); + if (error) + return "previewTime." + error; + } + return null; + }; + + /** + * Creates a PreviewRealmUpdateRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.PreviewRealmUpdateRequest} PreviewRealmUpdateRequest + */ + PreviewRealmUpdateRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest) + return object; + var message = new $root.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest(); + if (object.realm != null) { + if (typeof object.realm !== "object") + throw TypeError(".google.cloud.gaming.v1beta.PreviewRealmUpdateRequest.realm: object expected"); + message.realm = $root.google.cloud.gaming.v1beta.Realm.fromObject(object.realm); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.gaming.v1beta.PreviewRealmUpdateRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.previewTime != null) { + if (typeof object.previewTime !== "object") + throw TypeError(".google.cloud.gaming.v1beta.PreviewRealmUpdateRequest.previewTime: object expected"); + message.previewTime = $root.google.protobuf.Timestamp.fromObject(object.previewTime); + } + return message; + }; + + /** + * Creates a plain object from a PreviewRealmUpdateRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateRequest + * @static + * @param {google.cloud.gaming.v1beta.PreviewRealmUpdateRequest} message PreviewRealmUpdateRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreviewRealmUpdateRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.realm = null; + object.updateMask = null; + object.previewTime = null; + } + if (message.realm != null && message.hasOwnProperty("realm")) + object.realm = $root.google.cloud.gaming.v1beta.Realm.toObject(message.realm, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.previewTime != null && message.hasOwnProperty("previewTime")) + object.previewTime = $root.google.protobuf.Timestamp.toObject(message.previewTime, options); + return object; + }; + + /** + * Converts this PreviewRealmUpdateRequest to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateRequest + * @instance + * @returns {Object.} JSON object + */ + PreviewRealmUpdateRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PreviewRealmUpdateRequest + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PreviewRealmUpdateRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.PreviewRealmUpdateRequest"; + }; + + return PreviewRealmUpdateRequest; + })(); + + v1beta.PreviewRealmUpdateResponse = (function() { + + /** + * Properties of a PreviewRealmUpdateResponse. + * @memberof google.cloud.gaming.v1beta + * @interface IPreviewRealmUpdateResponse + * @property {string|null} [etag] PreviewRealmUpdateResponse etag + * @property {google.cloud.gaming.v1beta.ITargetState|null} [targetState] PreviewRealmUpdateResponse targetState + */ + + /** + * Constructs a new PreviewRealmUpdateResponse. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a PreviewRealmUpdateResponse. + * @implements IPreviewRealmUpdateResponse + * @constructor + * @param {google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse=} [properties] Properties to set + */ + function PreviewRealmUpdateResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PreviewRealmUpdateResponse etag. + * @member {string} etag + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateResponse + * @instance + */ + PreviewRealmUpdateResponse.prototype.etag = ""; + + /** + * PreviewRealmUpdateResponse targetState. + * @member {google.cloud.gaming.v1beta.ITargetState|null|undefined} targetState + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateResponse + * @instance + */ + PreviewRealmUpdateResponse.prototype.targetState = null; + + /** + * Creates a new PreviewRealmUpdateResponse instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateResponse + * @static + * @param {google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.PreviewRealmUpdateResponse} PreviewRealmUpdateResponse instance + */ + PreviewRealmUpdateResponse.create = function create(properties) { + return new PreviewRealmUpdateResponse(properties); + }; + + /** + * Encodes the specified PreviewRealmUpdateResponse message. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewRealmUpdateResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateResponse + * @static + * @param {google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse} message PreviewRealmUpdateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewRealmUpdateResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.targetState != null && Object.hasOwnProperty.call(message, "targetState")) + $root.google.cloud.gaming.v1beta.TargetState.encode(message.targetState, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PreviewRealmUpdateResponse message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.PreviewRealmUpdateResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateResponse + * @static + * @param {google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse} message PreviewRealmUpdateResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PreviewRealmUpdateResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PreviewRealmUpdateResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.PreviewRealmUpdateResponse} PreviewRealmUpdateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewRealmUpdateResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.PreviewRealmUpdateResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.etag = reader.string(); + break; + } + case 3: { + message.targetState = $root.google.cloud.gaming.v1beta.TargetState.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PreviewRealmUpdateResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.PreviewRealmUpdateResponse} PreviewRealmUpdateResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PreviewRealmUpdateResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PreviewRealmUpdateResponse message. + * @function verify + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PreviewRealmUpdateResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.targetState != null && message.hasOwnProperty("targetState")) { + var error = $root.google.cloud.gaming.v1beta.TargetState.verify(message.targetState); + if (error) + return "targetState." + error; + } + return null; + }; + + /** + * Creates a PreviewRealmUpdateResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.PreviewRealmUpdateResponse} PreviewRealmUpdateResponse + */ + PreviewRealmUpdateResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.PreviewRealmUpdateResponse) + return object; + var message = new $root.google.cloud.gaming.v1beta.PreviewRealmUpdateResponse(); + if (object.etag != null) + message.etag = String(object.etag); + if (object.targetState != null) { + if (typeof object.targetState !== "object") + throw TypeError(".google.cloud.gaming.v1beta.PreviewRealmUpdateResponse.targetState: object expected"); + message.targetState = $root.google.cloud.gaming.v1beta.TargetState.fromObject(object.targetState); + } + return message; + }; + + /** + * Creates a plain object from a PreviewRealmUpdateResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateResponse + * @static + * @param {google.cloud.gaming.v1beta.PreviewRealmUpdateResponse} message PreviewRealmUpdateResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PreviewRealmUpdateResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.etag = ""; + object.targetState = null; + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.targetState != null && message.hasOwnProperty("targetState")) + object.targetState = $root.google.cloud.gaming.v1beta.TargetState.toObject(message.targetState, options); + return object; + }; + + /** + * Converts this PreviewRealmUpdateResponse to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateResponse + * @instance + * @returns {Object.} JSON object + */ + PreviewRealmUpdateResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PreviewRealmUpdateResponse + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.PreviewRealmUpdateResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PreviewRealmUpdateResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.PreviewRealmUpdateResponse"; + }; + + return PreviewRealmUpdateResponse; + })(); + + v1beta.Realm = (function() { + + /** + * Properties of a Realm. + * @memberof google.cloud.gaming.v1beta + * @interface IRealm + * @property {string|null} [name] Realm name + * @property {google.protobuf.ITimestamp|null} [createTime] Realm createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Realm updateTime + * @property {Object.|null} [labels] Realm labels + * @property {string|null} [timeZone] Realm timeZone + * @property {string|null} [etag] Realm etag + * @property {string|null} [description] Realm description + */ + + /** + * Constructs a new Realm. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a Realm. + * @implements IRealm + * @constructor + * @param {google.cloud.gaming.v1beta.IRealm=} [properties] Properties to set + */ + function Realm(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]]; + } + + /** + * Realm name. + * @member {string} name + * @memberof google.cloud.gaming.v1beta.Realm + * @instance + */ + Realm.prototype.name = ""; + + /** + * Realm createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.gaming.v1beta.Realm + * @instance + */ + Realm.prototype.createTime = null; + + /** + * Realm updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.gaming.v1beta.Realm + * @instance + */ + Realm.prototype.updateTime = null; + + /** + * Realm labels. + * @member {Object.} labels + * @memberof google.cloud.gaming.v1beta.Realm + * @instance + */ + Realm.prototype.labels = $util.emptyObject; + + /** + * Realm timeZone. + * @member {string} timeZone + * @memberof google.cloud.gaming.v1beta.Realm + * @instance + */ + Realm.prototype.timeZone = ""; + + /** + * Realm etag. + * @member {string} etag + * @memberof google.cloud.gaming.v1beta.Realm + * @instance + */ + Realm.prototype.etag = ""; + + /** + * Realm description. + * @member {string} description + * @memberof google.cloud.gaming.v1beta.Realm + * @instance + */ + Realm.prototype.description = ""; + + /** + * Creates a new Realm instance using the specified properties. + * @function create + * @memberof google.cloud.gaming.v1beta.Realm + * @static + * @param {google.cloud.gaming.v1beta.IRealm=} [properties] Properties to set + * @returns {google.cloud.gaming.v1beta.Realm} Realm instance + */ + Realm.create = function create(properties) { + return new Realm(properties); + }; + + /** + * Encodes the specified Realm message. Does not implicitly {@link google.cloud.gaming.v1beta.Realm.verify|verify} messages. + * @function encode + * @memberof google.cloud.gaming.v1beta.Realm + * @static + * @param {google.cloud.gaming.v1beta.IRealm} message Realm message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Realm.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.timeZone); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.description); + return writer; + }; + + /** + * Encodes the specified Realm message, length delimited. Does not implicitly {@link google.cloud.gaming.v1beta.Realm.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.gaming.v1beta.Realm + * @static + * @param {google.cloud.gaming.v1beta.IRealm} message Realm message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Realm.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Realm message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.gaming.v1beta.Realm + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.gaming.v1beta.Realm} Realm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Realm.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.gaming.v1beta.Realm(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.timeZone = reader.string(); + break; + } + case 7: { + message.etag = reader.string(); + break; + } + case 8: { + message.description = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Realm message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.gaming.v1beta.Realm + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.gaming.v1beta.Realm} Realm + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Realm.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Realm message. + * @function verify + * @memberof google.cloud.gaming.v1beta.Realm + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Realm.verify = function verify(message) { + if (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.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a Realm message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.gaming.v1beta.Realm + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.gaming.v1beta.Realm} Realm + */ + Realm.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.gaming.v1beta.Realm) + return object; + var message = new $root.google.cloud.gaming.v1beta.Realm(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.gaming.v1beta.Realm.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.gaming.v1beta.Realm.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.gaming.v1beta.Realm.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.etag != null) + message.etag = String(object.etag); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a Realm message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.gaming.v1beta.Realm + * @static + * @param {google.cloud.gaming.v1beta.Realm} message Realm + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Realm.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.timeZone = ""; + object.etag = ""; + object.description = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this Realm to JSON. + * @function toJSON + * @memberof google.cloud.gaming.v1beta.Realm + * @instance + * @returns {Object.} JSON object + */ + Realm.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Realm + * @function getTypeUrl + * @memberof google.cloud.gaming.v1beta.Realm + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Realm.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.gaming.v1beta.Realm"; + }; + + return Realm; + })(); + + v1beta.RealmsService = (function() { + + /** + * Constructs a new RealmsService service. + * @memberof google.cloud.gaming.v1beta + * @classdesc Represents a RealmsService + * @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 RealmsService(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (RealmsService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = RealmsService; + + /** + * Creates new RealmsService service using the specified rpc implementation. + * @function create + * @memberof google.cloud.gaming.v1beta.RealmsService + * @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 {RealmsService} RPC service. Useful where requests and/or responses are streamed. + */ + RealmsService.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService|listRealms}. + * @memberof google.cloud.gaming.v1beta.RealmsService + * @typedef ListRealmsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1beta.ListRealmsResponse} [response] ListRealmsResponse + */ + + /** + * Calls ListRealms. + * @function listRealms + * @memberof google.cloud.gaming.v1beta.RealmsService + * @instance + * @param {google.cloud.gaming.v1beta.IListRealmsRequest} request ListRealmsRequest message or plain object + * @param {google.cloud.gaming.v1beta.RealmsService.ListRealmsCallback} callback Node-style callback called with the error, if any, and ListRealmsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RealmsService.prototype.listRealms = function listRealms(request, callback) { + return this.rpcCall(listRealms, $root.google.cloud.gaming.v1beta.ListRealmsRequest, $root.google.cloud.gaming.v1beta.ListRealmsResponse, request, callback); + }, "name", { value: "ListRealms" }); + + /** + * Calls ListRealms. + * @function listRealms + * @memberof google.cloud.gaming.v1beta.RealmsService + * @instance + * @param {google.cloud.gaming.v1beta.IListRealmsRequest} request ListRealmsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService|getRealm}. + * @memberof google.cloud.gaming.v1beta.RealmsService + * @typedef GetRealmCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1beta.Realm} [response] Realm + */ + + /** + * Calls GetRealm. + * @function getRealm + * @memberof google.cloud.gaming.v1beta.RealmsService + * @instance + * @param {google.cloud.gaming.v1beta.IGetRealmRequest} request GetRealmRequest message or plain object + * @param {google.cloud.gaming.v1beta.RealmsService.GetRealmCallback} callback Node-style callback called with the error, if any, and Realm + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RealmsService.prototype.getRealm = function getRealm(request, callback) { + return this.rpcCall(getRealm, $root.google.cloud.gaming.v1beta.GetRealmRequest, $root.google.cloud.gaming.v1beta.Realm, request, callback); + }, "name", { value: "GetRealm" }); + + /** + * Calls GetRealm. + * @function getRealm + * @memberof google.cloud.gaming.v1beta.RealmsService + * @instance + * @param {google.cloud.gaming.v1beta.IGetRealmRequest} request GetRealmRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService|createRealm}. + * @memberof google.cloud.gaming.v1beta.RealmsService + * @typedef CreateRealmCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateRealm. + * @function createRealm + * @memberof google.cloud.gaming.v1beta.RealmsService + * @instance + * @param {google.cloud.gaming.v1beta.ICreateRealmRequest} request CreateRealmRequest message or plain object + * @param {google.cloud.gaming.v1beta.RealmsService.CreateRealmCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RealmsService.prototype.createRealm = function createRealm(request, callback) { + return this.rpcCall(createRealm, $root.google.cloud.gaming.v1beta.CreateRealmRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateRealm" }); + + /** + * Calls CreateRealm. + * @function createRealm + * @memberof google.cloud.gaming.v1beta.RealmsService + * @instance + * @param {google.cloud.gaming.v1beta.ICreateRealmRequest} request CreateRealmRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService|deleteRealm}. + * @memberof google.cloud.gaming.v1beta.RealmsService + * @typedef DeleteRealmCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteRealm. + * @function deleteRealm + * @memberof google.cloud.gaming.v1beta.RealmsService + * @instance + * @param {google.cloud.gaming.v1beta.IDeleteRealmRequest} request DeleteRealmRequest message or plain object + * @param {google.cloud.gaming.v1beta.RealmsService.DeleteRealmCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RealmsService.prototype.deleteRealm = function deleteRealm(request, callback) { + return this.rpcCall(deleteRealm, $root.google.cloud.gaming.v1beta.DeleteRealmRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteRealm" }); + + /** + * Calls DeleteRealm. + * @function deleteRealm + * @memberof google.cloud.gaming.v1beta.RealmsService + * @instance + * @param {google.cloud.gaming.v1beta.IDeleteRealmRequest} request DeleteRealmRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService|updateRealm}. + * @memberof google.cloud.gaming.v1beta.RealmsService + * @typedef UpdateRealmCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateRealm. + * @function updateRealm + * @memberof google.cloud.gaming.v1beta.RealmsService + * @instance + * @param {google.cloud.gaming.v1beta.IUpdateRealmRequest} request UpdateRealmRequest message or plain object + * @param {google.cloud.gaming.v1beta.RealmsService.UpdateRealmCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RealmsService.prototype.updateRealm = function updateRealm(request, callback) { + return this.rpcCall(updateRealm, $root.google.cloud.gaming.v1beta.UpdateRealmRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateRealm" }); + + /** + * Calls UpdateRealm. + * @function updateRealm + * @memberof google.cloud.gaming.v1beta.RealmsService + * @instance + * @param {google.cloud.gaming.v1beta.IUpdateRealmRequest} request UpdateRealmRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService|previewRealmUpdate}. + * @memberof google.cloud.gaming.v1beta.RealmsService + * @typedef PreviewRealmUpdateCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.gaming.v1beta.PreviewRealmUpdateResponse} [response] PreviewRealmUpdateResponse + */ + + /** + * Calls PreviewRealmUpdate. + * @function previewRealmUpdate + * @memberof google.cloud.gaming.v1beta.RealmsService + * @instance + * @param {google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest} request PreviewRealmUpdateRequest message or plain object + * @param {google.cloud.gaming.v1beta.RealmsService.PreviewRealmUpdateCallback} callback Node-style callback called with the error, if any, and PreviewRealmUpdateResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(RealmsService.prototype.previewRealmUpdate = function previewRealmUpdate(request, callback) { + return this.rpcCall(previewRealmUpdate, $root.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest, $root.google.cloud.gaming.v1beta.PreviewRealmUpdateResponse, request, callback); + }, "name", { value: "PreviewRealmUpdate" }); + + /** + * Calls PreviewRealmUpdate. + * @function previewRealmUpdate + * @memberof google.cloud.gaming.v1beta.RealmsService + * @instance + * @param {google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest} request PreviewRealmUpdateRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return RealmsService; + })(); + + return v1beta; + })(); + + return gaming; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + return values; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceDescriptor(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + if (!(message.pattern && message.pattern.length)) + message.pattern = []; + message.pattern.push(reader.string()); + break; + } + case 3: { + message.nameField = reader.string(); + break; + } + case 4: { + message.history = reader.int32(); + break; + } + case 5: { + message.plural = reader.string(); + break; + } + case 6: { + message.singular = reader.string(); + break; + } + case 10: { + if (!(message.style && message.style.length)) + message.style = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.style.push(reader.int32()); + } else + message.style.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceDescriptor message. + * @function verify + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceDescriptor.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.pattern != null && message.hasOwnProperty("pattern")) { + if (!Array.isArray(message.pattern)) + return "pattern: array expected"; + for (var i = 0; i < message.pattern.length; ++i) + if (!$util.isString(message.pattern[i])) + return "pattern: string[] expected"; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + if (!$util.isString(message.nameField)) + return "nameField: string expected"; + if (message.history != null && message.hasOwnProperty("history")) + switch (message.history) { + default: + return "history: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.plural != null && message.hasOwnProperty("plural")) + if (!$util.isString(message.plural)) + return "plural: string expected"; + if (message.singular != null && message.hasOwnProperty("singular")) + if (!$util.isString(message.singular)) + return "singular: string expected"; + if (message.style != null && message.hasOwnProperty("style")) { + if (!Array.isArray(message.style)) + return "style: array expected"; + for (var i = 0; i < message.style.length; ++i) + switch (message.style[i]) { + default: + return "style: enum value[] expected"; + case 0: + case 1: + break; + } + } + return null; + }; + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + */ + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) + return object; + var message = new $root.google.api.ResourceDescriptor(); + if (object.type != null) + message.type = String(object.type); + if (object.pattern) { + if (!Array.isArray(object.pattern)) + throw TypeError(".google.api.ResourceDescriptor.pattern: array expected"); + message.pattern = []; + for (var i = 0; i < object.pattern.length; ++i) + message.pattern[i] = String(object.pattern[i]); + } + if (object.nameField != null) + message.nameField = String(object.nameField); + switch (object.history) { + default: + if (typeof object.history === "number") { + message.history = object.history; + break; + } + break; + case "HISTORY_UNSPECIFIED": + case 0: + message.history = 0; + break; + case "ORIGINALLY_SINGLE_PATTERN": + case 1: + message.history = 1; + break; + case "FUTURE_MULTI_PATTERN": + case 2: + message.history = 2; + break; + } + if (object.plural != null) + message.plural = String(object.plural); + if (object.singular != null) + message.singular = String(object.singular); + if (object.style) { + if (!Array.isArray(object.style)) + throw TypeError(".google.api.ResourceDescriptor.style: array expected"); + message.style = []; + for (var i = 0; i < object.style.length; ++i) + switch (object.style[i]) { + default: + if (typeof object.style[i] === "number") { + message.style[i] = object.style[i]; + break; + } + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceDescriptor.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.pattern = []; + object.style = []; + } + if (options.defaults) { + object.type = ""; + object.nameField = ""; + object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; + object.plural = ""; + object.singular = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.pattern && message.pattern.length) { + object.pattern = []; + for (var j = 0; j < message.pattern.length; ++j) + object.pattern[j] = message.pattern[j]; + } + if (message.nameField != null && message.hasOwnProperty("nameField")) + object.nameField = message.nameField; + if (message.history != null && message.hasOwnProperty("history")) + object.history = options.enums === String ? $root.google.api.ResourceDescriptor.History[message.history] === undefined ? message.history : $root.google.api.ResourceDescriptor.History[message.history] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + if (message.style && message.style.length) { + object.style = []; + for (var j = 0; j < message.style.length; ++j) + object.style[j] = options.enums === String ? $root.google.api.ResourceDescriptor.Style[message.style[j]] === undefined ? message.style[j] : $root.google.api.ResourceDescriptor.Style[message.style[j]] : message.style[j]; + } + return object; + }; + + /** + * Converts this ResourceDescriptor to JSON. + * @function toJSON + * @memberof google.api.ResourceDescriptor + * @instance + * @returns {Object.} JSON object + */ + ResourceDescriptor.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceDescriptor + * @function getTypeUrl + * @memberof google.api.ResourceDescriptor + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceDescriptor.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceDescriptor"; + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {number} + * @property {number} HISTORY_UNSPECIFIED=0 HISTORY_UNSPECIFIED value + * @property {number} ORIGINALLY_SINGLE_PATTERN=1 ORIGINALLY_SINGLE_PATTERN value + * @property {number} FUTURE_MULTI_PATTERN=2 FUTURE_MULTI_PATTERN value + */ + ResourceDescriptor.History = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HISTORY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ORIGINALLY_SINGLE_PATTERN"] = 1; + values[valuesById[2] = "FUTURE_MULTI_PATTERN"] = 2; + return values; + })(); + + /** + * Style enum. + * @name google.api.ResourceDescriptor.Style + * @enum {number} + * @property {number} STYLE_UNSPECIFIED=0 STYLE_UNSPECIFIED value + * @property {number} DECLARATIVE_FRIENDLY=1 DECLARATIVE_FRIENDLY value + */ + ResourceDescriptor.Style = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STYLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DECLARATIVE_FRIENDLY"] = 1; + return values; + })(); + + return ResourceDescriptor; + })(); + + api.ResourceReference = (function() { + + /** + * Properties of a ResourceReference. + * @memberof google.api + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType + */ + + /** + * Constructs a new ResourceReference. + * @memberof google.api + * @classdesc Represents a ResourceReference. + * @implements IResourceReference + * @constructor + * @param {google.api.IResourceReference=} [properties] Properties to set + */ + function ResourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.type = ""; + + /** + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference + * @instance + */ + ResourceReference.prototype.childType = ""; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @function create + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance + */ + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); + }; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); + return writer; + }; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.ResourceReference(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.ResourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.ResourceReference} ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceReference message. + * @function verify + * @memberof google.api.ResourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceReference.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.childType != null && message.hasOwnProperty("childType")) + if (!$util.isString(message.childType)) + return "childType: string expected"; + return null; + }; + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.ResourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.api.ResourceReference} ResourceReference + */ + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) + return object; + var message = new $root.google.api.ResourceReference(); + if (object.type != null) + message.type = String(object.type); + if (object.childType != null) + message.childType = String(object.childType); + return message; + }; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.ResourceReference + * @static + * @param {google.api.ResourceReference} message ResourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + object.childType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.childType != null && message.hasOwnProperty("childType")) + object.childType = message.childType; + return object; + }; + + /** + * Converts this ResourceReference to JSON. + * @function toJSON + * @memberof google.api.ResourceReference + * @instance + * @returns {Object.} JSON object + */ + ResourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceReference + * @function getTypeUrl + * @memberof google.api.ResourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.ResourceReference"; + }; + + return ResourceReference; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); + return writer; + }; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Http message from the specified reader or buffer. + * @function decode + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.Http(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + case 2: { + message.fullyDecodeReservedExpansion = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.Http + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.Http} Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Http.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Http message. + * @function verify + * @memberof google.api.Http + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Http.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.rules != null && message.hasOwnProperty("rules")) { + if (!Array.isArray(message.rules)) + return "rules: array expected"; + for (var i = 0; i < message.rules.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.rules[i]); + if (error) + return "rules." + error; + } + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (typeof message.fullyDecodeReservedExpansion !== "boolean") + return "fullyDecodeReservedExpansion: boolean expected"; + return null; + }; + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.Http + * @static + * @param {Object.} object Plain object + * @returns {google.api.Http} Http + */ + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) + return object; + var message = new $root.google.api.Http(); + if (object.rules) { + if (!Array.isArray(object.rules)) + throw TypeError(".google.api.Http.rules: array expected"); + message.rules = []; + for (var i = 0; i < object.rules.length; ++i) { + if (typeof object.rules[i] !== "object") + throw TypeError(".google.api.Http.rules: object expected"); + message.rules[i] = $root.google.api.HttpRule.fromObject(object.rules[i]); + } + } + if (object.fullyDecodeReservedExpansion != null) + message.fullyDecodeReservedExpansion = Boolean(object.fullyDecodeReservedExpansion); + return message; + }; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.Http + * @static + * @param {google.api.Http} message Http + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Http.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rules = []; + if (options.defaults) + object.fullyDecodeReservedExpansion = false; + if (message.rules && message.rules.length) { + object.rules = []; + for (var j = 0; j < message.rules.length; ++j) + object.rules[j] = $root.google.api.HttpRule.toObject(message.rules[j], options); + } + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; + return object; + }; + + /** + * Converts this Http to JSON. + * @function toJSON + * @memberof google.api.Http + * @instance + * @returns {Object.} JSON object + */ + Http.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Http + * @function getTypeUrl + * @memberof google.api.Http + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Http.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.Http"; + }; + + return Http; + })(); + + api.HttpRule = (function() { + + /** + * Properties of a HttpRule. + * @memberof google.api + * @interface IHttpRule + * @property {string|null} [selector] HttpRule selector + * @property {string|null} [get] HttpRule get + * @property {string|null} [put] HttpRule put + * @property {string|null} [post] HttpRule post + * @property {string|null} ["delete"] HttpRule delete + * @property {string|null} [patch] HttpRule patch + * @property {google.api.ICustomHttpPattern|null} [custom] HttpRule custom + * @property {string|null} [body] HttpRule body + * @property {string|null} [responseBody] HttpRule responseBody + * @property {Array.|null} [additionalBindings] HttpRule additionalBindings + */ + + /** + * Constructs a new HttpRule. + * @memberof google.api + * @classdesc Represents a HttpRule. + * @implements IHttpRule + * @constructor + * @param {google.api.IHttpRule=} [properties] Properties to set + */ + function HttpRule(properties) { + this.additionalBindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.selector = ""; + + /** + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = null; + + /** + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = null; + + /** + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = null; + + /** + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = null; + + /** + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = null; + + /** + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.custom = null; + + /** + * HttpRule body. + * @member {string} body + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.body = ""; + + /** + * HttpRule responseBody. + * @member {string} responseBody + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.responseBody = ""; + + /** + * HttpRule additionalBindings. + * @member {Array.} additionalBindings + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.additionalBindings = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HttpRule pattern. + * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern + * @memberof google.api.HttpRule + * @instance + */ + Object.defineProperty(HttpRule.prototype, "pattern", { + get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HttpRule instance using the specified properties. + * @function create + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance + */ + HttpRule.create = function create(properties) { + return new HttpRule(properties); + }; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encode + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && Object.hasOwnProperty.call(message, "get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && Object.hasOwnProperty.call(message, "put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && Object.hasOwnProperty.call(message, "post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && Object.hasOwnProperty.call(message, "body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && Object.hasOwnProperty.call(message, "custom")) + $root.google.api.CustomHttpPattern.encode(message.custom, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.additionalBindings != null && message.additionalBindings.length) + for (var i = 0; i < message.additionalBindings.length; ++i) + $root.google.api.HttpRule.encode(message.additionalBindings[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); + return writer; + }; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @function decode + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.HttpRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.selector = reader.string(); + break; + } + case 2: { + message.get = reader.string(); + break; + } + case 3: { + message.put = reader.string(); + break; + } + case 4: { + message.post = reader.string(); + break; + } + case 5: { + message["delete"] = reader.string(); + break; + } + case 6: { + message.patch = reader.string(); + break; + } + case 8: { + message.custom = $root.google.api.CustomHttpPattern.decode(reader, reader.uint32()); + break; + } + case 7: { + message.body = reader.string(); + break; + } + case 12: { + message.responseBody = reader.string(); + break; + } + case 11: { + if (!(message.additionalBindings && message.additionalBindings.length)) + message.additionalBindings = []; + message.additionalBindings.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.HttpRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.HttpRule} HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HttpRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HttpRule message. + * @function verify + * @memberof google.api.HttpRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HttpRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.selector != null && message.hasOwnProperty("selector")) + if (!$util.isString(message.selector)) + return "selector: string expected"; + if (message.get != null && message.hasOwnProperty("get")) { + properties.pattern = 1; + if (!$util.isString(message.get)) + return "get: string expected"; + } + if (message.put != null && message.hasOwnProperty("put")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.put)) + return "put: string expected"; + } + if (message.post != null && message.hasOwnProperty("post")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.post)) + return "post: string expected"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message["delete"])) + return "delete: string expected"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + if (!$util.isString(message.patch)) + return "patch: string expected"; + } + if (message.custom != null && message.hasOwnProperty("custom")) { + if (properties.pattern === 1) + return "pattern: multiple values"; + properties.pattern = 1; + { + var error = $root.google.api.CustomHttpPattern.verify(message.custom); + if (error) + return "custom." + error; + } + } + if (message.body != null && message.hasOwnProperty("body")) + if (!$util.isString(message.body)) + return "body: string expected"; + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + if (!$util.isString(message.responseBody)) + return "responseBody: string expected"; + if (message.additionalBindings != null && message.hasOwnProperty("additionalBindings")) { + if (!Array.isArray(message.additionalBindings)) + return "additionalBindings: array expected"; + for (var i = 0; i < message.additionalBindings.length; ++i) { + var error = $root.google.api.HttpRule.verify(message.additionalBindings[i]); + if (error) + return "additionalBindings." + error; + } + } + return null; + }; + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.HttpRule + * @static + * @param {Object.} object Plain object + * @returns {google.api.HttpRule} HttpRule + */ + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) + return object; + var message = new $root.google.api.HttpRule(); + if (object.selector != null) + message.selector = String(object.selector); + if (object.get != null) + message.get = String(object.get); + if (object.put != null) + message.put = String(object.put); + if (object.post != null) + message.post = String(object.post); + if (object["delete"] != null) + message["delete"] = String(object["delete"]); + if (object.patch != null) + message.patch = String(object.patch); + if (object.custom != null) { + if (typeof object.custom !== "object") + throw TypeError(".google.api.HttpRule.custom: object expected"); + message.custom = $root.google.api.CustomHttpPattern.fromObject(object.custom); + } + if (object.body != null) + message.body = String(object.body); + if (object.responseBody != null) + message.responseBody = String(object.responseBody); + if (object.additionalBindings) { + if (!Array.isArray(object.additionalBindings)) + throw TypeError(".google.api.HttpRule.additionalBindings: array expected"); + message.additionalBindings = []; + for (var i = 0; i < object.additionalBindings.length; ++i) { + if (typeof object.additionalBindings[i] !== "object") + throw TypeError(".google.api.HttpRule.additionalBindings: object expected"); + message.additionalBindings[i] = $root.google.api.HttpRule.fromObject(object.additionalBindings[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.HttpRule + * @static + * @param {google.api.HttpRule} message HttpRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HttpRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.additionalBindings = []; + if (options.defaults) { + object.selector = ""; + object.body = ""; + object.responseBody = ""; + } + if (message.selector != null && message.hasOwnProperty("selector")) + object.selector = message.selector; + if (message.get != null && message.hasOwnProperty("get")) { + object.get = message.get; + if (options.oneofs) + object.pattern = "get"; + } + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; + } + if (message.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; + } + if (message["delete"] != null && message.hasOwnProperty("delete")) { + object["delete"] = message["delete"]; + if (options.oneofs) + object.pattern = "delete"; + } + if (message.patch != null && message.hasOwnProperty("patch")) { + object.patch = message.patch; + if (options.oneofs) + object.pattern = "patch"; + } + if (message.body != null && message.hasOwnProperty("body")) + object.body = message.body; + if (message.custom != null && message.hasOwnProperty("custom")) { + object.custom = $root.google.api.CustomHttpPattern.toObject(message.custom, options); + if (options.oneofs) + object.pattern = "custom"; + } + if (message.additionalBindings && message.additionalBindings.length) { + object.additionalBindings = []; + for (var j = 0; j < message.additionalBindings.length; ++j) + object.additionalBindings[j] = $root.google.api.HttpRule.toObject(message.additionalBindings[j], options); + } + if (message.responseBody != null && message.hasOwnProperty("responseBody")) + object.responseBody = message.responseBody; + return object; + }; + + /** + * Converts this HttpRule to JSON. + * @function toJSON + * @memberof google.api.HttpRule + * @instance + * @returns {Object.} JSON object + */ + HttpRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HttpRule + * @function getTypeUrl + * @memberof google.api.HttpRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HttpRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.HttpRule"; + }; + + return HttpRule; + })(); + + api.CustomHttpPattern = (function() { + + /** + * Properties of a CustomHttpPattern. + * @memberof google.api + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path + */ + + /** + * Constructs a new CustomHttpPattern. + * @memberof google.api + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern + * @constructor + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + */ + function CustomHttpPattern(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.kind = ""; + + /** + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern + * @instance + */ + CustomHttpPattern.prototype.path = ""; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @function create + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + */ + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); + }; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encode + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); + return writer; + }; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @function decode + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.CustomHttpPattern(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.CustomHttpPattern + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHttpPattern message. + * @function verify + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHttpPattern.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + if (!$util.isString(message.kind)) + return "kind: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {Object.} object Plain object + * @returns {google.api.CustomHttpPattern} CustomHttpPattern + */ + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) + return object; + var message = new $root.google.api.CustomHttpPattern(); + if (object.kind != null) + message.kind = String(object.kind); + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.CustomHttpPattern + * @static + * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHttpPattern.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.kind = ""; + object.path = ""; + } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = message.kind; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this CustomHttpPattern to JSON. + * @function toJSON + * @memberof google.api.CustomHttpPattern + * @instance + * @returns {Object.} JSON object + */ + CustomHttpPattern.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomHttpPattern + * @function getTypeUrl + * @memberof google.api.CustomHttpPattern + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomHttpPattern.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.CustomHttpPattern"; + }; + + return CustomHttpPattern; + })(); + + return api; + })(); + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + * @property {string|null} [edition] FileDescriptorProto edition + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * FileDescriptorProto edition. + * @member {string} edition + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.edition = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.edition); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message["package"] = reader.string(); + break; + } + case 3: { + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + } + case 10: { + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + } + case 11: { + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + } + case 4: { + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 8: { + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + } + case 12: { + message.syntax = reader.string(); + break; + } + case 13: { + message.edition = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + if (message.edition != null && message.hasOwnProperty("edition")) + if (!$util.isString(message.edition)) + return "edition: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + object.edition = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = message.edition; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorProto"; + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + } + case 4: { + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 7: { + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + } + case 10: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto"; + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ExtensionRange"; + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ReservedRange + * @function getTypeUrl + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DescriptorProto.ReservedRange"; + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @function getTypeUrl + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ExtensionRangeOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ExtensionRangeOptions"; + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 3: { + message.number = reader.int32(); + break; + } + case 4: { + message.label = reader.int32(); + break; + } + case 5: { + message.type = reader.int32(); + break; + } + case 6: { + message.typeName = reader.string(); + break; + } + case 2: { + message.extendee = reader.string(); + break; + } + case 7: { + message.defaultValue = reader.string(); + break; + } + case 9: { + message.oneofIndex = reader.int32(); + break; + } + case 10: { + message.jsonName = reader.string(); + break; + } + case 8: { + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + } + case 17: { + message.proto3Optional = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + default: + if (typeof object.label === "number") { + message.label = object.label; + break; + } + break; + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] === undefined ? message.label : $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] === undefined ? message.type : $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldDescriptorProto"; + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofDescriptorProto"; + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + } + case 4: { + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + } + case 5: { + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto"; + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumReservedRange + * @function getTypeUrl + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumDescriptorProto.EnumReservedRange"; + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.number = reader.int32(); + break; + } + case 3: { + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueDescriptorProto"; + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + } + case 3: { + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceDescriptorProto"; + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.inputType = reader.string(); + break; + } + case 3: { + message.outputType = reader.string(); + break; + } + case 4: { + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + } + case 5: { + message.clientStreaming = reader.bool(); + break; + } + case 6: { + message.serverStreaming = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodDescriptorProto + * @function getTypeUrl + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodDescriptorProto"; + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {Array.|null} [".google.api.resourceDefinition"] FileOptions .google.api.resourceDefinition + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.resourceDefinition"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .google.api.resourceDefinition. + * @member {Array.} .google.api.resourceDefinition + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".google.api.resourceDefinition"] = $util.emptyArray; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resourceDefinition"] != null && message[".google.api.resourceDefinition"].length) + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resourceDefinition"][i], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.javaPackage = reader.string(); + break; + } + case 8: { + message.javaOuterClassname = reader.string(); + break; + } + case 10: { + message.javaMultipleFiles = reader.bool(); + break; + } + case 20: { + message.javaGenerateEqualsAndHash = reader.bool(); + break; + } + case 27: { + message.javaStringCheckUtf8 = reader.bool(); + break; + } + case 9: { + message.optimizeFor = reader.int32(); + break; + } + case 11: { + message.goPackage = reader.string(); + break; + } + case 16: { + message.ccGenericServices = reader.bool(); + break; + } + case 17: { + message.javaGenericServices = reader.bool(); + break; + } + case 18: { + message.pyGenericServices = reader.bool(); + break; + } + case 42: { + message.phpGenericServices = reader.bool(); + break; + } + case 23: { + message.deprecated = reader.bool(); + break; + } + case 31: { + message.ccEnableArenas = reader.bool(); + break; + } + case 36: { + message.objcClassPrefix = reader.string(); + break; + } + case 37: { + message.csharpNamespace = reader.string(); + break; + } + case 39: { + message.swiftPrefix = reader.string(); + break; + } + case 40: { + message.phpClassPrefix = reader.string(); + break; + } + case 41: { + message.phpNamespace = reader.string(); + break; + } + case 44: { + message.phpMetadataNamespace = reader.string(); + break; + } + case 45: { + message.rubyPackage = reader.string(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + if (!(message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length)) + message[".google.api.resourceDefinition"] = []; + message[".google.api.resourceDefinition"].push($root.google.api.ResourceDescriptor.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resourceDefinition"] != null && message.hasOwnProperty(".google.api.resourceDefinition")) { + if (!Array.isArray(message[".google.api.resourceDefinition"])) + return ".google.api.resourceDefinition: array expected"; + for (var i = 0; i < message[".google.api.resourceDefinition"].length; ++i) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resourceDefinition"][i]); + if (error) + return ".google.api.resourceDefinition." + error; + } + } + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + default: + if (typeof object.optimizeFor === "number") { + message.optimizeFor = object.optimizeFor; + break; + } + break; + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resourceDefinition"]) { + if (!Array.isArray(object[".google.api.resourceDefinition"])) + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: array expected"); + message[".google.api.resourceDefinition"] = []; + for (var i = 0; i < object[".google.api.resourceDefinition"].length; ++i) { + if (typeof object[".google.api.resourceDefinition"][i] !== "object") + throw TypeError(".google.protobuf.FileOptions..google.api.resourceDefinition: object expected"); + message[".google.api.resourceDefinition"][i] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resourceDefinition"][i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.resourceDefinition"] = []; + } + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] === undefined ? message.optimizeFor : $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resourceDefinition"] && message[".google.api.resourceDefinition"].length) { + object[".google.api.resourceDefinition"] = []; + for (var j = 0; j < message[".google.api.resourceDefinition"].length; ++j) + object[".google.api.resourceDefinition"][j] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resourceDefinition"][j], options); + } + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FileOptions + * @function getTypeUrl + * @memberof google.protobuf.FileOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileOptions"; + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {google.api.IResourceDescriptor|null} [".google.api.resource"] MessageOptions .google.api.resource + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .google.api.resource. + * @member {google.api.IResourceDescriptor|null|undefined} .google.api.resource + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".google.api.resource"] = null; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.resource"] != null && Object.hasOwnProperty.call(message, ".google.api.resource")) + $root.google.api.ResourceDescriptor.encode(message[".google.api.resource"], writer.uint32(/* id 1053, wireType 2 =*/8426).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageSetWireFormat = reader.bool(); + break; + } + case 2: { + message.noStandardDescriptorAccessor = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 7: { + message.mapEntry = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1053: { + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) { + var error = $root.google.api.ResourceDescriptor.verify(message[".google.api.resource"]); + if (error) + return ".google.api.resource." + error; + } + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.resource"] != null) { + if (typeof object[".google.api.resource"] !== "object") + throw TypeError(".google.protobuf.MessageOptions..google.api.resource: object expected"); + message[".google.api.resource"] = $root.google.api.ResourceDescriptor.fromObject(object[".google.api.resource"]); + } + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".google.api.resource"] = null; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.resource"] != null && message.hasOwnProperty(".google.api.resource")) + object[".google.api.resource"] = $root.google.api.ResourceDescriptor.toObject(message[".google.api.resource"], options); + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MessageOptions + * @function getTypeUrl + * @memberof google.protobuf.MessageOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MessageOptions"; + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [unverifiedLazy] FieldOptions unverifiedLazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ctype = reader.int32(); + break; + } + case 2: { + message.packed = reader.bool(); + break; + } + case 6: { + message.jstype = reader.int32(); + break; + } + case 5: { + message.lazy = reader.bool(); + break; + } + case 15: { + message.unverifiedLazy = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 10: { + message.weak = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + } + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OneofOptions + * @function getTypeUrl + * @memberof google.protobuf.OneofOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.OneofOptions"; + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.allowAlias = reader.bool(); + break; + } + case 3: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumOptions"; + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for EnumValueOptions + * @function getTypeUrl + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.EnumValueOptions"; + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + * @property {string|null} [".google.api.defaultHost"] ServiceOptions .google.api.defaultHost + * @property {string|null} [".google.api.oauthScopes"] ServiceOptions .google.api.oauthScopes + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * ServiceOptions .google.api.defaultHost. + * @member {string} .google.api.defaultHost + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.defaultHost"] = ""; + + /** + * ServiceOptions .google.api.oauthScopes. + * @member {string} .google.api.oauthScopes + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype[".google.api.oauthScopes"] = ""; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.defaultHost"] != null && Object.hasOwnProperty.call(message, ".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && Object.hasOwnProperty.call(message, ".google.api.oauthScopes")) + writer.uint32(/* id 1050, wireType 2 =*/8402).string(message[".google.api.oauthScopes"]); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 1049: { + message[".google.api.defaultHost"] = reader.string(); + break; + } + case 1050: { + message[".google.api.oauthScopes"] = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + if (!$util.isString(message[".google.api.defaultHost"])) + return ".google.api.defaultHost: string expected"; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + if (!$util.isString(message[".google.api.oauthScopes"])) + return ".google.api.oauthScopes: string expected"; + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.defaultHost"] != null) + message[".google.api.defaultHost"] = String(object[".google.api.defaultHost"]); + if (object[".google.api.oauthScopes"] != null) + message[".google.api.oauthScopes"] = String(object[".google.api.oauthScopes"]); + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".google.api.defaultHost"] = ""; + object[".google.api.oauthScopes"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.defaultHost"] != null && message.hasOwnProperty(".google.api.defaultHost")) + object[".google.api.defaultHost"] = message[".google.api.defaultHost"]; + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".google.api.oauthScopes")) + object[".google.api.oauthScopes"] = message[".google.api.oauthScopes"]; + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + * @property {google.api.IHttpRule|null} [".google.api.http"] MethodOptions .google.api.http + * @property {Array.|null} [".google.api.methodSignature"] MethodOptions .google.api.methodSignature + * @property {google.longrunning.IOperationInfo|null} [".google.longrunning.operationInfo"] MethodOptions .google.longrunning.operationInfo + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + this[".google.api.methodSignature"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MethodOptions .google.api.http. + * @member {google.api.IHttpRule|null|undefined} .google.api.http + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.http"] = null; + + /** + * MethodOptions .google.api.methodSignature. + * @member {Array.} .google.api.methodSignature + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.api.methodSignature"] = $util.emptyArray; + + /** + * MethodOptions .google.longrunning.operationInfo. + * @member {google.longrunning.IOperationInfo|null|undefined} .google.longrunning.operationInfo + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype[".google.longrunning.operationInfo"] = null; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.longrunning.operationInfo"] != null && Object.hasOwnProperty.call(message, ".google.longrunning.operationInfo")) + $root.google.longrunning.OperationInfo.encode(message[".google.longrunning.operationInfo"], writer.uint32(/* id 1049, wireType 2 =*/8394).fork()).ldelim(); + if (message[".google.api.methodSignature"] != null && message[".google.api.methodSignature"].length) + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + writer.uint32(/* id 1051, wireType 2 =*/8410).string(message[".google.api.methodSignature"][i]); + if (message[".google.api.http"] != null && Object.hasOwnProperty.call(message, ".google.api.http")) + $root.google.api.HttpRule.encode(message[".google.api.http"], writer.uint32(/* id 72295728, wireType 2 =*/578365826).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: { + message.deprecated = reader.bool(); + break; + } + case 34: { + message.idempotencyLevel = reader.int32(); + break; + } + case 999: { + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + } + case 72295728: { + message[".google.api.http"] = $root.google.api.HttpRule.decode(reader, reader.uint32()); + break; + } + case 1051: { + if (!(message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length)) + message[".google.api.methodSignature"] = []; + message[".google.api.methodSignature"].push(reader.string()); + break; + } + case 1049: { + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) { + var error = $root.google.api.HttpRule.verify(message[".google.api.http"]); + if (error) + return ".google.api.http." + error; + } + if (message[".google.api.methodSignature"] != null && message.hasOwnProperty(".google.api.methodSignature")) { + if (!Array.isArray(message[".google.api.methodSignature"])) + return ".google.api.methodSignature: array expected"; + for (var i = 0; i < message[".google.api.methodSignature"].length; ++i) + if (!$util.isString(message[".google.api.methodSignature"][i])) + return ".google.api.methodSignature: string[] expected"; + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) { + var error = $root.google.longrunning.OperationInfo.verify(message[".google.longrunning.operationInfo"]); + if (error) + return ".google.longrunning.operationInfo." + error; + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + default: + if (typeof object.idempotencyLevel === "number") { + message.idempotencyLevel = object.idempotencyLevel; + break; + } + break; + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.http"] != null) { + if (typeof object[".google.api.http"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.api.http: object expected"); + message[".google.api.http"] = $root.google.api.HttpRule.fromObject(object[".google.api.http"]); + } + if (object[".google.api.methodSignature"]) { + if (!Array.isArray(object[".google.api.methodSignature"])) + throw TypeError(".google.protobuf.MethodOptions..google.api.methodSignature: array expected"); + message[".google.api.methodSignature"] = []; + for (var i = 0; i < object[".google.api.methodSignature"].length; ++i) + message[".google.api.methodSignature"][i] = String(object[".google.api.methodSignature"][i]); + } + if (object[".google.longrunning.operationInfo"] != null) { + if (typeof object[".google.longrunning.operationInfo"] !== "object") + throw TypeError(".google.protobuf.MethodOptions..google.longrunning.operationInfo: object expected"); + message[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.fromObject(object[".google.longrunning.operationInfo"]); + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.uninterpretedOption = []; + object[".google.api.methodSignature"] = []; + } + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + object[".google.longrunning.operationInfo"] = null; + object[".google.api.http"] = null; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] === undefined ? message.idempotencyLevel : $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.longrunning.operationInfo"] != null && message.hasOwnProperty(".google.longrunning.operationInfo")) + object[".google.longrunning.operationInfo"] = $root.google.longrunning.OperationInfo.toObject(message[".google.longrunning.operationInfo"], options); + if (message[".google.api.methodSignature"] && message[".google.api.methodSignature"].length) { + object[".google.api.methodSignature"] = []; + for (var j = 0; j < message[".google.api.methodSignature"].length; ++j) + object[".google.api.methodSignature"][j] = message[".google.api.methodSignature"][j]; + } + if (message[".google.api.http"] != null && message.hasOwnProperty(".google.api.http")) + object[".google.api.http"] = $root.google.api.HttpRule.toObject(message[".google.api.http"], options); + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for MethodOptions + * @function getTypeUrl + * @memberof google.protobuf.MethodOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.MethodOptions"; + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + } + case 3: { + message.identifierValue = reader.string(); + break; + } + case 4: { + message.positiveIntValue = reader.uint64(); + break; + } + case 5: { + message.negativeIntValue = reader.int64(); + break; + } + case 6: { + message.doubleValue = reader.double(); + break; + } + case 7: { + message.stringValue = reader.bytes(); + break; + } + case 8: { + message.aggregateValue = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length >= 0) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UninterpretedOption + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption"; + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NamePart + * @function getTypeUrl + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UninterpretedOption.NamePart"; + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SourceCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo"; + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + } + case 3: { + message.leadingComments = reader.string(); + break; + } + case 4: { + message.trailingComments = reader.string(); + break; + } + case 6: { + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Location + * @function getTypeUrl + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.SourceCodeInfo.Location"; + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GeneratedCodeInfo + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo"; + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + * @property {google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null} [semantic] Annotation semantic + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + if (message.semantic != null && Object.hasOwnProperty.call(message, "semantic")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.semantic); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + } + case 2: { + message.sourceFile = reader.string(); + break; + } + case 3: { + message.begin = reader.int32(); + break; + } + case 4: { + message.end = reader.int32(); + break; + } + case 5: { + message.semantic = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.semantic != null && message.hasOwnProperty("semantic")) + switch (message.semantic) { + default: + return "semantic: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + switch (object.semantic) { + default: + if (typeof object.semantic === "number") { + message.semantic = object.semantic; + break; + } + break; + case "NONE": + case 0: + message.semantic = 0; + break; + case "SET": + case 1: + message.semantic = 1; + break; + case "ALIAS": + case 2: + message.semantic = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.semantic != null && message.hasOwnProperty("semantic")) + object.semantic = options.enums === String ? $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] === undefined ? message.semantic : $root.google.protobuf.GeneratedCodeInfo.Annotation.Semantic[message.semantic] : message.semantic; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Annotation + * @function getTypeUrl + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.GeneratedCodeInfo.Annotation"; + }; + + /** + * Semantic enum. + * @name google.protobuf.GeneratedCodeInfo.Annotation.Semantic + * @enum {number} + * @property {number} NONE=0 NONE value + * @property {number} SET=1 SET value + * @property {number} ALIAS=2 ALIAS value + */ + Annotation.Semantic = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NONE"] = 0; + values[valuesById[1] = "SET"] = 1; + values[valuesById[2] = "ALIAS"] = 2; + return values; + })(); + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + protobuf.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.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.FieldMask = (function() { + + /** + * Properties of a FieldMask. + * @memberof google.protobuf + * @interface IFieldMask + * @property {Array.|null} [paths] FieldMask paths + */ + + /** + * Constructs a new FieldMask. + * @memberof google.protobuf + * @classdesc Represents a FieldMask. + * @implements IFieldMask + * @constructor + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + */ + function FieldMask(properties) { + this.paths = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldMask paths. + * @member {Array.} paths + * @memberof google.protobuf.FieldMask + * @instance + */ + FieldMask.prototype.paths = $util.emptyArray; + + /** + * Creates a new FieldMask instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask=} [properties] Properties to set + * @returns {google.protobuf.FieldMask} FieldMask instance + */ + FieldMask.create = function create(properties) { + return new FieldMask(properties); + }; + + /** + * Encodes the specified FieldMask message. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.paths != null && message.paths.length) + for (var i = 0; i < message.paths.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.paths[i]); + return writer; + }; + + /** + * Encodes the specified FieldMask message, length delimited. Does not implicitly {@link google.protobuf.FieldMask.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.IFieldMask} message FieldMask message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldMask.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldMask(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldMask message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldMask + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldMask} FieldMask + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldMask.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldMask message. + * @function verify + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldMask.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.paths != null && message.hasOwnProperty("paths")) { + if (!Array.isArray(message.paths)) + return "paths: array expected"; + for (var i = 0; i < message.paths.length; ++i) + if (!$util.isString(message.paths[i])) + return "paths: string[] expected"; + } + return null; + }; + + /** + * Creates a FieldMask message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldMask + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldMask} FieldMask + */ + FieldMask.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldMask) + return object; + var message = new $root.google.protobuf.FieldMask(); + if (object.paths) { + if (!Array.isArray(object.paths)) + throw TypeError(".google.protobuf.FieldMask.paths: array expected"); + message.paths = []; + for (var i = 0; i < object.paths.length; ++i) + message.paths[i] = String(object.paths[i]); + } + return message; + }; + + /** + * Creates a plain object from a FieldMask message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldMask + * @static + * @param {google.protobuf.FieldMask} message FieldMask + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldMask.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.paths = []; + if (message.paths && message.paths.length) { + object.paths = []; + for (var j = 0; j < message.paths.length; ++j) + object.paths[j] = message.paths[j]; + } + return object; + }; + + /** + * Converts this FieldMask to JSON. + * @function toJSON + * @memberof google.protobuf.FieldMask + * @instance + * @returns {Object.} JSON object + */ + FieldMask.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldMask + * @function getTypeUrl + * @memberof google.protobuf.FieldMask + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldMask.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldMask"; + }; + + return FieldMask; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates an Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; + })(); + + protobuf.Empty = (function() { + + /** + * Properties of an Empty. + * @memberof google.protobuf + * @interface IEmpty + */ + + /** + * Constructs a new Empty. + * @memberof google.protobuf + * @classdesc Represents an Empty. + * @implements IEmpty + * @constructor + * @param {google.protobuf.IEmpty=} [properties] Properties to set + */ + function Empty(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new Empty instance using the specified properties. + * @function create + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty=} [properties] Properties to set + * @returns {google.protobuf.Empty} Empty instance + */ + Empty.create = function create(properties) { + return new Empty(properties); + }; + + /** + * Encodes the specified Empty message. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified Empty message, length delimited. Does not implicitly {@link google.protobuf.Empty.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.IEmpty} message Empty message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Empty.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Empty message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Empty(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Empty message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Empty + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Empty} Empty + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Empty.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Empty message. + * @function verify + * @memberof google.protobuf.Empty + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Empty.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an Empty message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Empty + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Empty} Empty + */ + Empty.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Empty) + return object; + return new $root.google.protobuf.Empty(); + }; + + /** + * Creates a plain object from an Empty message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Empty + * @static + * @param {google.protobuf.Empty} message Empty + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Empty.toObject = function toObject() { + return {}; + }; + + /** + * Converts this Empty to JSON. + * @function toJSON + * @memberof google.protobuf.Empty + * @instance + * @returns {Object.} JSON object + */ + Empty.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Empty + * @function getTypeUrl + * @memberof google.protobuf.Empty + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Empty"; + }; + + return Empty; + })(); + + return protobuf; + })(); + + google.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-gaming/protos/protos.json b/packages/google-cloud-gaming/protos/protos.json new file mode 100644 index 00000000000..2fae5e07879 --- /dev/null +++ b/packages/google-cloud-gaming/protos/protos.json @@ -0,0 +1,5486 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "gaming": { + "nested": { + "v1": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/gaming/v1;gaming", + "java_multiple_files": true, + "java_package": "com.google.cloud.gaming.v1" + }, + "nested": { + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "operationStatus": { + "keyType": "string", + "type": "OperationStatus", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "OperationStatus": { + "fields": { + "done": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorCode": { + "type": "ErrorCode", + "id": 2 + }, + "errorMessage": { + "type": "string", + "id": 3 + } + }, + "nested": { + "ErrorCode": { + "values": { + "ERROR_CODE_UNSPECIFIED": 0, + "INTERNAL_ERROR": 1, + "PERMISSION_DENIED": 2, + "CLUSTER_CONNECTION": 3 + } + } + } + }, + "LabelSelector": { + "fields": { + "labels": { + "keyType": "string", + "type": "string", + "id": 1 + } + } + }, + "RealmSelector": { + "fields": { + "realms": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Schedule": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "cronJobDuration": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "cronSpec": { + "type": "string", + "id": 4 + } + } + }, + "SpecSource": { + "fields": { + "gameServerConfigName": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + } + } + }, + "TargetDetails": { + "fields": { + "gameServerClusterName": { + "type": "string", + "id": 1 + }, + "gameServerDeploymentName": { + "type": "string", + "id": 2 + }, + "fleetDetails": { + "rule": "repeated", + "type": "TargetFleetDetails", + "id": 3 + } + }, + "nested": { + "TargetFleetDetails": { + "fields": { + "fleet": { + "type": "TargetFleet", + "id": 1 + }, + "autoscaler": { + "type": "TargetFleetAutoscaler", + "id": 2 + } + }, + "nested": { + "TargetFleet": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "specSource": { + "type": "SpecSource", + "id": 2 + } + } + }, + "TargetFleetAutoscaler": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "specSource": { + "type": "SpecSource", + "id": 2 + } + } + } + } + } + } + }, + "TargetState": { + "fields": { + "details": { + "rule": "repeated", + "type": "TargetDetails", + "id": 1 + } + } + }, + "DeployedFleetDetails": { + "fields": { + "deployedFleet": { + "type": "DeployedFleet", + "id": 1 + }, + "deployedAutoscaler": { + "type": "DeployedFleetAutoscaler", + "id": 2 + } + }, + "nested": { + "DeployedFleet": { + "fields": { + "fleet": { + "type": "string", + "id": 1 + }, + "fleetSpec": { + "type": "string", + "id": 2 + }, + "specSource": { + "type": "SpecSource", + "id": 3 + }, + "status": { + "type": "DeployedFleetStatus", + "id": 5 + } + }, + "nested": { + "DeployedFleetStatus": { + "fields": { + "readyReplicas": { + "type": "int64", + "id": 1 + }, + "allocatedReplicas": { + "type": "int64", + "id": 2 + }, + "reservedReplicas": { + "type": "int64", + "id": 3 + }, + "replicas": { + "type": "int64", + "id": 4 + } + } + } + } + }, + "DeployedFleetAutoscaler": { + "fields": { + "autoscaler": { + "type": "string", + "id": 1 + }, + "specSource": { + "type": "SpecSource", + "id": 4 + }, + "fleetAutoscalerSpec": { + "type": "string", + "id": 3 + } + } + } + } + }, + "GameServerClusterView": { + "values": { + "GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED": 0, + "BASIC": 1, + "FULL": 2 + } + }, + "ListGameServerClustersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "view": { + "type": "GameServerClusterView", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListGameServerClustersResponse": { + "fields": { + "gameServerClusters": { + "rule": "repeated", + "type": "GameServerCluster", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 4 + } + } + }, + "GetGameServerClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" + } + }, + "view": { + "type": "GameServerClusterView", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateGameServerClusterRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" + } + }, + "gameServerClusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gameServerCluster": { + "type": "GameServerCluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PreviewCreateGameServerClusterRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" + } + }, + "gameServerClusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gameServerCluster": { + "type": "GameServerCluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "previewTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "view": { + "type": "GameServerClusterView", + "id": 6, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PreviewCreateGameServerClusterResponse": { + "fields": { + "etag": { + "type": "string", + "id": 2 + }, + "targetState": { + "type": "TargetState", + "id": 3 + }, + "clusterState": { + "type": "KubernetesClusterState", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "DeleteGameServerClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" + } + } + } + }, + "PreviewDeleteGameServerClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" + } + }, + "previewTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PreviewDeleteGameServerClusterResponse": { + "fields": { + "etag": { + "type": "string", + "id": 2 + }, + "targetState": { + "type": "TargetState", + "id": 3 + } + } + }, + "UpdateGameServerClusterRequest": { + "fields": { + "gameServerCluster": { + "type": "GameServerCluster", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PreviewUpdateGameServerClusterRequest": { + "fields": { + "gameServerCluster": { + "type": "GameServerCluster", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "previewTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PreviewUpdateGameServerClusterResponse": { + "fields": { + "etag": { + "type": "string", + "id": 2 + }, + "targetState": { + "type": "TargetState", + "id": 3 + } + } + }, + "GameServerClusterConnectionInfo": { + "oneofs": { + "clusterReference": { + "oneof": [ + "gkeClusterReference" + ] + } + }, + "fields": { + "gkeClusterReference": { + "type": "GkeClusterReference", + "id": 7 + }, + "namespace": { + "type": "string", + "id": 5 + } + } + }, + "GkeClusterReference": { + "fields": { + "cluster": { + "type": "string", + "id": 1 + } + } + }, + "GameServerCluster": { + "options": { + "(google.api.resource).type": "gameservices.googleapis.com/GameServerCluster", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "connectionInfo": { + "type": "GameServerClusterConnectionInfo", + "id": 5 + }, + "etag": { + "type": "string", + "id": 6 + }, + "description": { + "type": "string", + "id": 7 + }, + "clusterState": { + "type": "KubernetesClusterState", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "KubernetesClusterState": { + "fields": { + "agonesVersionInstalled": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kubernetesVersionInstalled": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "installationState": { + "type": "InstallationState", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "versionInstalledErrorMessage": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "provider": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "agonesVersionTargeted": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "InstallationState": { + "values": { + "INSTALLATION_STATE_UNSPECIFIED": 0, + "AGONES_KUBERNETES_VERSION_SUPPORTED": 1, + "AGONES_VERSION_UNSUPPORTED": 2, + "AGONES_KUBERNETES_VERSION_UNSUPPORTED": 3, + "AGONES_VERSION_UNRECOGNIZED": 4, + "KUBERNETES_VERSION_UNRECOGNIZED": 5, + "VERSION_VERIFICATION_FAILED": 6, + "AGONES_NOT_INSTALLED": 7 + } + } + } + }, + "GameServerClustersService": { + "options": { + "(google.api.default_host)": "gameservices.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListGameServerClusters": { + "requestType": "ListGameServerClustersRequest", + "responseType": "ListGameServerClustersResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/realms/*}/gameServerClusters", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/realms/*}/gameServerClusters" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetGameServerCluster": { + "requestType": "GetGameServerClusterRequest", + "responseType": "GameServerCluster", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/realms/*/gameServerClusters/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/realms/*/gameServerClusters/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateGameServerCluster": { + "requestType": "CreateGameServerClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/realms/*}/gameServerClusters", + "(google.api.http).body": "game_server_cluster", + "(google.api.method_signature)": "parent,game_server_cluster,game_server_cluster_id", + "(google.longrunning.operation_info).response_type": "GameServerCluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/realms/*}/gameServerClusters", + "body": "game_server_cluster" + } + }, + { + "(google.api.method_signature)": "parent,game_server_cluster,game_server_cluster_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "GameServerCluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "PreviewCreateGameServerCluster": { + "requestType": "PreviewCreateGameServerClusterRequest", + "responseType": "PreviewCreateGameServerClusterResponse", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/realms/*}/gameServerClusters:previewCreate", + "(google.api.http).body": "game_server_cluster" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/realms/*}/gameServerClusters:previewCreate", + "body": "game_server_cluster" + } + } + ] + }, + "DeleteGameServerCluster": { + "requestType": "DeleteGameServerClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/realms/*/gameServerClusters/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/realms/*/gameServerClusters/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "PreviewDeleteGameServerCluster": { + "requestType": "PreviewDeleteGameServerClusterRequest", + "responseType": "PreviewDeleteGameServerClusterResponse", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/realms/*/gameServerClusters/*}:previewDelete" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/realms/*/gameServerClusters/*}:previewDelete" + } + } + ] + }, + "UpdateGameServerCluster": { + "requestType": "UpdateGameServerClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{game_server_cluster.name=projects/*/locations/*/realms/*/gameServerClusters/*}", + "(google.api.http).body": "game_server_cluster", + "(google.api.method_signature)": "game_server_cluster,update_mask", + "(google.longrunning.operation_info).response_type": "GameServerCluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{game_server_cluster.name=projects/*/locations/*/realms/*/gameServerClusters/*}", + "body": "game_server_cluster" + } + }, + { + "(google.api.method_signature)": "game_server_cluster,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "GameServerCluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "PreviewUpdateGameServerCluster": { + "requestType": "PreviewUpdateGameServerClusterRequest", + "responseType": "PreviewUpdateGameServerClusterResponse", + "options": { + "(google.api.http).patch": "/v1/{game_server_cluster.name=projects/*/locations/*/realms/*/gameServerClusters/*}:previewUpdate", + "(google.api.http).body": "game_server_cluster" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{game_server_cluster.name=projects/*/locations/*/realms/*/gameServerClusters/*}:previewUpdate", + "body": "game_server_cluster" + } + } + ] + } + } + }, + "ListGameServerConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerConfig" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListGameServerConfigsResponse": { + "fields": { + "gameServerConfigs": { + "rule": "repeated", + "type": "GameServerConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 4 + } + } + }, + "GetGameServerConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerConfig" + } + } + } + }, + "CreateGameServerConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerConfig" + } + }, + "configId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gameServerConfig": { + "type": "GameServerConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteGameServerConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerConfig" + } + } + } + }, + "ScalingConfig": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "fleetAutoscalerSpec": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "selectors": { + "rule": "repeated", + "type": "LabelSelector", + "id": 4 + }, + "schedules": { + "rule": "repeated", + "type": "Schedule", + "id": 5 + } + } + }, + "FleetConfig": { + "fields": { + "fleetSpec": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + } + } + }, + "GameServerConfig": { + "options": { + "(google.api.resource).type": "gameservices.googleapis.com/GameServerConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "fleetConfigs": { + "rule": "repeated", + "type": "FleetConfig", + "id": 5 + }, + "scalingConfigs": { + "rule": "repeated", + "type": "ScalingConfig", + "id": 6 + }, + "description": { + "type": "string", + "id": 7 + } + } + }, + "GameServerConfigsService": { + "options": { + "(google.api.default_host)": "gameservices.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListGameServerConfigs": { + "requestType": "ListGameServerConfigsRequest", + "responseType": "ListGameServerConfigsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/gameServerDeployments/*}/configs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/gameServerDeployments/*}/configs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetGameServerConfig": { + "requestType": "GetGameServerConfigRequest", + "responseType": "GameServerConfig", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/gameServerDeployments/*/configs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/gameServerDeployments/*/configs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateGameServerConfig": { + "requestType": "CreateGameServerConfigRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/gameServerDeployments/*}/configs", + "(google.api.http).body": "game_server_config", + "(google.api.method_signature)": "parent,game_server_config", + "(google.longrunning.operation_info).response_type": "GameServerConfig", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/gameServerDeployments/*}/configs", + "body": "game_server_config" + } + }, + { + "(google.api.method_signature)": "parent,game_server_config" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "GameServerConfig", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteGameServerConfig": { + "requestType": "DeleteGameServerConfigRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/gameServerDeployments/*/configs/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/gameServerDeployments/*/configs/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "ListGameServerDeploymentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerDeployment" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListGameServerDeploymentsResponse": { + "fields": { + "gameServerDeployments": { + "rule": "repeated", + "type": "GameServerDeployment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 4 + } + } + }, + "GetGameServerDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerDeployment" + } + } + } + }, + "GetGameServerDeploymentRolloutRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerDeployment" + } + } + } + }, + "CreateGameServerDeploymentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerDeployment" + } + }, + "deploymentId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gameServerDeployment": { + "type": "GameServerDeployment", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteGameServerDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerDeployment" + } + } + } + }, + "UpdateGameServerDeploymentRequest": { + "fields": { + "gameServerDeployment": { + "type": "GameServerDeployment", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateGameServerDeploymentRolloutRequest": { + "fields": { + "rollout": { + "type": "GameServerDeploymentRollout", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "FetchDeploymentStateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "FetchDeploymentStateResponse": { + "fields": { + "clusterState": { + "rule": "repeated", + "type": "DeployedClusterState", + "id": 1 + }, + "unavailable": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "DeployedClusterState": { + "fields": { + "cluster": { + "type": "string", + "id": 1 + }, + "fleetDetails": { + "rule": "repeated", + "type": "DeployedFleetDetails", + "id": 2 + } + } + } + } + }, + "GameServerDeployment": { + "options": { + "(google.api.resource).type": "gameservices.googleapis.com/GameServerDeployment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/gameServerDeployments/{deployment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "etag": { + "type": "string", + "id": 7 + }, + "description": { + "type": "string", + "id": 8 + } + } + }, + "GameServerConfigOverride": { + "oneofs": { + "selector": { + "oneof": [ + "realmsSelector" + ] + }, + "change": { + "oneof": [ + "configVersion" + ] + } + }, + "fields": { + "realmsSelector": { + "type": "RealmSelector", + "id": 1 + }, + "configVersion": { + "type": "string", + "id": 100 + } + } + }, + "GameServerDeploymentRollout": { + "options": { + "(google.api.resource).type": "gameservices.googleapis.com/GameServerDeploymentRollout", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "defaultGameServerConfig": { + "type": "string", + "id": 4 + }, + "gameServerConfigOverrides": { + "rule": "repeated", + "type": "GameServerConfigOverride", + "id": 5 + }, + "etag": { + "type": "string", + "id": 6 + } + } + }, + "PreviewGameServerDeploymentRolloutRequest": { + "fields": { + "rollout": { + "type": "GameServerDeploymentRollout", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "previewTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PreviewGameServerDeploymentRolloutResponse": { + "fields": { + "unavailable": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "etag": { + "type": "string", + "id": 3 + }, + "targetState": { + "type": "TargetState", + "id": 4 + } + } + }, + "GameServerDeploymentsService": { + "options": { + "(google.api.default_host)": "gameservices.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListGameServerDeployments": { + "requestType": "ListGameServerDeploymentsRequest", + "responseType": "ListGameServerDeploymentsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/gameServerDeployments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/gameServerDeployments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetGameServerDeployment": { + "requestType": "GetGameServerDeploymentRequest", + "responseType": "GameServerDeployment", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/gameServerDeployments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/gameServerDeployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateGameServerDeployment": { + "requestType": "CreateGameServerDeploymentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/gameServerDeployments", + "(google.api.http).body": "game_server_deployment", + "(google.api.method_signature)": "parent,game_server_deployment", + "(google.longrunning.operation_info).response_type": "GameServerDeployment", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/gameServerDeployments", + "body": "game_server_deployment" + } + }, + { + "(google.api.method_signature)": "parent,game_server_deployment" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "GameServerDeployment", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteGameServerDeployment": { + "requestType": "DeleteGameServerDeploymentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/gameServerDeployments/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/gameServerDeployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateGameServerDeployment": { + "requestType": "UpdateGameServerDeploymentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{game_server_deployment.name=projects/*/locations/*/gameServerDeployments/*}", + "(google.api.http).body": "game_server_deployment", + "(google.api.method_signature)": "game_server_deployment,update_mask", + "(google.longrunning.operation_info).response_type": "GameServerDeployment", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{game_server_deployment.name=projects/*/locations/*/gameServerDeployments/*}", + "body": "game_server_deployment" + } + }, + { + "(google.api.method_signature)": "game_server_deployment,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "GameServerDeployment", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetGameServerDeploymentRollout": { + "requestType": "GetGameServerDeploymentRolloutRequest", + "responseType": "GameServerDeploymentRollout", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/gameServerDeployments/*}/rollout", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/gameServerDeployments/*}/rollout" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateGameServerDeploymentRollout": { + "requestType": "UpdateGameServerDeploymentRolloutRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{rollout.name=projects/*/locations/*/gameServerDeployments/*}/rollout", + "(google.api.http).body": "rollout", + "(google.api.method_signature)": "rollout,update_mask", + "(google.longrunning.operation_info).response_type": "GameServerDeployment", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{rollout.name=projects/*/locations/*/gameServerDeployments/*}/rollout", + "body": "rollout" + } + }, + { + "(google.api.method_signature)": "rollout,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "GameServerDeployment", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "PreviewGameServerDeploymentRollout": { + "requestType": "PreviewGameServerDeploymentRolloutRequest", + "responseType": "PreviewGameServerDeploymentRolloutResponse", + "options": { + "(google.api.http).patch": "/v1/{rollout.name=projects/*/locations/*/gameServerDeployments/*}/rollout:preview", + "(google.api.http).body": "rollout" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{rollout.name=projects/*/locations/*/gameServerDeployments/*}/rollout:preview", + "body": "rollout" + } + } + ] + }, + "FetchDeploymentState": { + "requestType": "FetchDeploymentStateRequest", + "responseType": "FetchDeploymentStateResponse", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/gameServerDeployments/*}:fetchDeploymentState", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/gameServerDeployments/*}:fetchDeploymentState", + "body": "*" + } + } + ] + } + } + }, + "ListRealmsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/Realm" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListRealmsResponse": { + "fields": { + "realms": { + "rule": "repeated", + "type": "Realm", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetRealmRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/Realm" + } + } + } + }, + "CreateRealmRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/Realm" + } + }, + "realmId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "realm": { + "type": "Realm", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteRealmRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/Realm" + } + } + } + }, + "UpdateRealmRequest": { + "fields": { + "realm": { + "type": "Realm", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PreviewRealmUpdateRequest": { + "fields": { + "realm": { + "type": "Realm", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "previewTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PreviewRealmUpdateResponse": { + "fields": { + "etag": { + "type": "string", + "id": 2 + }, + "targetState": { + "type": "TargetState", + "id": 3 + } + } + }, + "Realm": { + "options": { + "(google.api.resource).type": "gameservices.googleapis.com/Realm", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/realms/{realm}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "timeZone": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "etag": { + "type": "string", + "id": 7 + }, + "description": { + "type": "string", + "id": 8 + } + } + }, + "RealmsService": { + "options": { + "(google.api.default_host)": "gameservices.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListRealms": { + "requestType": "ListRealmsRequest", + "responseType": "ListRealmsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/realms", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/realms" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetRealm": { + "requestType": "GetRealmRequest", + "responseType": "Realm", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/realms/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/realms/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateRealm": { + "requestType": "CreateRealmRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/realms", + "(google.api.http).body": "realm", + "(google.api.method_signature)": "parent,realm,realm_id", + "(google.longrunning.operation_info).response_type": "Realm", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/realms", + "body": "realm" + } + }, + { + "(google.api.method_signature)": "parent,realm,realm_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Realm", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteRealm": { + "requestType": "DeleteRealmRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/realms/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/realms/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateRealm": { + "requestType": "UpdateRealmRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{realm.name=projects/*/locations/*/realms/*}", + "(google.api.http).body": "realm", + "(google.api.method_signature)": "realm,update_mask", + "(google.longrunning.operation_info).response_type": "Realm", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{realm.name=projects/*/locations/*/realms/*}", + "body": "realm" + } + }, + { + "(google.api.method_signature)": "realm,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Realm", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "PreviewRealmUpdate": { + "requestType": "PreviewRealmUpdateRequest", + "responseType": "PreviewRealmUpdateResponse", + "options": { + "(google.api.http).patch": "/v1/{realm.name=projects/*/locations/*/realms/*}:previewUpdate", + "(google.api.http).body": "realm" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{realm.name=projects/*/locations/*/realms/*}:previewUpdate", + "body": "realm" + } + } + ] + } + } + } + } + }, + "v1beta": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming", + "java_multiple_files": true, + "java_package": "com.google.cloud.gaming.v1beta", + "php_namespace": "Google\\Cloud\\Gaming\\V1beta" + }, + "nested": { + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "operationStatus": { + "keyType": "string", + "type": "OperationStatus", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "OperationStatus": { + "fields": { + "done": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "errorCode": { + "type": "ErrorCode", + "id": 2 + }, + "errorMessage": { + "type": "string", + "id": 3 + } + }, + "nested": { + "ErrorCode": { + "values": { + "ERROR_CODE_UNSPECIFIED": 0, + "INTERNAL_ERROR": 1, + "PERMISSION_DENIED": 2, + "CLUSTER_CONNECTION": 3 + } + } + } + }, + "LabelSelector": { + "fields": { + "labels": { + "keyType": "string", + "type": "string", + "id": 1 + } + } + }, + "RealmSelector": { + "fields": { + "realms": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Schedule": { + "fields": { + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "cronJobDuration": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "cronSpec": { + "type": "string", + "id": 4 + } + } + }, + "SpecSource": { + "fields": { + "gameServerConfigName": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + } + } + }, + "TargetDetails": { + "fields": { + "gameServerClusterName": { + "type": "string", + "id": 1 + }, + "gameServerDeploymentName": { + "type": "string", + "id": 2 + }, + "fleetDetails": { + "rule": "repeated", + "type": "TargetFleetDetails", + "id": 3 + } + }, + "nested": { + "TargetFleetDetails": { + "fields": { + "fleet": { + "type": "TargetFleet", + "id": 1 + }, + "autoscaler": { + "type": "TargetFleetAutoscaler", + "id": 2 + } + }, + "nested": { + "TargetFleet": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "specSource": { + "type": "SpecSource", + "id": 2 + } + } + }, + "TargetFleetAutoscaler": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "specSource": { + "type": "SpecSource", + "id": 2 + } + } + } + } + } + } + }, + "TargetState": { + "fields": { + "details": { + "rule": "repeated", + "type": "TargetDetails", + "id": 1 + } + } + }, + "DeployedFleetDetails": { + "fields": { + "deployedFleet": { + "type": "DeployedFleet", + "id": 1 + }, + "deployedAutoscaler": { + "type": "DeployedFleetAutoscaler", + "id": 2 + } + }, + "nested": { + "DeployedFleet": { + "fields": { + "fleet": { + "type": "string", + "id": 1 + }, + "fleetSpec": { + "type": "string", + "id": 2 + }, + "specSource": { + "type": "SpecSource", + "id": 3 + }, + "status": { + "type": "DeployedFleetStatus", + "id": 5 + } + }, + "nested": { + "DeployedFleetStatus": { + "fields": { + "readyReplicas": { + "type": "int64", + "id": 1 + }, + "allocatedReplicas": { + "type": "int64", + "id": 2 + }, + "reservedReplicas": { + "type": "int64", + "id": 3 + }, + "replicas": { + "type": "int64", + "id": 4 + } + } + } + } + }, + "DeployedFleetAutoscaler": { + "fields": { + "autoscaler": { + "type": "string", + "id": 1 + }, + "specSource": { + "type": "SpecSource", + "id": 4 + }, + "fleetAutoscalerSpec": { + "type": "string", + "id": 3 + } + } + } + } + }, + "ListGameServerClustersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListGameServerClustersResponse": { + "fields": { + "gameServerClusters": { + "rule": "repeated", + "type": "GameServerCluster", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 4 + } + } + }, + "GetGameServerClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" + } + } + } + }, + "CreateGameServerClusterRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" + } + }, + "gameServerClusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gameServerCluster": { + "type": "GameServerCluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PreviewCreateGameServerClusterRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" + } + }, + "gameServerClusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gameServerCluster": { + "type": "GameServerCluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "previewTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PreviewCreateGameServerClusterResponse": { + "fields": { + "etag": { + "type": "string", + "id": 2 + }, + "targetState": { + "type": "TargetState", + "id": 3 + } + } + }, + "DeleteGameServerClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" + } + } + } + }, + "PreviewDeleteGameServerClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" + } + }, + "previewTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PreviewDeleteGameServerClusterResponse": { + "fields": { + "etag": { + "type": "string", + "id": 2 + }, + "targetState": { + "type": "TargetState", + "id": 3 + } + } + }, + "UpdateGameServerClusterRequest": { + "fields": { + "gameServerCluster": { + "type": "GameServerCluster", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PreviewUpdateGameServerClusterRequest": { + "fields": { + "gameServerCluster": { + "type": "GameServerCluster", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "previewTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PreviewUpdateGameServerClusterResponse": { + "fields": { + "etag": { + "type": "string", + "id": 2 + }, + "targetState": { + "type": "TargetState", + "id": 3 + } + } + }, + "GameServerClusterConnectionInfo": { + "oneofs": { + "clusterReference": { + "oneof": [ + "gkeClusterReference" + ] + } + }, + "fields": { + "gkeClusterReference": { + "type": "GkeClusterReference", + "id": 7 + }, + "namespace": { + "type": "string", + "id": 5 + } + } + }, + "GkeClusterReference": { + "fields": { + "cluster": { + "type": "string", + "id": 1 + } + } + }, + "GameServerCluster": { + "options": { + "(google.api.resource).type": "gameservices.googleapis.com/GameServerCluster", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "connectionInfo": { + "type": "GameServerClusterConnectionInfo", + "id": 5 + }, + "etag": { + "type": "string", + "id": 6 + }, + "description": { + "type": "string", + "id": 7 + } + } + }, + "GameServerClustersService": { + "options": { + "(google.api.default_host)": "gameservices.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListGameServerClusters": { + "requestType": "ListGameServerClustersRequest", + "responseType": "ListGameServerClustersResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/realms/*}/gameServerClusters", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/realms/*}/gameServerClusters" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetGameServerCluster": { + "requestType": "GetGameServerClusterRequest", + "responseType": "GameServerCluster", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/realms/*/gameServerClusters/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/realms/*/gameServerClusters/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateGameServerCluster": { + "requestType": "CreateGameServerClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/realms/*}/gameServerClusters", + "(google.api.http).body": "game_server_cluster", + "(google.api.method_signature)": "parent,game_server_cluster,game_server_cluster_id", + "(google.longrunning.operation_info).response_type": "GameServerCluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/realms/*}/gameServerClusters", + "body": "game_server_cluster" + } + }, + { + "(google.api.method_signature)": "parent,game_server_cluster,game_server_cluster_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "GameServerCluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "PreviewCreateGameServerCluster": { + "requestType": "PreviewCreateGameServerClusterRequest", + "responseType": "PreviewCreateGameServerClusterResponse", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/realms/*}/gameServerClusters:previewCreate", + "(google.api.http).body": "game_server_cluster" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/realms/*}/gameServerClusters:previewCreate", + "body": "game_server_cluster" + } + } + ] + }, + "DeleteGameServerCluster": { + "requestType": "DeleteGameServerClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/realms/*/gameServerClusters/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/realms/*/gameServerClusters/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "PreviewDeleteGameServerCluster": { + "requestType": "PreviewDeleteGameServerClusterRequest", + "responseType": "PreviewDeleteGameServerClusterResponse", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/realms/*/gameServerClusters/*}:previewDelete" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/realms/*/gameServerClusters/*}:previewDelete" + } + } + ] + }, + "UpdateGameServerCluster": { + "requestType": "UpdateGameServerClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta/{game_server_cluster.name=projects/*/locations/*/realms/*/gameServerClusters/*}", + "(google.api.http).body": "game_server_cluster", + "(google.api.method_signature)": "game_server_cluster,update_mask", + "(google.longrunning.operation_info).response_type": "GameServerCluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{game_server_cluster.name=projects/*/locations/*/realms/*/gameServerClusters/*}", + "body": "game_server_cluster" + } + }, + { + "(google.api.method_signature)": "game_server_cluster,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "GameServerCluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "PreviewUpdateGameServerCluster": { + "requestType": "PreviewUpdateGameServerClusterRequest", + "responseType": "PreviewUpdateGameServerClusterResponse", + "options": { + "(google.api.http).patch": "/v1beta/{game_server_cluster.name=projects/*/locations/*/realms/*/gameServerClusters/*}:previewUpdate", + "(google.api.http).body": "game_server_cluster" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{game_server_cluster.name=projects/*/locations/*/realms/*/gameServerClusters/*}:previewUpdate", + "body": "game_server_cluster" + } + } + ] + } + } + }, + "ListGameServerConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerConfig" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListGameServerConfigsResponse": { + "fields": { + "gameServerConfigs": { + "rule": "repeated", + "type": "GameServerConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 4 + } + } + }, + "GetGameServerConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerConfig" + } + } + } + }, + "CreateGameServerConfigRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerConfig" + } + }, + "configId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gameServerConfig": { + "type": "GameServerConfig", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteGameServerConfigRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerConfig" + } + } + } + }, + "ScalingConfig": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "fleetAutoscalerSpec": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "selectors": { + "rule": "repeated", + "type": "LabelSelector", + "id": 4 + }, + "schedules": { + "rule": "repeated", + "type": "Schedule", + "id": 5 + } + } + }, + "FleetConfig": { + "fields": { + "fleetSpec": { + "type": "string", + "id": 1 + }, + "name": { + "type": "string", + "id": 2 + } + } + }, + "GameServerConfig": { + "options": { + "(google.api.resource).type": "gameservices.googleapis.com/GameServerConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "fleetConfigs": { + "rule": "repeated", + "type": "FleetConfig", + "id": 5 + }, + "scalingConfigs": { + "rule": "repeated", + "type": "ScalingConfig", + "id": 6 + }, + "description": { + "type": "string", + "id": 7 + } + } + }, + "GameServerConfigsService": { + "options": { + "(google.api.default_host)": "gameservices.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListGameServerConfigs": { + "requestType": "ListGameServerConfigsRequest", + "responseType": "ListGameServerConfigsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*/gameServerDeployments/*}/configs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*/gameServerDeployments/*}/configs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetGameServerConfig": { + "requestType": "GetGameServerConfigRequest", + "responseType": "GameServerConfig", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*/configs/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*/configs/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateGameServerConfig": { + "requestType": "CreateGameServerConfigRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/gameServerDeployments/*}/configs", + "(google.api.http).body": "game_server_config", + "(google.api.method_signature)": "parent,game_server_config", + "(google.longrunning.operation_info).response_type": "GameServerConfig", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*/gameServerDeployments/*}/configs", + "body": "game_server_config" + } + }, + { + "(google.api.method_signature)": "parent,game_server_config" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "GameServerConfig", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteGameServerConfig": { + "requestType": "DeleteGameServerConfigRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*/configs/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*/configs/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "ListGameServerDeploymentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerDeployment" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListGameServerDeploymentsResponse": { + "fields": { + "gameServerDeployments": { + "rule": "repeated", + "type": "GameServerDeployment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 4 + } + } + }, + "GetGameServerDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerDeployment" + } + } + } + }, + "GetGameServerDeploymentRolloutRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerDeployment" + } + } + } + }, + "CreateGameServerDeploymentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerDeployment" + } + }, + "deploymentId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "gameServerDeployment": { + "type": "GameServerDeployment", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteGameServerDeploymentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerDeployment" + } + } + } + }, + "UpdateGameServerDeploymentRequest": { + "fields": { + "gameServerDeployment": { + "type": "GameServerDeployment", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateGameServerDeploymentRolloutRequest": { + "fields": { + "rollout": { + "type": "GameServerDeploymentRollout", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "FetchDeploymentStateRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "FetchDeploymentStateResponse": { + "fields": { + "clusterState": { + "rule": "repeated", + "type": "DeployedClusterState", + "id": 1 + }, + "unavailable": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "DeployedClusterState": { + "fields": { + "cluster": { + "type": "string", + "id": 1 + }, + "fleetDetails": { + "rule": "repeated", + "type": "DeployedFleetDetails", + "id": 2 + } + } + } + } + }, + "GameServerDeployment": { + "options": { + "(google.api.resource).type": "gameservices.googleapis.com/GameServerDeployment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/gameServerDeployments/{deployment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "etag": { + "type": "string", + "id": 7 + }, + "description": { + "type": "string", + "id": 8 + } + } + }, + "GameServerConfigOverride": { + "oneofs": { + "selector": { + "oneof": [ + "realmsSelector" + ] + }, + "change": { + "oneof": [ + "configVersion" + ] + } + }, + "fields": { + "realmsSelector": { + "type": "RealmSelector", + "id": 1 + }, + "configVersion": { + "type": "string", + "id": 100 + } + } + }, + "GameServerDeploymentRollout": { + "options": { + "(google.api.resource).type": "gameservices.googleapis.com/GameServerDeploymentRollout", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "defaultGameServerConfig": { + "type": "string", + "id": 4 + }, + "gameServerConfigOverrides": { + "rule": "repeated", + "type": "GameServerConfigOverride", + "id": 5 + }, + "etag": { + "type": "string", + "id": 6 + } + } + }, + "PreviewGameServerDeploymentRolloutRequest": { + "fields": { + "rollout": { + "type": "GameServerDeploymentRollout", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "previewTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PreviewGameServerDeploymentRolloutResponse": { + "fields": { + "unavailable": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "etag": { + "type": "string", + "id": 3 + }, + "targetState": { + "type": "TargetState", + "id": 4 + } + } + }, + "GameServerDeploymentsService": { + "options": { + "(google.api.default_host)": "gameservices.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListGameServerDeployments": { + "requestType": "ListGameServerDeploymentsRequest", + "responseType": "ListGameServerDeploymentsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*}/gameServerDeployments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*}/gameServerDeployments" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetGameServerDeployment": { + "requestType": "GetGameServerDeploymentRequest", + "responseType": "GameServerDeployment", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateGameServerDeployment": { + "requestType": "CreateGameServerDeploymentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*}/gameServerDeployments", + "(google.api.http).body": "game_server_deployment", + "(google.api.method_signature)": "parent,game_server_deployment", + "(google.longrunning.operation_info).response_type": "GameServerDeployment", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*}/gameServerDeployments", + "body": "game_server_deployment" + } + }, + { + "(google.api.method_signature)": "parent,game_server_deployment" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "GameServerDeployment", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteGameServerDeployment": { + "requestType": "DeleteGameServerDeploymentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateGameServerDeployment": { + "requestType": "UpdateGameServerDeploymentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta/{game_server_deployment.name=projects/*/locations/*/gameServerDeployments/*}", + "(google.api.http).body": "game_server_deployment", + "(google.api.method_signature)": "game_server_deployment,update_mask", + "(google.longrunning.operation_info).response_type": "GameServerDeployment", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{game_server_deployment.name=projects/*/locations/*/gameServerDeployments/*}", + "body": "game_server_deployment" + } + }, + { + "(google.api.method_signature)": "game_server_deployment,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "GameServerDeployment", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetGameServerDeploymentRollout": { + "requestType": "GetGameServerDeploymentRolloutRequest", + "responseType": "GameServerDeploymentRollout", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*}/rollout", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*}/rollout" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateGameServerDeploymentRollout": { + "requestType": "UpdateGameServerDeploymentRolloutRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta/{rollout.name=projects/*/locations/*/gameServerDeployments/*}/rollout", + "(google.api.http).body": "rollout", + "(google.api.method_signature)": "rollout,update_mask", + "(google.longrunning.operation_info).response_type": "GameServerDeployment", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{rollout.name=projects/*/locations/*/gameServerDeployments/*}/rollout", + "body": "rollout" + } + }, + { + "(google.api.method_signature)": "rollout,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "GameServerDeployment", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "PreviewGameServerDeploymentRollout": { + "requestType": "PreviewGameServerDeploymentRolloutRequest", + "responseType": "PreviewGameServerDeploymentRolloutResponse", + "options": { + "(google.api.http).patch": "/v1beta/{rollout.name=projects/*/locations/*/gameServerDeployments/*}/rollout:preview", + "(google.api.http).body": "rollout" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{rollout.name=projects/*/locations/*/gameServerDeployments/*}/rollout:preview", + "body": "rollout" + } + } + ] + }, + "FetchDeploymentState": { + "requestType": "FetchDeploymentStateRequest", + "responseType": "FetchDeploymentStateResponse", + "options": { + "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*}:fetchDeploymentState", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*}:fetchDeploymentState", + "body": "*" + } + } + ] + } + } + }, + "ListRealmsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/Realm" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListRealmsResponse": { + "fields": { + "realms": { + "rule": "repeated", + "type": "Realm", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetRealmRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/Realm" + } + } + } + }, + "CreateRealmRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/Realm" + } + }, + "realmId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "realm": { + "type": "Realm", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteRealmRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/Realm" + } + } + } + }, + "UpdateRealmRequest": { + "fields": { + "realm": { + "type": "Realm", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "PreviewRealmUpdateRequest": { + "fields": { + "realm": { + "type": "Realm", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "previewTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PreviewRealmUpdateResponse": { + "fields": { + "etag": { + "type": "string", + "id": 2 + }, + "targetState": { + "type": "TargetState", + "id": 3 + } + } + }, + "Realm": { + "options": { + "(google.api.resource).type": "gameservices.googleapis.com/Realm", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/realms/{realm}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4 + }, + "timeZone": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "etag": { + "type": "string", + "id": 7 + }, + "description": { + "type": "string", + "id": 8 + } + } + }, + "RealmsService": { + "options": { + "(google.api.default_host)": "gameservices.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListRealms": { + "requestType": "ListRealmsRequest", + "responseType": "ListRealmsResponse", + "options": { + "(google.api.http).get": "/v1beta/{parent=projects/*/locations/*}/realms", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{parent=projects/*/locations/*}/realms" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetRealm": { + "requestType": "GetRealmRequest", + "responseType": "Realm", + "options": { + "(google.api.http).get": "/v1beta/{name=projects/*/locations/*/realms/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta/{name=projects/*/locations/*/realms/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateRealm": { + "requestType": "CreateRealmRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*}/realms", + "(google.api.http).body": "realm", + "(google.api.method_signature)": "parent,realm,realm_id", + "(google.longrunning.operation_info).response_type": "Realm", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta/{parent=projects/*/locations/*}/realms", + "body": "realm" + } + }, + { + "(google.api.method_signature)": "parent,realm,realm_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Realm", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteRealm": { + "requestType": "DeleteRealmRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/realms/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta/{name=projects/*/locations/*/realms/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateRealm": { + "requestType": "UpdateRealmRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta/{realm.name=projects/*/locations/*/realms/*}", + "(google.api.http).body": "realm", + "(google.api.method_signature)": "realm,update_mask", + "(google.longrunning.operation_info).response_type": "Realm", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{realm.name=projects/*/locations/*/realms/*}", + "body": "realm" + } + }, + { + "(google.api.method_signature)": "realm,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Realm", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "PreviewRealmUpdate": { + "requestType": "PreviewRealmUpdateRequest", + "responseType": "PreviewRealmUpdateResponse", + "options": { + "(google.api.http).patch": "/v1beta/{realm.name=projects/*/locations/*/realms/*}:previewUpdate", + "(google.api.http).body": "realm" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta/{realm.name=projects/*/locations/*/realms/*}:previewUpdate", + "body": "realm" + } + } + ] + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ClientProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + } + } + }, + "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-gaming/samples/README.md b/packages/google-cloud-gaming/samples/README.md new file mode 100644 index 00000000000..682bb9f5cb6 --- /dev/null +++ b/packages/google-cloud-gaming/samples/README.md @@ -0,0 +1,1042 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google Cloud Game Servers: 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) + * [Game_server_clusters_service.create_game_server_cluster](#game_server_clusters_service.create_game_server_cluster) + * [Game_server_clusters_service.delete_game_server_cluster](#game_server_clusters_service.delete_game_server_cluster) + * [Game_server_clusters_service.get_game_server_cluster](#game_server_clusters_service.get_game_server_cluster) + * [Game_server_clusters_service.list_game_server_clusters](#game_server_clusters_service.list_game_server_clusters) + * [Game_server_clusters_service.preview_create_game_server_cluster](#game_server_clusters_service.preview_create_game_server_cluster) + * [Game_server_clusters_service.preview_delete_game_server_cluster](#game_server_clusters_service.preview_delete_game_server_cluster) + * [Game_server_clusters_service.preview_update_game_server_cluster](#game_server_clusters_service.preview_update_game_server_cluster) + * [Game_server_clusters_service.update_game_server_cluster](#game_server_clusters_service.update_game_server_cluster) + * [Game_server_configs_service.create_game_server_config](#game_server_configs_service.create_game_server_config) + * [Game_server_configs_service.delete_game_server_config](#game_server_configs_service.delete_game_server_config) + * [Game_server_configs_service.get_game_server_config](#game_server_configs_service.get_game_server_config) + * [Game_server_configs_service.list_game_server_configs](#game_server_configs_service.list_game_server_configs) + * [Game_server_deployments_service.create_game_server_deployment](#game_server_deployments_service.create_game_server_deployment) + * [Game_server_deployments_service.delete_game_server_deployment](#game_server_deployments_service.delete_game_server_deployment) + * [Game_server_deployments_service.fetch_deployment_state](#game_server_deployments_service.fetch_deployment_state) + * [Game_server_deployments_service.get_game_server_deployment](#game_server_deployments_service.get_game_server_deployment) + * [Game_server_deployments_service.get_game_server_deployment_rollout](#game_server_deployments_service.get_game_server_deployment_rollout) + * [Game_server_deployments_service.list_game_server_deployments](#game_server_deployments_service.list_game_server_deployments) + * [Game_server_deployments_service.preview_game_server_deployment_rollout](#game_server_deployments_service.preview_game_server_deployment_rollout) + * [Game_server_deployments_service.update_game_server_deployment](#game_server_deployments_service.update_game_server_deployment) + * [Game_server_deployments_service.update_game_server_deployment_rollout](#game_server_deployments_service.update_game_server_deployment_rollout) + * [Realms_service.create_realm](#realms_service.create_realm) + * [Realms_service.delete_realm](#realms_service.delete_realm) + * [Realms_service.get_realm](#realms_service.get_realm) + * [Realms_service.list_realms](#realms_service.list_realms) + * [Realms_service.preview_realm_update](#realms_service.preview_realm_update) + * [Realms_service.update_realm](#realms_service.update_realm) + * [Game_server_clusters_service.create_game_server_cluster](#game_server_clusters_service.create_game_server_cluster) + * [Game_server_clusters_service.delete_game_server_cluster](#game_server_clusters_service.delete_game_server_cluster) + * [Game_server_clusters_service.get_game_server_cluster](#game_server_clusters_service.get_game_server_cluster) + * [Game_server_clusters_service.list_game_server_clusters](#game_server_clusters_service.list_game_server_clusters) + * [Game_server_clusters_service.preview_create_game_server_cluster](#game_server_clusters_service.preview_create_game_server_cluster) + * [Game_server_clusters_service.preview_delete_game_server_cluster](#game_server_clusters_service.preview_delete_game_server_cluster) + * [Game_server_clusters_service.preview_update_game_server_cluster](#game_server_clusters_service.preview_update_game_server_cluster) + * [Game_server_clusters_service.update_game_server_cluster](#game_server_clusters_service.update_game_server_cluster) + * [Game_server_configs_service.create_game_server_config](#game_server_configs_service.create_game_server_config) + * [Game_server_configs_service.delete_game_server_config](#game_server_configs_service.delete_game_server_config) + * [Game_server_configs_service.get_game_server_config](#game_server_configs_service.get_game_server_config) + * [Game_server_configs_service.list_game_server_configs](#game_server_configs_service.list_game_server_configs) + * [Game_server_deployments_service.create_game_server_deployment](#game_server_deployments_service.create_game_server_deployment) + * [Game_server_deployments_service.delete_game_server_deployment](#game_server_deployments_service.delete_game_server_deployment) + * [Game_server_deployments_service.fetch_deployment_state](#game_server_deployments_service.fetch_deployment_state) + * [Game_server_deployments_service.get_game_server_deployment](#game_server_deployments_service.get_game_server_deployment) + * [Game_server_deployments_service.get_game_server_deployment_rollout](#game_server_deployments_service.get_game_server_deployment_rollout) + * [Game_server_deployments_service.list_game_server_deployments](#game_server_deployments_service.list_game_server_deployments) + * [Game_server_deployments_service.preview_game_server_deployment_rollout](#game_server_deployments_service.preview_game_server_deployment_rollout) + * [Game_server_deployments_service.update_game_server_deployment](#game_server_deployments_service.update_game_server_deployment) + * [Game_server_deployments_service.update_game_server_deployment_rollout](#game_server_deployments_service.update_game_server_deployment_rollout) + * [Realms_service.create_realm](#realms_service.create_realm) + * [Realms_service.delete_realm](#realms_service.delete_realm) + * [Realms_service.get_realm](#realms_service.get_realm) + * [Realms_service.list_realms](#realms_service.list_realms) + * [Realms_service.preview_realm_update](#realms_service.preview_realm_update) + * [Realms_service.update_realm](#realms_service.update_realm) + * [Create Game Server Realm](#create-game-server-realm) + * [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 + + + +### Game_server_clusters_service.create_game_server_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.create_game_server_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.create_game_server_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.create_game_server_cluster.js` + + +----- + + + + +### Game_server_clusters_service.delete_game_server_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.delete_game_server_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.delete_game_server_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.delete_game_server_cluster.js` + + +----- + + + + +### Game_server_clusters_service.get_game_server_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.get_game_server_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.get_game_server_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.get_game_server_cluster.js` + + +----- + + + + +### Game_server_clusters_service.list_game_server_clusters + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.list_game_server_clusters.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.list_game_server_clusters.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.list_game_server_clusters.js` + + +----- + + + + +### Game_server_clusters_service.preview_create_game_server_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_create_game_server_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_create_game_server_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_create_game_server_cluster.js` + + +----- + + + + +### Game_server_clusters_service.preview_delete_game_server_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_delete_game_server_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_delete_game_server_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_delete_game_server_cluster.js` + + +----- + + + + +### Game_server_clusters_service.preview_update_game_server_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_update_game_server_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_update_game_server_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_update_game_server_cluster.js` + + +----- + + + + +### Game_server_clusters_service.update_game_server_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.update_game_server_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.update_game_server_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.update_game_server_cluster.js` + + +----- + + + + +### Game_server_configs_service.create_game_server_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.create_game_server_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.create_game_server_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.create_game_server_config.js` + + +----- + + + + +### Game_server_configs_service.delete_game_server_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.delete_game_server_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.delete_game_server_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.delete_game_server_config.js` + + +----- + + + + +### Game_server_configs_service.get_game_server_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.get_game_server_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.get_game_server_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.get_game_server_config.js` + + +----- + + + + +### Game_server_configs_service.list_game_server_configs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.list_game_server_configs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.list_game_server_configs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.list_game_server_configs.js` + + +----- + + + + +### Game_server_deployments_service.create_game_server_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.create_game_server_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-gaming/samples/generated/v1/game_server_deployments_service.create_game_server_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.create_game_server_deployment.js` + + +----- + + + + +### Game_server_deployments_service.delete_game_server_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.delete_game_server_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-gaming/samples/generated/v1/game_server_deployments_service.delete_game_server_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.delete_game_server_deployment.js` + + +----- + + + + +### Game_server_deployments_service.fetch_deployment_state + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.fetch_deployment_state.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.fetch_deployment_state.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.fetch_deployment_state.js` + + +----- + + + + +### Game_server_deployments_service.get_game_server_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.get_game_server_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-gaming/samples/generated/v1/game_server_deployments_service.get_game_server_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.get_game_server_deployment.js` + + +----- + + + + +### Game_server_deployments_service.get_game_server_deployment_rollout + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.get_game_server_deployment_rollout.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.get_game_server_deployment_rollout.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.get_game_server_deployment_rollout.js` + + +----- + + + + +### Game_server_deployments_service.list_game_server_deployments + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.list_game_server_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-gaming/samples/generated/v1/game_server_deployments_service.list_game_server_deployments.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.list_game_server_deployments.js` + + +----- + + + + +### Game_server_deployments_service.preview_game_server_deployment_rollout + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.preview_game_server_deployment_rollout.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.preview_game_server_deployment_rollout.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.preview_game_server_deployment_rollout.js` + + +----- + + + + +### Game_server_deployments_service.update_game_server_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.update_game_server_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-gaming/samples/generated/v1/game_server_deployments_service.update_game_server_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.update_game_server_deployment.js` + + +----- + + + + +### Game_server_deployments_service.update_game_server_deployment_rollout + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.update_game_server_deployment_rollout.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.update_game_server_deployment_rollout.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.update_game_server_deployment_rollout.js` + + +----- + + + + +### Realms_service.create_realm + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/realms_service.create_realm.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/realms_service.create_realm.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/realms_service.create_realm.js` + + +----- + + + + +### Realms_service.delete_realm + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/realms_service.delete_realm.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/realms_service.delete_realm.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/realms_service.delete_realm.js` + + +----- + + + + +### Realms_service.get_realm + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/realms_service.get_realm.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/realms_service.get_realm.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/realms_service.get_realm.js` + + +----- + + + + +### Realms_service.list_realms + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/realms_service.list_realms.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/realms_service.list_realms.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/realms_service.list_realms.js` + + +----- + + + + +### Realms_service.preview_realm_update + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/realms_service.preview_realm_update.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/realms_service.preview_realm_update.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/realms_service.preview_realm_update.js` + + +----- + + + + +### Realms_service.update_realm + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1/realms_service.update_realm.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1/realms_service.update_realm.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1/realms_service.update_realm.js` + + +----- + + + + +### Game_server_clusters_service.create_game_server_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.create_game_server_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.create_game_server_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.create_game_server_cluster.js` + + +----- + + + + +### Game_server_clusters_service.delete_game_server_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.delete_game_server_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.delete_game_server_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.delete_game_server_cluster.js` + + +----- + + + + +### Game_server_clusters_service.get_game_server_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.get_game_server_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.get_game_server_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.get_game_server_cluster.js` + + +----- + + + + +### Game_server_clusters_service.list_game_server_clusters + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.list_game_server_clusters.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.list_game_server_clusters.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.list_game_server_clusters.js` + + +----- + + + + +### Game_server_clusters_service.preview_create_game_server_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_create_game_server_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_create_game_server_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_create_game_server_cluster.js` + + +----- + + + + +### Game_server_clusters_service.preview_delete_game_server_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_delete_game_server_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_delete_game_server_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_delete_game_server_cluster.js` + + +----- + + + + +### Game_server_clusters_service.preview_update_game_server_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_update_game_server_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_update_game_server_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_update_game_server_cluster.js` + + +----- + + + + +### Game_server_clusters_service.update_game_server_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.update_game_server_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.update_game_server_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.update_game_server_cluster.js` + + +----- + + + + +### Game_server_configs_service.create_game_server_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.create_game_server_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.create_game_server_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.create_game_server_config.js` + + +----- + + + + +### Game_server_configs_service.delete_game_server_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.delete_game_server_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.delete_game_server_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.delete_game_server_config.js` + + +----- + + + + +### Game_server_configs_service.get_game_server_config + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.get_game_server_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.get_game_server_config.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.get_game_server_config.js` + + +----- + + + + +### Game_server_configs_service.list_game_server_configs + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.list_game_server_configs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.list_game_server_configs.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.list_game_server_configs.js` + + +----- + + + + +### Game_server_deployments_service.create_game_server_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.create_game_server_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-gaming/samples/generated/v1beta/game_server_deployments_service.create_game_server_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.create_game_server_deployment.js` + + +----- + + + + +### Game_server_deployments_service.delete_game_server_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.delete_game_server_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-gaming/samples/generated/v1beta/game_server_deployments_service.delete_game_server_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.delete_game_server_deployment.js` + + +----- + + + + +### Game_server_deployments_service.fetch_deployment_state + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.fetch_deployment_state.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.fetch_deployment_state.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.fetch_deployment_state.js` + + +----- + + + + +### Game_server_deployments_service.get_game_server_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.get_game_server_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-gaming/samples/generated/v1beta/game_server_deployments_service.get_game_server_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.get_game_server_deployment.js` + + +----- + + + + +### Game_server_deployments_service.get_game_server_deployment_rollout + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.get_game_server_deployment_rollout.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.get_game_server_deployment_rollout.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.get_game_server_deployment_rollout.js` + + +----- + + + + +### Game_server_deployments_service.list_game_server_deployments + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.list_game_server_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-gaming/samples/generated/v1beta/game_server_deployments_service.list_game_server_deployments.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.list_game_server_deployments.js` + + +----- + + + + +### Game_server_deployments_service.preview_game_server_deployment_rollout + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.preview_game_server_deployment_rollout.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.preview_game_server_deployment_rollout.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.preview_game_server_deployment_rollout.js` + + +----- + + + + +### Game_server_deployments_service.update_game_server_deployment + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.update_game_server_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-gaming/samples/generated/v1beta/game_server_deployments_service.update_game_server_deployment.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.update_game_server_deployment.js` + + +----- + + + + +### Game_server_deployments_service.update_game_server_deployment_rollout + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.update_game_server_deployment_rollout.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.update_game_server_deployment_rollout.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.update_game_server_deployment_rollout.js` + + +----- + + + + +### Realms_service.create_realm + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.create_realm.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/realms_service.create_realm.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/realms_service.create_realm.js` + + +----- + + + + +### Realms_service.delete_realm + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.delete_realm.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/realms_service.delete_realm.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/realms_service.delete_realm.js` + + +----- + + + + +### Realms_service.get_realm + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.get_realm.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/realms_service.get_realm.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/realms_service.get_realm.js` + + +----- + + + + +### Realms_service.list_realms + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.list_realms.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/realms_service.list_realms.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/realms_service.list_realms.js` + + +----- + + + + +### Realms_service.preview_realm_update + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.preview_realm_update.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/realms_service.preview_realm_update.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/realms_service.preview_realm_update.js` + + +----- + + + + +### Realms_service.update_realm + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.update_realm.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-gaming/samples/generated/v1beta/realms_service.update_realm.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/samples/generated/v1beta/realms_service.update_realm.js` + + +----- + + + + +### Create Game Server Realm + +Creates a new Realm within Cloud Game Servers + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/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-gaming/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node quickstart.js ` + + +----- + + + + +### Quickstart.test + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/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-gaming/samples/test/quickstart.test.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-gaming/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/game-servers/ diff --git a/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.create_game_server_cluster.js b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.create_game_server_cluster.js new file mode 100644 index 00000000000..b9a8eecf7d7 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.create_game_server_cluster.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, gameServerClusterId, gameServerCluster) { + // [START gameservices_v1_generated_GameServerClustersService_CreateGameServerCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 following form: + * `projects/{project}/locations/{location}/realms/{realm-id}`. + */ + // const parent = 'abc123' + /** + * Required. The ID of the game server cluster resource to be created. + */ + // const gameServerClusterId = 'abc123' + /** + * Required. The game server cluster resource to be created. + */ + // const gameServerCluster = {} + + // Imports the Gaming library + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function callCreateGameServerCluster() { + // Construct request + const request = { + parent, + gameServerClusterId, + gameServerCluster, + }; + + // Run request + const [operation] = await gamingClient.createGameServerCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateGameServerCluster(); + // [END gameservices_v1_generated_GameServerClustersService_CreateGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.delete_game_server_cluster.js b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.delete_game_server_cluster.js new file mode 100644 index 00000000000..1966da6a808 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.delete_game_server_cluster.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 gameservices_v1_generated_GameServerClustersService_DeleteGameServerCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server cluster to delete, in the following form: + * `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function callDeleteGameServerCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteGameServerCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteGameServerCluster(); + // [END gameservices_v1_generated_GameServerClustersService_DeleteGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.get_game_server_cluster.js b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.get_game_server_cluster.js new file mode 100644 index 00000000000..6a741c5ce8a --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.get_game_server_cluster.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 gameservices_v1_generated_GameServerClustersService_GetGameServerCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server cluster to retrieve, in the following form: + * `projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`. + */ + // const name = 'abc123' + /** + * Optional. View for the returned GameServerCluster objects. When `FULL` is + * specified, the `cluster_state` field is also returned in the + * GameServerCluster object, which includes the state of the referenced + * Kubernetes cluster such as versions and provider info. The default/unset + * value is GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED, same as BASIC, which does + * not return the `cluster_state` field. + */ + // const view = {} + + // Imports the Gaming library + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function callGetGameServerCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerCluster(request); + console.log(response); + } + + callGetGameServerCluster(); + // [END gameservices_v1_generated_GameServerClustersService_GetGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.list_game_server_clusters.js b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.list_game_server_clusters.js new file mode 100644 index 00000000000..f6411da17ba --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.list_game_server_clusters.js @@ -0,0 +1,94 @@ +// 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 gameservices_v1_generated_GameServerClustersService_ListGameServerClusters_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 following form: + * "projects/{project}/locations/{location}/realms/{realm}". + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of items to return. If unspecified, the server + * will pick an appropriate default. The server may return fewer items than + * requested. A caller should only rely on response's + * next_page_token google.cloud.gaming.v1.ListGameServerClustersResponse.next_page_token to + * determine if there are more GameServerClusters left to be queried. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous List request, if any. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + */ + // const orderBy = 'abc123' + /** + * Optional. View for the returned GameServerCluster objects. When `FULL` is + * specified, the `cluster_state` field is also returned in the + * GameServerCluster object, which includes the state of the referenced + * Kubernetes cluster such as versions and provider info. The default/unset + * value is GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED, same as BASIC, which does + * not return the `cluster_state` field. + */ + // const view = {} + + // Imports the Gaming library + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function callListGameServerClusters() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listGameServerClustersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListGameServerClusters(); + // [END gameservices_v1_generated_GameServerClustersService_ListGameServerClusters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_create_game_server_cluster.js b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_create_game_server_cluster.js new file mode 100644 index 00000000000..0713a62e3d7 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_create_game_server_cluster.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, gameServerClusterId, gameServerCluster) { + // [START gameservices_v1_generated_GameServerClustersService_PreviewCreateGameServerCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 following form: + * `projects/{project}/locations/{location}/realms/{realm}`. + */ + // const parent = 'abc123' + /** + * Required. The ID of the game server cluster resource to be created. + */ + // const gameServerClusterId = 'abc123' + /** + * Required. The game server cluster resource to be created. + */ + // const gameServerCluster = {} + /** + * Optional. The target timestamp to compute the preview. + */ + // const previewTime = {} + /** + * Optional. This field is deprecated, preview will always return + * KubernetesClusterState. + */ + // const view = {} + + // Imports the Gaming library + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function callPreviewCreateGameServerCluster() { + // Construct request + const request = { + parent, + gameServerClusterId, + gameServerCluster, + }; + + // Run request + const response = await gamingClient.previewCreateGameServerCluster(request); + console.log(response); + } + + callPreviewCreateGameServerCluster(); + // [END gameservices_v1_generated_GameServerClustersService_PreviewCreateGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_delete_game_server_cluster.js b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_delete_game_server_cluster.js new file mode 100644 index 00000000000..786f351980d --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_delete_game_server_cluster.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 gameservices_v1_generated_GameServerClustersService_PreviewDeleteGameServerCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server cluster to delete, in the following form: + * `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. + */ + // const name = 'abc123' + /** + * Optional. The target timestamp to compute the preview. + */ + // const previewTime = {} + + // Imports the Gaming library + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function callPreviewDeleteGameServerCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.previewDeleteGameServerCluster(request); + console.log(response); + } + + callPreviewDeleteGameServerCluster(); + // [END gameservices_v1_generated_GameServerClustersService_PreviewDeleteGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_update_game_server_cluster.js b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_update_game_server_cluster.js new file mode 100644 index 00000000000..6348196369d --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_update_game_server_cluster.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(gameServerCluster, updateMask) { + // [START gameservices_v1_generated_GameServerClustersService_PreviewUpdateGameServerCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server cluster to be updated. + * Only fields specified in update_mask are updated. + */ + // const gameServerCluster = {} + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + */ + // const updateMask = {} + /** + * Optional. The target timestamp to compute the preview. + */ + // const previewTime = {} + + // Imports the Gaming library + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function callPreviewUpdateGameServerCluster() { + // Construct request + const request = { + gameServerCluster, + updateMask, + }; + + // Run request + const response = await gamingClient.previewUpdateGameServerCluster(request); + console.log(response); + } + + callPreviewUpdateGameServerCluster(); + // [END gameservices_v1_generated_GameServerClustersService_PreviewUpdateGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.update_game_server_cluster.js b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.update_game_server_cluster.js new file mode 100644 index 00000000000..4da22444a26 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.update_game_server_cluster.js @@ -0,0 +1,70 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(gameServerCluster, updateMask) { + // [START gameservices_v1_generated_GameServerClustersService_UpdateGameServerCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server cluster to be updated. + * Only fields specified in update_mask are updated. + */ + // const gameServerCluster = {} + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + */ + // const updateMask = {} + + // Imports the Gaming library + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function callUpdateGameServerCluster() { + // Construct request + const request = { + gameServerCluster, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateGameServerCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateGameServerCluster(); + // [END gameservices_v1_generated_GameServerClustersService_UpdateGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.create_game_server_config.js b/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.create_game_server_config.js new file mode 100644 index 00000000000..78e713d7911 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.create_game_server_config.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, configId, gameServerConfig) { + // [START gameservices_v1_generated_GameServerConfigsService_CreateGameServerConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/`. + */ + // const parent = 'abc123' + /** + * Required. The ID of the game server config resource to be created. + */ + // const configId = 'abc123' + /** + * Required. The game server config resource to be created. + */ + // const gameServerConfig = {} + + // Imports the Gaming library + const {GameServerConfigsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerConfigsServiceClient(); + + async function callCreateGameServerConfig() { + // Construct request + const request = { + parent, + configId, + gameServerConfig, + }; + + // Run request + const [operation] = await gamingClient.createGameServerConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateGameServerConfig(); + // [END gameservices_v1_generated_GameServerConfigsService_CreateGameServerConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.delete_game_server_config.js b/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.delete_game_server_config.js new file mode 100644 index 00000000000..889474896f0 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.delete_game_server_config.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 gameservices_v1_generated_GameServerConfigsService_DeleteGameServerConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server config to delete, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerConfigsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerConfigsServiceClient(); + + async function callDeleteGameServerConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteGameServerConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteGameServerConfig(); + // [END gameservices_v1_generated_GameServerConfigsService_DeleteGameServerConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.get_game_server_config.js b/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.get_game_server_config.js new file mode 100644 index 00000000000..3d31a53248b --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.get_game_server_config.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START gameservices_v1_generated_GameServerConfigsService_GetGameServerConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server config to retrieve, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerConfigsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerConfigsServiceClient(); + + async function callGetGameServerConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerConfig(request); + console.log(response); + } + + callGetGameServerConfig(); + // [END gameservices_v1_generated_GameServerConfigsService_GetGameServerConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.list_game_server_configs.js b/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.list_game_server_configs.js new file mode 100644 index 00000000000..b583c33dd2f --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.list_game_server_configs.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 gameservices_v1_generated_GameServerConfigsService_ListGameServerConfigs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/*`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * next_page_token google.cloud.gaming.v1.ListGameServerConfigsResponse.next_page_token to + * determine if there are more GameServerConfigs left to be queried. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous list request, if any. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + */ + // const orderBy = 'abc123' + + // Imports the Gaming library + const {GameServerConfigsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerConfigsServiceClient(); + + async function callListGameServerConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listGameServerConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListGameServerConfigs(); + // [END gameservices_v1_generated_GameServerConfigsService_ListGameServerConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.create_game_server_deployment.js b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.create_game_server_deployment.js new file mode 100644 index 00000000000..e3f2af1d78d --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.create_game_server_deployment.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, deploymentId, gameServerDeployment) { + // [START gameservices_v1_generated_GameServerDeploymentsService_CreateGameServerDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 following form: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Required. The ID of the game server delpoyment resource to be created. + */ + // const deploymentId = 'abc123' + /** + * Required. The game server delpoyment resource to be created. + */ + // const gameServerDeployment = {} + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function callCreateGameServerDeployment() { + // Construct request + const request = { + parent, + deploymentId, + gameServerDeployment, + }; + + // Run request + const [operation] = await gamingClient.createGameServerDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateGameServerDeployment(); + // [END gameservices_v1_generated_GameServerDeploymentsService_CreateGameServerDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.delete_game_server_deployment.js b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.delete_game_server_deployment.js new file mode 100644 index 00000000000..1112f3ff169 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.delete_game_server_deployment.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 gameservices_v1_generated_GameServerDeploymentsService_DeleteGameServerDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server delpoyment to delete, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function callDeleteGameServerDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteGameServerDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteGameServerDeployment(); + // [END gameservices_v1_generated_GameServerDeploymentsService_DeleteGameServerDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.fetch_deployment_state.js b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.fetch_deployment_state.js new file mode 100644 index 00000000000..d2f510c0d27 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.fetch_deployment_state.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 gameservices_v1_generated_GameServerDeploymentsService_FetchDeploymentState_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server delpoyment, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function callFetchDeploymentState() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.fetchDeploymentState(request); + console.log(response); + } + + callFetchDeploymentState(); + // [END gameservices_v1_generated_GameServerDeploymentsService_FetchDeploymentState_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.get_game_server_deployment.js b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.get_game_server_deployment.js new file mode 100644 index 00000000000..612f36c9dab --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.get_game_server_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 gameservices_v1_generated_GameServerDeploymentsService_GetGameServerDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server delpoyment to retrieve, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function callGetGameServerDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerDeployment(request); + console.log(response); + } + + callGetGameServerDeployment(); + // [END gameservices_v1_generated_GameServerDeploymentsService_GetGameServerDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.get_game_server_deployment_rollout.js b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.get_game_server_deployment_rollout.js new file mode 100644 index 00000000000..dd2864a56bb --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.get_game_server_deployment_rollout.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 gameservices_v1_generated_GameServerDeploymentsService_GetGameServerDeploymentRollout_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server delpoyment to retrieve, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function callGetGameServerDeploymentRollout() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerDeploymentRollout(request); + console.log(response); + } + + callGetGameServerDeploymentRollout(); + // [END gameservices_v1_generated_GameServerDeploymentsService_GetGameServerDeploymentRollout_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.list_game_server_deployments.js b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.list_game_server_deployments.js new file mode 100644 index 00000000000..5b163c39d24 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.list_game_server_deployments.js @@ -0,0 +1,86 @@ +// 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 gameservices_v1_generated_GameServerDeploymentsService_ListGameServerDeployments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 following form: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of items to return. If unspecified, the server + * will pick an appropriate default. The server may return fewer items than + * requested. A caller should only rely on response's + * next_page_token google.cloud.gaming.v1.ListGameServerDeploymentsResponse.next_page_token to + * determine if there are more GameServerDeployments left to be queried. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + */ + // const orderBy = 'abc123' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function callListGameServerDeployments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listGameServerDeploymentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListGameServerDeployments(); + // [END gameservices_v1_generated_GameServerDeploymentsService_ListGameServerDeployments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.preview_game_server_deployment_rollout.js b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.preview_game_server_deployment_rollout.js new file mode 100644 index 00000000000..5293fca061f --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.preview_game_server_deployment_rollout.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(rollout) { + // [START gameservices_v1_generated_GameServerDeploymentsService_PreviewGameServerDeploymentRollout_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server deployment rollout to be updated. + * Only fields specified in update_mask are updated. + */ + // const rollout = {} + /** + * Optional. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + */ + // const updateMask = {} + /** + * Optional. The target timestamp to compute the preview. Defaults to the immediately + * after the proposed rollout completes. + */ + // const previewTime = {} + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function callPreviewGameServerDeploymentRollout() { + // Construct request + const request = { + rollout, + }; + + // Run request + const response = await gamingClient.previewGameServerDeploymentRollout(request); + console.log(response); + } + + callPreviewGameServerDeploymentRollout(); + // [END gameservices_v1_generated_GameServerDeploymentsService_PreviewGameServerDeploymentRollout_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.update_game_server_deployment.js b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.update_game_server_deployment.js new file mode 100644 index 00000000000..cabc47340ff --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.update_game_server_deployment.js @@ -0,0 +1,70 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(gameServerDeployment, updateMask) { + // [START gameservices_v1_generated_GameServerDeploymentsService_UpdateGameServerDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server delpoyment to be updated. + * Only fields specified in update_mask are updated. + */ + // const gameServerDeployment = {} + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + */ + // const updateMask = {} + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function callUpdateGameServerDeployment() { + // Construct request + const request = { + gameServerDeployment, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateGameServerDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateGameServerDeployment(); + // [END gameservices_v1_generated_GameServerDeploymentsService_UpdateGameServerDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.update_game_server_deployment_rollout.js b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.update_game_server_deployment_rollout.js new file mode 100644 index 00000000000..f6f3711069e --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.update_game_server_deployment_rollout.js @@ -0,0 +1,70 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(rollout, updateMask) { + // [START gameservices_v1_generated_GameServerDeploymentsService_UpdateGameServerDeploymentRollout_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server delpoyment rollout to be updated. + * Only fields specified in update_mask are updated. + */ + // const rollout = {} + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + */ + // const updateMask = {} + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function callUpdateGameServerDeploymentRollout() { + // Construct request + const request = { + rollout, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateGameServerDeploymentRollout(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateGameServerDeploymentRollout(); + // [END gameservices_v1_generated_GameServerDeploymentsService_UpdateGameServerDeploymentRollout_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/realms_service.create_realm.js b/packages/google-cloud-gaming/samples/generated/v1/realms_service.create_realm.js new file mode 100644 index 00000000000..fbc6a819f4f --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/realms_service.create_realm.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, realmId, realm) { + // [START gameservices_v1_generated_RealmsService_CreateRealm_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 following form: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Required. The ID of the realm resource to be created. + */ + // const realmId = 'abc123' + /** + * Required. The realm resource to be created. + */ + // const realm = {} + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function callCreateRealm() { + // Construct request + const request = { + parent, + realmId, + realm, + }; + + // Run request + const [operation] = await gamingClient.createRealm(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateRealm(); + // [END gameservices_v1_generated_RealmsService_CreateRealm_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/realms_service.delete_realm.js b/packages/google-cloud-gaming/samples/generated/v1/realms_service.delete_realm.js new file mode 100644 index 00000000000..eced01aade0 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/realms_service.delete_realm.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 gameservices_v1_generated_RealmsService_DeleteRealm_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 realm to delete, in the following form: + * `projects/{project}/locations/{location}/realms/{realm}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function callDeleteRealm() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteRealm(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteRealm(); + // [END gameservices_v1_generated_RealmsService_DeleteRealm_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/realms_service.get_realm.js b/packages/google-cloud-gaming/samples/generated/v1/realms_service.get_realm.js new file mode 100644 index 00000000000..d3f94b17120 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/realms_service.get_realm.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 gameservices_v1_generated_RealmsService_GetRealm_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 realm to retrieve, in the following form: + * `projects/{project}/locations/{location}/realms/{realm}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function callGetRealm() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getRealm(request); + console.log(response); + } + + callGetRealm(); + // [END gameservices_v1_generated_RealmsService_GetRealm_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/realms_service.list_realms.js b/packages/google-cloud-gaming/samples/generated/v1/realms_service.list_realms.js new file mode 100644 index 00000000000..68bef442eeb --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/realms_service.list_realms.js @@ -0,0 +1,86 @@ +// 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 gameservices_v1_generated_RealmsService_ListRealms_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 following form: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * next_page_token google.cloud.gaming.v1.ListRealmsResponse.next_page_token to + * determine if there are more realms left to be queried. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + */ + // const orderBy = 'abc123' + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function callListRealms() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listRealmsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRealms(); + // [END gameservices_v1_generated_RealmsService_ListRealms_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/realms_service.preview_realm_update.js b/packages/google-cloud-gaming/samples/generated/v1/realms_service.preview_realm_update.js new file mode 100644 index 00000000000..644e93d491e --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/realms_service.preview_realm_update.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(realm, updateMask) { + // [START gameservices_v1_generated_RealmsService_PreviewRealmUpdate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 realm to be updated. + * Only fields specified in update_mask are updated. + */ + // const realm = {} + /** + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + */ + // const updateMask = {} + /** + * Optional. The target timestamp to compute the preview. + */ + // const previewTime = {} + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function callPreviewRealmUpdate() { + // Construct request + const request = { + realm, + updateMask, + }; + + // Run request + const response = await gamingClient.previewRealmUpdate(request); + console.log(response); + } + + callPreviewRealmUpdate(); + // [END gameservices_v1_generated_RealmsService_PreviewRealmUpdate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/realms_service.update_realm.js b/packages/google-cloud-gaming/samples/generated/v1/realms_service.update_realm.js new file mode 100644 index 00000000000..4179dbef7ab --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/realms_service.update_realm.js @@ -0,0 +1,70 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(realm, updateMask) { + // [START gameservices_v1_generated_RealmsService_UpdateRealm_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 realm to be updated. + * Only fields specified in update_mask are updated. + */ + // const realm = {} + /** + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + */ + // const updateMask = {} + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function callUpdateRealm() { + // Construct request + const request = { + realm, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateRealm(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateRealm(); + // [END gameservices_v1_generated_RealmsService_UpdateRealm_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1/snippet_metadata.google.cloud.gaming.v1.json b/packages/google-cloud-gaming/samples/generated/v1/snippet_metadata.google.cloud.gaming.v1.json new file mode 100644 index 00000000000..7f9692120f3 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/snippet_metadata.google.cloud.gaming.v1.json @@ -0,0 +1,1259 @@ +{ + "clientLibrary": { + "name": "nodejs-gaming", + "version": "3.1.3", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.gaming.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "gameservices_v1_generated_GameServerClustersService_ListGameServerClusters_async", + "title": "GameServerClustersService listGameServerClusters Sample", + "origin": "API_DEFINITION", + "description": " Lists game server clusters in a given project and location.", + "canonical": true, + "file": "game_server_clusters_service.list_game_server_clusters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 86, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListGameServerClusters", + "fullName": "google.cloud.gaming.v1.GameServerClustersService.ListGameServerClusters", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.gaming.v1.GameServerClusterView" + } + ], + "resultType": ".google.cloud.gaming.v1.ListGameServerClustersResponse", + "client": { + "shortName": "GameServerClustersServiceClient", + "fullName": "google.cloud.gaming.v1.GameServerClustersServiceClient" + }, + "method": { + "shortName": "ListGameServerClusters", + "fullName": "google.cloud.gaming.v1.GameServerClustersService.ListGameServerClusters", + "service": { + "shortName": "GameServerClustersService", + "fullName": "google.cloud.gaming.v1.GameServerClustersService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_GameServerClustersService_GetGameServerCluster_async", + "title": "GameServerClustersService getGameServerCluster Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single game server cluster.", + "canonical": true, + "file": "game_server_clusters_service.get_game_server_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGameServerCluster", + "fullName": "google.cloud.gaming.v1.GameServerClustersService.GetGameServerCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.gaming.v1.GameServerClusterView" + } + ], + "resultType": ".google.cloud.gaming.v1.GameServerCluster", + "client": { + "shortName": "GameServerClustersServiceClient", + "fullName": "google.cloud.gaming.v1.GameServerClustersServiceClient" + }, + "method": { + "shortName": "GetGameServerCluster", + "fullName": "google.cloud.gaming.v1.GameServerClustersService.GetGameServerCluster", + "service": { + "shortName": "GameServerClustersService", + "fullName": "google.cloud.gaming.v1.GameServerClustersService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_GameServerClustersService_CreateGameServerCluster_async", + "title": "GameServerClustersService createGameServerCluster Sample", + "origin": "API_DEFINITION", + "description": " Creates a new game server cluster in a given project and location.", + "canonical": true, + "file": "game_server_clusters_service.create_game_server_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateGameServerCluster", + "fullName": "google.cloud.gaming.v1.GameServerClustersService.CreateGameServerCluster", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "game_server_cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "game_server_cluster", + "type": ".google.cloud.gaming.v1.GameServerCluster" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "GameServerClustersServiceClient", + "fullName": "google.cloud.gaming.v1.GameServerClustersServiceClient" + }, + "method": { + "shortName": "CreateGameServerCluster", + "fullName": "google.cloud.gaming.v1.GameServerClustersService.CreateGameServerCluster", + "service": { + "shortName": "GameServerClustersService", + "fullName": "google.cloud.gaming.v1.GameServerClustersService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_GameServerClustersService_PreviewCreateGameServerCluster_async", + "title": "GameServerClustersService previewCreateGameServerCluster Sample", + "origin": "API_DEFINITION", + "description": " Previews creation of a new game server cluster in a given project and location.", + "canonical": true, + "file": "game_server_clusters_service.preview_create_game_server_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PreviewCreateGameServerCluster", + "fullName": "google.cloud.gaming.v1.GameServerClustersService.PreviewCreateGameServerCluster", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "game_server_cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "game_server_cluster", + "type": ".google.cloud.gaming.v1.GameServerCluster" + }, + { + "name": "preview_time", + "type": ".google.protobuf.Timestamp" + }, + { + "name": "view", + "type": ".google.cloud.gaming.v1.GameServerClusterView" + } + ], + "resultType": ".google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse", + "client": { + "shortName": "GameServerClustersServiceClient", + "fullName": "google.cloud.gaming.v1.GameServerClustersServiceClient" + }, + "method": { + "shortName": "PreviewCreateGameServerCluster", + "fullName": "google.cloud.gaming.v1.GameServerClustersService.PreviewCreateGameServerCluster", + "service": { + "shortName": "GameServerClustersService", + "fullName": "google.cloud.gaming.v1.GameServerClustersService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_GameServerClustersService_DeleteGameServerCluster_async", + "title": "GameServerClustersService deleteGameServerCluster Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single game server cluster.", + "canonical": true, + "file": "game_server_clusters_service.delete_game_server_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteGameServerCluster", + "fullName": "google.cloud.gaming.v1.GameServerClustersService.DeleteGameServerCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "GameServerClustersServiceClient", + "fullName": "google.cloud.gaming.v1.GameServerClustersServiceClient" + }, + "method": { + "shortName": "DeleteGameServerCluster", + "fullName": "google.cloud.gaming.v1.GameServerClustersService.DeleteGameServerCluster", + "service": { + "shortName": "GameServerClustersService", + "fullName": "google.cloud.gaming.v1.GameServerClustersService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_GameServerClustersService_PreviewDeleteGameServerCluster_async", + "title": "GameServerClustersService previewDeleteGameServerCluster Sample", + "origin": "API_DEFINITION", + "description": " Previews deletion of a single game server cluster.", + "canonical": true, + "file": "game_server_clusters_service.preview_delete_game_server_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PreviewDeleteGameServerCluster", + "fullName": "google.cloud.gaming.v1.GameServerClustersService.PreviewDeleteGameServerCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "preview_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse", + "client": { + "shortName": "GameServerClustersServiceClient", + "fullName": "google.cloud.gaming.v1.GameServerClustersServiceClient" + }, + "method": { + "shortName": "PreviewDeleteGameServerCluster", + "fullName": "google.cloud.gaming.v1.GameServerClustersService.PreviewDeleteGameServerCluster", + "service": { + "shortName": "GameServerClustersService", + "fullName": "google.cloud.gaming.v1.GameServerClustersService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_GameServerClustersService_UpdateGameServerCluster_async", + "title": "GameServerClustersService updateGameServerCluster Sample", + "origin": "API_DEFINITION", + "description": " Patches a single game server cluster.", + "canonical": true, + "file": "game_server_clusters_service.update_game_server_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateGameServerCluster", + "fullName": "google.cloud.gaming.v1.GameServerClustersService.UpdateGameServerCluster", + "async": true, + "parameters": [ + { + "name": "game_server_cluster", + "type": ".google.cloud.gaming.v1.GameServerCluster" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "GameServerClustersServiceClient", + "fullName": "google.cloud.gaming.v1.GameServerClustersServiceClient" + }, + "method": { + "shortName": "UpdateGameServerCluster", + "fullName": "google.cloud.gaming.v1.GameServerClustersService.UpdateGameServerCluster", + "service": { + "shortName": "GameServerClustersService", + "fullName": "google.cloud.gaming.v1.GameServerClustersService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_GameServerClustersService_PreviewUpdateGameServerCluster_async", + "title": "GameServerClustersService previewUpdateGameServerCluster Sample", + "origin": "API_DEFINITION", + "description": " Previews updating a GameServerCluster.", + "canonical": true, + "file": "game_server_clusters_service.preview_update_game_server_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PreviewUpdateGameServerCluster", + "fullName": "google.cloud.gaming.v1.GameServerClustersService.PreviewUpdateGameServerCluster", + "async": true, + "parameters": [ + { + "name": "game_server_cluster", + "type": ".google.cloud.gaming.v1.GameServerCluster" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "preview_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse", + "client": { + "shortName": "GameServerClustersServiceClient", + "fullName": "google.cloud.gaming.v1.GameServerClustersServiceClient" + }, + "method": { + "shortName": "PreviewUpdateGameServerCluster", + "fullName": "google.cloud.gaming.v1.GameServerClustersService.PreviewUpdateGameServerCluster", + "service": { + "shortName": "GameServerClustersService", + "fullName": "google.cloud.gaming.v1.GameServerClustersService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_GameServerConfigsService_ListGameServerConfigs_async", + "title": "GameServerClustersService listGameServerConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists game server configs in a given project, location, and game server deployment.", + "canonical": true, + "file": "game_server_configs_service.list_game_server_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListGameServerConfigs", + "fullName": "google.cloud.gaming.v1.GameServerConfigsService.ListGameServerConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gaming.v1.ListGameServerConfigsResponse", + "client": { + "shortName": "GameServerConfigsServiceClient", + "fullName": "google.cloud.gaming.v1.GameServerConfigsServiceClient" + }, + "method": { + "shortName": "ListGameServerConfigs", + "fullName": "google.cloud.gaming.v1.GameServerConfigsService.ListGameServerConfigs", + "service": { + "shortName": "GameServerConfigsService", + "fullName": "google.cloud.gaming.v1.GameServerConfigsService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_GameServerConfigsService_GetGameServerConfig_async", + "title": "GameServerClustersService getGameServerConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single game server config.", + "canonical": true, + "file": "game_server_configs_service.get_game_server_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGameServerConfig", + "fullName": "google.cloud.gaming.v1.GameServerConfigsService.GetGameServerConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gaming.v1.GameServerConfig", + "client": { + "shortName": "GameServerConfigsServiceClient", + "fullName": "google.cloud.gaming.v1.GameServerConfigsServiceClient" + }, + "method": { + "shortName": "GetGameServerConfig", + "fullName": "google.cloud.gaming.v1.GameServerConfigsService.GetGameServerConfig", + "service": { + "shortName": "GameServerConfigsService", + "fullName": "google.cloud.gaming.v1.GameServerConfigsService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_GameServerConfigsService_CreateGameServerConfig_async", + "title": "GameServerClustersService createGameServerConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a new game server config in a given project, location, and game server deployment. Game server configs are immutable, and are not applied until referenced in the game server deployment rollout resource.", + "canonical": true, + "file": "game_server_configs_service.create_game_server_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateGameServerConfig", + "fullName": "google.cloud.gaming.v1.GameServerConfigsService.CreateGameServerConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "config_id", + "type": "TYPE_STRING" + }, + { + "name": "game_server_config", + "type": ".google.cloud.gaming.v1.GameServerConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "GameServerConfigsServiceClient", + "fullName": "google.cloud.gaming.v1.GameServerConfigsServiceClient" + }, + "method": { + "shortName": "CreateGameServerConfig", + "fullName": "google.cloud.gaming.v1.GameServerConfigsService.CreateGameServerConfig", + "service": { + "shortName": "GameServerConfigsService", + "fullName": "google.cloud.gaming.v1.GameServerConfigsService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_GameServerConfigsService_DeleteGameServerConfig_async", + "title": "GameServerClustersService deleteGameServerConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single game server config. The deletion will fail if the game server config is referenced in a game server deployment rollout.", + "canonical": true, + "file": "game_server_configs_service.delete_game_server_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteGameServerConfig", + "fullName": "google.cloud.gaming.v1.GameServerConfigsService.DeleteGameServerConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "GameServerConfigsServiceClient", + "fullName": "google.cloud.gaming.v1.GameServerConfigsServiceClient" + }, + "method": { + "shortName": "DeleteGameServerConfig", + "fullName": "google.cloud.gaming.v1.GameServerConfigsService.DeleteGameServerConfig", + "service": { + "shortName": "GameServerConfigsService", + "fullName": "google.cloud.gaming.v1.GameServerConfigsService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_GameServerDeploymentsService_ListGameServerDeployments_async", + "title": "GameServerClustersService listGameServerDeployments Sample", + "origin": "API_DEFINITION", + "description": " Lists game server deployments in a given project and location.", + "canonical": true, + "file": "game_server_deployments_service.list_game_server_deployments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListGameServerDeployments", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService.ListGameServerDeployments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gaming.v1.ListGameServerDeploymentsResponse", + "client": { + "shortName": "GameServerDeploymentsServiceClient", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsServiceClient" + }, + "method": { + "shortName": "ListGameServerDeployments", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService.ListGameServerDeployments", + "service": { + "shortName": "GameServerDeploymentsService", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_GameServerDeploymentsService_GetGameServerDeployment_async", + "title": "GameServerClustersService getGameServerDeployment Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single game server deployment.", + "canonical": true, + "file": "game_server_deployments_service.get_game_server_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGameServerDeployment", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService.GetGameServerDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gaming.v1.GameServerDeployment", + "client": { + "shortName": "GameServerDeploymentsServiceClient", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsServiceClient" + }, + "method": { + "shortName": "GetGameServerDeployment", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService.GetGameServerDeployment", + "service": { + "shortName": "GameServerDeploymentsService", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_GameServerDeploymentsService_CreateGameServerDeployment_async", + "title": "GameServerClustersService createGameServerDeployment Sample", + "origin": "API_DEFINITION", + "description": " Creates a new game server deployment in a given project and location.", + "canonical": true, + "file": "game_server_deployments_service.create_game_server_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateGameServerDeployment", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService.CreateGameServerDeployment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "deployment_id", + "type": "TYPE_STRING" + }, + { + "name": "game_server_deployment", + "type": ".google.cloud.gaming.v1.GameServerDeployment" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "GameServerDeploymentsServiceClient", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsServiceClient" + }, + "method": { + "shortName": "CreateGameServerDeployment", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService.CreateGameServerDeployment", + "service": { + "shortName": "GameServerDeploymentsService", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_GameServerDeploymentsService_DeleteGameServerDeployment_async", + "title": "GameServerClustersService deleteGameServerDeployment Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single game server deployment.", + "canonical": true, + "file": "game_server_deployments_service.delete_game_server_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteGameServerDeployment", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService.DeleteGameServerDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "GameServerDeploymentsServiceClient", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsServiceClient" + }, + "method": { + "shortName": "DeleteGameServerDeployment", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService.DeleteGameServerDeployment", + "service": { + "shortName": "GameServerDeploymentsService", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_GameServerDeploymentsService_UpdateGameServerDeployment_async", + "title": "GameServerClustersService updateGameServerDeployment Sample", + "origin": "API_DEFINITION", + "description": " Patches a game server deployment.", + "canonical": true, + "file": "game_server_deployments_service.update_game_server_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateGameServerDeployment", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService.UpdateGameServerDeployment", + "async": true, + "parameters": [ + { + "name": "game_server_deployment", + "type": ".google.cloud.gaming.v1.GameServerDeployment" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "GameServerDeploymentsServiceClient", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsServiceClient" + }, + "method": { + "shortName": "UpdateGameServerDeployment", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService.UpdateGameServerDeployment", + "service": { + "shortName": "GameServerDeploymentsService", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_GameServerDeploymentsService_GetGameServerDeploymentRollout_async", + "title": "GameServerClustersService getGameServerDeploymentRollout Sample", + "origin": "API_DEFINITION", + "description": " Gets details a single game server deployment rollout.", + "canonical": true, + "file": "game_server_deployments_service.get_game_server_deployment_rollout.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGameServerDeploymentRollout", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService.GetGameServerDeploymentRollout", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gaming.v1.GameServerDeploymentRollout", + "client": { + "shortName": "GameServerDeploymentsServiceClient", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsServiceClient" + }, + "method": { + "shortName": "GetGameServerDeploymentRollout", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService.GetGameServerDeploymentRollout", + "service": { + "shortName": "GameServerDeploymentsService", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_GameServerDeploymentsService_UpdateGameServerDeploymentRollout_async", + "title": "GameServerClustersService updateGameServerDeploymentRollout Sample", + "origin": "API_DEFINITION", + "description": " Patches a single game server deployment rollout. The method will not return an error if the update does not affect any existing realms. For example - if the default_game_server_config is changed but all existing realms use the override, that is valid. Similarly, if a non existing realm is explicitly called out in game_server_config_overrides field, that will also not result in an error.", + "canonical": true, + "file": "game_server_deployments_service.update_game_server_deployment_rollout.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateGameServerDeploymentRollout", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService.UpdateGameServerDeploymentRollout", + "async": true, + "parameters": [ + { + "name": "rollout", + "type": ".google.cloud.gaming.v1.GameServerDeploymentRollout" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "GameServerDeploymentsServiceClient", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsServiceClient" + }, + "method": { + "shortName": "UpdateGameServerDeploymentRollout", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService.UpdateGameServerDeploymentRollout", + "service": { + "shortName": "GameServerDeploymentsService", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_GameServerDeploymentsService_PreviewGameServerDeploymentRollout_async", + "title": "GameServerClustersService previewGameServerDeploymentRollout Sample", + "origin": "API_DEFINITION", + "description": " Previews the game server deployment rollout. This API does not mutate the rollout resource.", + "canonical": true, + "file": "game_server_deployments_service.preview_game_server_deployment_rollout.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PreviewGameServerDeploymentRollout", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService.PreviewGameServerDeploymentRollout", + "async": true, + "parameters": [ + { + "name": "rollout", + "type": ".google.cloud.gaming.v1.GameServerDeploymentRollout" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "preview_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse", + "client": { + "shortName": "GameServerDeploymentsServiceClient", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsServiceClient" + }, + "method": { + "shortName": "PreviewGameServerDeploymentRollout", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService.PreviewGameServerDeploymentRollout", + "service": { + "shortName": "GameServerDeploymentsService", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_GameServerDeploymentsService_FetchDeploymentState_async", + "title": "GameServerClustersService fetchDeploymentState Sample", + "origin": "API_DEFINITION", + "description": " Retrieves information about the current state of the game server deployment. Gathers all the Agones fleets and Agones autoscalers, including fleets running an older version of the game server deployment.", + "canonical": true, + "file": "game_server_deployments_service.fetch_deployment_state.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchDeploymentState", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService.FetchDeploymentState", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gaming.v1.FetchDeploymentStateResponse", + "client": { + "shortName": "GameServerDeploymentsServiceClient", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsServiceClient" + }, + "method": { + "shortName": "FetchDeploymentState", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService.FetchDeploymentState", + "service": { + "shortName": "GameServerDeploymentsService", + "fullName": "google.cloud.gaming.v1.GameServerDeploymentsService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_RealmsService_ListRealms_async", + "title": "GameServerClustersService listRealms Sample", + "origin": "API_DEFINITION", + "description": " Lists realms in a given project and location.", + "canonical": true, + "file": "realms_service.list_realms.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRealms", + "fullName": "google.cloud.gaming.v1.RealmsService.ListRealms", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gaming.v1.ListRealmsResponse", + "client": { + "shortName": "RealmsServiceClient", + "fullName": "google.cloud.gaming.v1.RealmsServiceClient" + }, + "method": { + "shortName": "ListRealms", + "fullName": "google.cloud.gaming.v1.RealmsService.ListRealms", + "service": { + "shortName": "RealmsService", + "fullName": "google.cloud.gaming.v1.RealmsService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_RealmsService_GetRealm_async", + "title": "GameServerClustersService getRealm Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single realm.", + "canonical": true, + "file": "realms_service.get_realm.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRealm", + "fullName": "google.cloud.gaming.v1.RealmsService.GetRealm", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gaming.v1.Realm", + "client": { + "shortName": "RealmsServiceClient", + "fullName": "google.cloud.gaming.v1.RealmsServiceClient" + }, + "method": { + "shortName": "GetRealm", + "fullName": "google.cloud.gaming.v1.RealmsService.GetRealm", + "service": { + "shortName": "RealmsService", + "fullName": "google.cloud.gaming.v1.RealmsService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_RealmsService_CreateRealm_async", + "title": "GameServerClustersService createRealm Sample", + "origin": "API_DEFINITION", + "description": " Creates a new realm in a given project and location.", + "canonical": true, + "file": "realms_service.create_realm.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateRealm", + "fullName": "google.cloud.gaming.v1.RealmsService.CreateRealm", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "realm_id", + "type": "TYPE_STRING" + }, + { + "name": "realm", + "type": ".google.cloud.gaming.v1.Realm" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "RealmsServiceClient", + "fullName": "google.cloud.gaming.v1.RealmsServiceClient" + }, + "method": { + "shortName": "CreateRealm", + "fullName": "google.cloud.gaming.v1.RealmsService.CreateRealm", + "service": { + "shortName": "RealmsService", + "fullName": "google.cloud.gaming.v1.RealmsService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_RealmsService_DeleteRealm_async", + "title": "GameServerClustersService deleteRealm Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single realm.", + "canonical": true, + "file": "realms_service.delete_realm.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteRealm", + "fullName": "google.cloud.gaming.v1.RealmsService.DeleteRealm", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "RealmsServiceClient", + "fullName": "google.cloud.gaming.v1.RealmsServiceClient" + }, + "method": { + "shortName": "DeleteRealm", + "fullName": "google.cloud.gaming.v1.RealmsService.DeleteRealm", + "service": { + "shortName": "RealmsService", + "fullName": "google.cloud.gaming.v1.RealmsService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_RealmsService_UpdateRealm_async", + "title": "GameServerClustersService updateRealm Sample", + "origin": "API_DEFINITION", + "description": " Patches a single realm.", + "canonical": true, + "file": "realms_service.update_realm.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateRealm", + "fullName": "google.cloud.gaming.v1.RealmsService.UpdateRealm", + "async": true, + "parameters": [ + { + "name": "realm", + "type": ".google.cloud.gaming.v1.Realm" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "RealmsServiceClient", + "fullName": "google.cloud.gaming.v1.RealmsServiceClient" + }, + "method": { + "shortName": "UpdateRealm", + "fullName": "google.cloud.gaming.v1.RealmsService.UpdateRealm", + "service": { + "shortName": "RealmsService", + "fullName": "google.cloud.gaming.v1.RealmsService" + } + } + } + }, + { + "regionTag": "gameservices_v1_generated_RealmsService_PreviewRealmUpdate_async", + "title": "GameServerClustersService previewRealmUpdate Sample", + "origin": "API_DEFINITION", + "description": " Previews patches to a single realm.", + "canonical": true, + "file": "realms_service.preview_realm_update.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PreviewRealmUpdate", + "fullName": "google.cloud.gaming.v1.RealmsService.PreviewRealmUpdate", + "async": true, + "parameters": [ + { + "name": "realm", + "type": ".google.cloud.gaming.v1.Realm" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "preview_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.gaming.v1.PreviewRealmUpdateResponse", + "client": { + "shortName": "RealmsServiceClient", + "fullName": "google.cloud.gaming.v1.RealmsServiceClient" + }, + "method": { + "shortName": "PreviewRealmUpdate", + "fullName": "google.cloud.gaming.v1.RealmsService.PreviewRealmUpdate", + "service": { + "shortName": "RealmsService", + "fullName": "google.cloud.gaming.v1.RealmsService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.create_game_server_cluster.js b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.create_game_server_cluster.js new file mode 100644 index 00000000000..fe5320c14c6 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.create_game_server_cluster.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, gameServerClusterId, gameServerCluster) { + // [START gameservices_v1beta_generated_GameServerClustersService_CreateGameServerCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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. Uses the form: + * `projects/{project}/locations/{location}/realms/{realm-id}`. + */ + // const parent = 'abc123' + /** + * Required. The ID of the game server cluster resource to be created. + */ + // const gameServerClusterId = 'abc123' + /** + * Required. The game server cluster resource to be created. + */ + // const gameServerCluster = {} + + // Imports the Gaming library + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function callCreateGameServerCluster() { + // Construct request + const request = { + parent, + gameServerClusterId, + gameServerCluster, + }; + + // Run request + const [operation] = await gamingClient.createGameServerCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateGameServerCluster(); + // [END gameservices_v1beta_generated_GameServerClustersService_CreateGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.delete_game_server_cluster.js b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.delete_game_server_cluster.js new file mode 100644 index 00000000000..84cabe9b3a2 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.delete_game_server_cluster.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 gameservices_v1beta_generated_GameServerClustersService_DeleteGameServerCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server cluster to delete. Uses the form: + * `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function callDeleteGameServerCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteGameServerCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteGameServerCluster(); + // [END gameservices_v1beta_generated_GameServerClustersService_DeleteGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.get_game_server_cluster.js b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.get_game_server_cluster.js new file mode 100644 index 00000000000..4c507a67da9 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.get_game_server_cluster.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 gameservices_v1beta_generated_GameServerClustersService_GetGameServerCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server cluster to retrieve. Uses the form: + * `projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function callGetGameServerCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerCluster(request); + console.log(response); + } + + callGetGameServerCluster(); + // [END gameservices_v1beta_generated_GameServerClustersService_GetGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.list_game_server_clusters.js b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.list_game_server_clusters.js new file mode 100644 index 00000000000..31a2a5947b6 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.list_game_server_clusters.js @@ -0,0 +1,86 @@ +// 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 gameservices_v1beta_generated_GameServerClustersService_ListGameServerClusters_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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. Uses the form: + * "projects/{project}/locations/{location}/realms/{realm}". + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of items to return. If unspecified, the + * server will pick an appropriate default. The server may return fewer items + * than requested. A caller should only rely on response's + * next_page_token google.cloud.gaming.v1beta.ListGameServerClustersResponse.next_page_token + * to determine if there are more GameServerClusters left to be queried. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + */ + // const orderBy = 'abc123' + + // Imports the Gaming library + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function callListGameServerClusters() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listGameServerClustersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListGameServerClusters(); + // [END gameservices_v1beta_generated_GameServerClustersService_ListGameServerClusters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_create_game_server_cluster.js b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_create_game_server_cluster.js new file mode 100644 index 00000000000..9bf2f6dc0ce --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_create_game_server_cluster.js @@ -0,0 +1,76 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, gameServerClusterId, gameServerCluster) { + // [START gameservices_v1beta_generated_GameServerClustersService_PreviewCreateGameServerCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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. Uses the form: + * `projects/{project}/locations/{location}/realms/{realm}`. + */ + // const parent = 'abc123' + /** + * Required. The ID of the game server cluster resource to be created. + */ + // const gameServerClusterId = 'abc123' + /** + * Required. The game server cluster resource to be created. + */ + // const gameServerCluster = {} + /** + * Optional. The target timestamp to compute the preview. + */ + // const previewTime = {} + + // Imports the Gaming library + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function callPreviewCreateGameServerCluster() { + // Construct request + const request = { + parent, + gameServerClusterId, + gameServerCluster, + }; + + // Run request + const response = await gamingClient.previewCreateGameServerCluster(request); + console.log(response); + } + + callPreviewCreateGameServerCluster(); + // [END gameservices_v1beta_generated_GameServerClustersService_PreviewCreateGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_delete_game_server_cluster.js b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_delete_game_server_cluster.js new file mode 100644 index 00000000000..eaf085e0639 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_delete_game_server_cluster.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 gameservices_v1beta_generated_GameServerClustersService_PreviewDeleteGameServerCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server cluster to delete. Uses the form: + * `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. + */ + // const name = 'abc123' + /** + * Optional. The target timestamp to compute the preview. + */ + // const previewTime = {} + + // Imports the Gaming library + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function callPreviewDeleteGameServerCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.previewDeleteGameServerCluster(request); + console.log(response); + } + + callPreviewDeleteGameServerCluster(); + // [END gameservices_v1beta_generated_GameServerClustersService_PreviewDeleteGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_update_game_server_cluster.js b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_update_game_server_cluster.js new file mode 100644 index 00000000000..95cabe4e80e --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_update_game_server_cluster.js @@ -0,0 +1,75 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(gameServerCluster, updateMask) { + // [START gameservices_v1beta_generated_GameServerClustersService_PreviewUpdateGameServerCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server cluster to be updated. + * Only fields specified in update_mask are updated. + */ + // const gameServerCluster = {} + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https: + * //developers.google.com/protocol-buffers + * // /docs/reference/google.protobuf#fieldmask + */ + // const updateMask = {} + /** + * Optional. The target timestamp to compute the preview. + */ + // const previewTime = {} + + // Imports the Gaming library + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function callPreviewUpdateGameServerCluster() { + // Construct request + const request = { + gameServerCluster, + updateMask, + }; + + // Run request + const response = await gamingClient.previewUpdateGameServerCluster(request); + console.log(response); + } + + callPreviewUpdateGameServerCluster(); + // [END gameservices_v1beta_generated_GameServerClustersService_PreviewUpdateGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.update_game_server_cluster.js b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.update_game_server_cluster.js new file mode 100644 index 00000000000..fcd3349436e --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.update_game_server_cluster.js @@ -0,0 +1,72 @@ +// 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(gameServerCluster, updateMask) { + // [START gameservices_v1beta_generated_GameServerClustersService_UpdateGameServerCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server cluster to be updated. + * Only fields specified in update_mask are updated. + */ + // const gameServerCluster = {} + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https: + * //developers.google.com/protocol-buffers + * // /docs/reference/google.protobuf#fieldmask + */ + // const updateMask = {} + + // Imports the Gaming library + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerClustersServiceClient(); + + async function callUpdateGameServerCluster() { + // Construct request + const request = { + gameServerCluster, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateGameServerCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateGameServerCluster(); + // [END gameservices_v1beta_generated_GameServerClustersService_UpdateGameServerCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.create_game_server_config.js b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.create_game_server_config.js new file mode 100644 index 00000000000..878996af867 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.create_game_server_config.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, configId, gameServerConfig) { + // [START gameservices_v1beta_generated_GameServerConfigsService_CreateGameServerConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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. Uses the form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/`. + */ + // const parent = 'abc123' + /** + * Required. The ID of the game server config resource to be created. + */ + // const configId = 'abc123' + /** + * Required. The game server config resource to be created. + */ + // const gameServerConfig = {} + + // Imports the Gaming library + const {GameServerConfigsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerConfigsServiceClient(); + + async function callCreateGameServerConfig() { + // Construct request + const request = { + parent, + configId, + gameServerConfig, + }; + + // Run request + const [operation] = await gamingClient.createGameServerConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateGameServerConfig(); + // [END gameservices_v1beta_generated_GameServerConfigsService_CreateGameServerConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.delete_game_server_config.js b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.delete_game_server_config.js new file mode 100644 index 00000000000..e3f307627d4 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.delete_game_server_config.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 gameservices_v1beta_generated_GameServerConfigsService_DeleteGameServerConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server config to delete. Uses the form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerConfigsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerConfigsServiceClient(); + + async function callDeleteGameServerConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteGameServerConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteGameServerConfig(); + // [END gameservices_v1beta_generated_GameServerConfigsService_DeleteGameServerConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.get_game_server_config.js b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.get_game_server_config.js new file mode 100644 index 00000000000..9fd03435d64 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.get_game_server_config.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START gameservices_v1beta_generated_GameServerConfigsService_GetGameServerConfig_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server config to retrieve. Uses the form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerConfigsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerConfigsServiceClient(); + + async function callGetGameServerConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerConfig(request); + console.log(response); + } + + callGetGameServerConfig(); + // [END gameservices_v1beta_generated_GameServerConfigsService_GetGameServerConfig_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.list_game_server_configs.js b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.list_game_server_configs.js new file mode 100644 index 00000000000..459bf2af4a5 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.list_game_server_configs.js @@ -0,0 +1,86 @@ +// 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 gameservices_v1beta_generated_GameServerConfigsService_ListGameServerConfigs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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. Uses the form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/*`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * next_page_token google.cloud.gaming.v1beta.ListGameServerConfigsResponse.next_page_token + * to determine if there are more GameServerConfigs left to be queried. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous list request, + * if any. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + */ + // const orderBy = 'abc123' + + // Imports the Gaming library + const {GameServerConfigsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerConfigsServiceClient(); + + async function callListGameServerConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listGameServerConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListGameServerConfigs(); + // [END gameservices_v1beta_generated_GameServerConfigsService_ListGameServerConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.create_game_server_deployment.js b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.create_game_server_deployment.js new file mode 100644 index 00000000000..491fa247370 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.create_game_server_deployment.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, deploymentId, gameServerDeployment) { + // [START gameservices_v1beta_generated_GameServerDeploymentsService_CreateGameServerDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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. Uses the form: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Required. The ID of the game server delpoyment resource to be created. + */ + // const deploymentId = 'abc123' + /** + * Required. The game server delpoyment resource to be created. + */ + // const gameServerDeployment = {} + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function callCreateGameServerDeployment() { + // Construct request + const request = { + parent, + deploymentId, + gameServerDeployment, + }; + + // Run request + const [operation] = await gamingClient.createGameServerDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateGameServerDeployment(); + // [END gameservices_v1beta_generated_GameServerDeploymentsService_CreateGameServerDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.delete_game_server_deployment.js b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.delete_game_server_deployment.js new file mode 100644 index 00000000000..64d0d47e951 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.delete_game_server_deployment.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 gameservices_v1beta_generated_GameServerDeploymentsService_DeleteGameServerDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server delpoyment to delete. Uses the form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function callDeleteGameServerDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteGameServerDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteGameServerDeployment(); + // [END gameservices_v1beta_generated_GameServerDeploymentsService_DeleteGameServerDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.fetch_deployment_state.js b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.fetch_deployment_state.js new file mode 100644 index 00000000000..fe8618d547d --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.fetch_deployment_state.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 gameservices_v1beta_generated_GameServerDeploymentsService_FetchDeploymentState_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server delpoyment. Uses the form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function callFetchDeploymentState() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.fetchDeploymentState(request); + console.log(response); + } + + callFetchDeploymentState(); + // [END gameservices_v1beta_generated_GameServerDeploymentsService_FetchDeploymentState_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.get_game_server_deployment.js b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.get_game_server_deployment.js new file mode 100644 index 00000000000..99533e086cb --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.get_game_server_deployment.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 gameservices_v1beta_generated_GameServerDeploymentsService_GetGameServerDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server delpoyment to retrieve. Uses the + * form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function callGetGameServerDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerDeployment(request); + console.log(response); + } + + callGetGameServerDeployment(); + // [END gameservices_v1beta_generated_GameServerDeploymentsService_GetGameServerDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.get_game_server_deployment_rollout.js b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.get_game_server_deployment_rollout.js new file mode 100644 index 00000000000..60c630a448b --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.get_game_server_deployment_rollout.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 gameservices_v1beta_generated_GameServerDeploymentsService_GetGameServerDeploymentRollout_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server delpoyment to retrieve. Uses the + * form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function callGetGameServerDeploymentRollout() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerDeploymentRollout(request); + console.log(response); + } + + callGetGameServerDeploymentRollout(); + // [END gameservices_v1beta_generated_GameServerDeploymentsService_GetGameServerDeploymentRollout_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.list_game_server_deployments.js b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.list_game_server_deployments.js new file mode 100644 index 00000000000..f216b0082d0 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.list_game_server_deployments.js @@ -0,0 +1,86 @@ +// 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 gameservices_v1beta_generated_GameServerDeploymentsService_ListGameServerDeployments_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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. Uses the form: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of items to return. If unspecified, the + * server will pick an appropriate default. The server may return fewer items + * than requested. A caller should only rely on response's + * next_page_token google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse.next_page_token + * to determine if there are more GameServerDeployments left to be queried. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + */ + // const orderBy = 'abc123' + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function callListGameServerDeployments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listGameServerDeploymentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListGameServerDeployments(); + // [END gameservices_v1beta_generated_GameServerDeploymentsService_ListGameServerDeployments_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.preview_game_server_deployment_rollout.js b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.preview_game_server_deployment_rollout.js new file mode 100644 index 00000000000..d1050e5f01f --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.preview_game_server_deployment_rollout.js @@ -0,0 +1,75 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(rollout) { + // [START gameservices_v1beta_generated_GameServerDeploymentsService_PreviewGameServerDeploymentRollout_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server deployment rollout to be updated. + * Only fields specified in update_mask are updated. + */ + // const rollout = {} + /** + * Optional. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https: + * //developers.google.com/protocol-buffers + * // /docs/reference/google.protobuf#fieldmask + */ + // const updateMask = {} + /** + * Optional. The target timestamp to compute the preview. Defaults to the + * immediately after the proposed rollout completes. + */ + // const previewTime = {} + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function callPreviewGameServerDeploymentRollout() { + // Construct request + const request = { + rollout, + }; + + // Run request + const response = await gamingClient.previewGameServerDeploymentRollout(request); + console.log(response); + } + + callPreviewGameServerDeploymentRollout(); + // [END gameservices_v1beta_generated_GameServerDeploymentsService_PreviewGameServerDeploymentRollout_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.update_game_server_deployment.js b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.update_game_server_deployment.js new file mode 100644 index 00000000000..3c29a23adae --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.update_game_server_deployment.js @@ -0,0 +1,72 @@ +// 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(gameServerDeployment, updateMask) { + // [START gameservices_v1beta_generated_GameServerDeploymentsService_UpdateGameServerDeployment_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server delpoyment to be updated. + * Only fields specified in update_mask are updated. + */ + // const gameServerDeployment = {} + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https: + * //developers.google.com/protocol-buffers + * // /docs/reference/google.protobuf#fieldmask + */ + // const updateMask = {} + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function callUpdateGameServerDeployment() { + // Construct request + const request = { + gameServerDeployment, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateGameServerDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateGameServerDeployment(); + // [END gameservices_v1beta_generated_GameServerDeploymentsService_UpdateGameServerDeployment_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.update_game_server_deployment_rollout.js b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.update_game_server_deployment_rollout.js new file mode 100644 index 00000000000..f4033b8ee3d --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.update_game_server_deployment_rollout.js @@ -0,0 +1,72 @@ +// 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(rollout, updateMask) { + // [START gameservices_v1beta_generated_GameServerDeploymentsService_UpdateGameServerDeploymentRollout_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 game server delpoyment rollout to be updated. + * Only fields specified in update_mask are updated. + */ + // const rollout = {} + /** + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https: + * //developers.google.com/protocol-buffers + * // /docs/reference/google.protobuf#fieldmask + */ + // const updateMask = {} + + // Imports the Gaming library + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new GameServerDeploymentsServiceClient(); + + async function callUpdateGameServerDeploymentRollout() { + // Construct request + const request = { + rollout, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateGameServerDeploymentRollout(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateGameServerDeploymentRollout(); + // [END gameservices_v1beta_generated_GameServerDeploymentsService_UpdateGameServerDeploymentRollout_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.create_realm.js b/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.create_realm.js new file mode 100644 index 00000000000..62c0fcd4b7a --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.create_realm.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, realmId, realm) { + // [START gameservices_v1beta_generated_RealmsService_CreateRealm_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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. Uses the form: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Required. The ID of the realm resource to be created. + */ + // const realmId = 'abc123' + /** + * Required. The realm resource to be created. + */ + // const realm = {} + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function callCreateRealm() { + // Construct request + const request = { + parent, + realmId, + realm, + }; + + // Run request + const [operation] = await gamingClient.createRealm(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateRealm(); + // [END gameservices_v1beta_generated_RealmsService_CreateRealm_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.delete_realm.js b/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.delete_realm.js new file mode 100644 index 00000000000..f082d26994c --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.delete_realm.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 gameservices_v1beta_generated_RealmsService_DeleteRealm_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 realm to delete. Uses the form: + * `projects/{project}/locations/{location}/realms/{realm}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function callDeleteRealm() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteRealm(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteRealm(); + // [END gameservices_v1beta_generated_RealmsService_DeleteRealm_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.get_realm.js b/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.get_realm.js new file mode 100644 index 00000000000..3a0f0606622 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.get_realm.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 gameservices_v1beta_generated_RealmsService_GetRealm_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 realm to retrieve. Uses the form: + * `projects/{project}/locations/{location}/realms/{realm}`. + */ + // const name = 'abc123' + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function callGetRealm() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getRealm(request); + console.log(response); + } + + callGetRealm(); + // [END gameservices_v1beta_generated_RealmsService_GetRealm_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.list_realms.js b/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.list_realms.js new file mode 100644 index 00000000000..10b0feb181e --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.list_realms.js @@ -0,0 +1,86 @@ +// 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 gameservices_v1beta_generated_RealmsService_ListRealms_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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. Uses the form: + * `projects/{project}/locations/{location}`. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * next_page_token google.cloud.gaming.v1beta.ListRealmsResponse.next_page_token + * to determine if there are more realms left to be queried. + */ + // const pageSize = 1234 + /** + * Optional. The next_page_token value returned from a previous List request, + * if any. + */ + // const pageToken = 'abc123' + /** + * Optional. The filter to apply to list results. + */ + // const filter = 'abc123' + /** + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + */ + // const orderBy = 'abc123' + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function callListRealms() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listRealmsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRealms(); + // [END gameservices_v1beta_generated_RealmsService_ListRealms_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.preview_realm_update.js b/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.preview_realm_update.js new file mode 100644 index 00000000000..67c55bd2f72 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.preview_realm_update.js @@ -0,0 +1,75 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(realm, updateMask) { + // [START gameservices_v1beta_generated_RealmsService_PreviewRealmUpdate_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 realm to be updated. + * Only fields specified in update_mask are updated. + */ + // const realm = {} + /** + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * https: + * //developers.google.com/protocol-buffers + * // /docs/reference/google.protobuf#fieldmask + */ + // const updateMask = {} + /** + * Optional. The target timestamp to compute the preview. + */ + // const previewTime = {} + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function callPreviewRealmUpdate() { + // Construct request + const request = { + realm, + updateMask, + }; + + // Run request + const response = await gamingClient.previewRealmUpdate(request); + console.log(response); + } + + callPreviewRealmUpdate(); + // [END gameservices_v1beta_generated_RealmsService_PreviewRealmUpdate_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.update_realm.js b/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.update_realm.js new file mode 100644 index 00000000000..ba91f2afba8 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.update_realm.js @@ -0,0 +1,72 @@ +// 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(realm, updateMask) { + // [START gameservices_v1beta_generated_RealmsService_UpdateRealm_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will 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 realm to be updated. + * Only fields specified in update_mask are updated. + */ + // const realm = {} + /** + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * https: + * //developers.google.com/protocol-buffers + * // /docs/reference/google.protobuf#fieldmask + */ + // const updateMask = {} + + // Imports the Gaming library + const {RealmsServiceClient} = require('@google-cloud/game-servers').v1beta; + + // Instantiates a client + const gamingClient = new RealmsServiceClient(); + + async function callUpdateRealm() { + // Construct request + const request = { + realm, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateRealm(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateRealm(); + // [END gameservices_v1beta_generated_RealmsService_UpdateRealm_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-gaming/samples/generated/v1beta/snippet_metadata.google.cloud.gaming.v1beta.json b/packages/google-cloud-gaming/samples/generated/v1beta/snippet_metadata.google.cloud.gaming.v1beta.json new file mode 100644 index 00000000000..70315131515 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/snippet_metadata.google.cloud.gaming.v1beta.json @@ -0,0 +1,1247 @@ +{ + "clientLibrary": { + "name": "nodejs-gaming", + "version": "3.1.3", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.gaming.v1beta", + "version": "v1beta" + } + ] + }, + "snippets": [ + { + "regionTag": "gameservices_v1beta_generated_GameServerClustersService_ListGameServerClusters_async", + "title": "GameServerClustersService listGameServerClusters Sample", + "origin": "API_DEFINITION", + "description": " Lists game server clusters in a given project and location.", + "canonical": true, + "file": "game_server_clusters_service.list_game_server_clusters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListGameServerClusters", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService.ListGameServerClusters", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gaming.v1beta.ListGameServerClustersResponse", + "client": { + "shortName": "GameServerClustersServiceClient", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersServiceClient" + }, + "method": { + "shortName": "ListGameServerClusters", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService.ListGameServerClusters", + "service": { + "shortName": "GameServerClustersService", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_GameServerClustersService_GetGameServerCluster_async", + "title": "GameServerClustersService getGameServerCluster Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single game server cluster.", + "canonical": true, + "file": "game_server_clusters_service.get_game_server_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGameServerCluster", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService.GetGameServerCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gaming.v1beta.GameServerCluster", + "client": { + "shortName": "GameServerClustersServiceClient", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersServiceClient" + }, + "method": { + "shortName": "GetGameServerCluster", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService.GetGameServerCluster", + "service": { + "shortName": "GameServerClustersService", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_GameServerClustersService_CreateGameServerCluster_async", + "title": "GameServerClustersService createGameServerCluster Sample", + "origin": "API_DEFINITION", + "description": " Creates a new game server cluster in a given project and location.", + "canonical": true, + "file": "game_server_clusters_service.create_game_server_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateGameServerCluster", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService.CreateGameServerCluster", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "game_server_cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "game_server_cluster", + "type": ".google.cloud.gaming.v1beta.GameServerCluster" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "GameServerClustersServiceClient", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersServiceClient" + }, + "method": { + "shortName": "CreateGameServerCluster", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService.CreateGameServerCluster", + "service": { + "shortName": "GameServerClustersService", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_GameServerClustersService_PreviewCreateGameServerCluster_async", + "title": "GameServerClustersService previewCreateGameServerCluster Sample", + "origin": "API_DEFINITION", + "description": " Previews creation of a new game server cluster in a given project and location.", + "canonical": true, + "file": "game_server_clusters_service.preview_create_game_server_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PreviewCreateGameServerCluster", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService.PreviewCreateGameServerCluster", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "game_server_cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "game_server_cluster", + "type": ".google.cloud.gaming.v1beta.GameServerCluster" + }, + { + "name": "preview_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse", + "client": { + "shortName": "GameServerClustersServiceClient", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersServiceClient" + }, + "method": { + "shortName": "PreviewCreateGameServerCluster", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService.PreviewCreateGameServerCluster", + "service": { + "shortName": "GameServerClustersService", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_GameServerClustersService_DeleteGameServerCluster_async", + "title": "GameServerClustersService deleteGameServerCluster Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single game server cluster.", + "canonical": true, + "file": "game_server_clusters_service.delete_game_server_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteGameServerCluster", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService.DeleteGameServerCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "GameServerClustersServiceClient", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersServiceClient" + }, + "method": { + "shortName": "DeleteGameServerCluster", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService.DeleteGameServerCluster", + "service": { + "shortName": "GameServerClustersService", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_GameServerClustersService_PreviewDeleteGameServerCluster_async", + "title": "GameServerClustersService previewDeleteGameServerCluster Sample", + "origin": "API_DEFINITION", + "description": " Previews deletion of a single game server cluster.", + "canonical": true, + "file": "game_server_clusters_service.preview_delete_game_server_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PreviewDeleteGameServerCluster", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService.PreviewDeleteGameServerCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "preview_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse", + "client": { + "shortName": "GameServerClustersServiceClient", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersServiceClient" + }, + "method": { + "shortName": "PreviewDeleteGameServerCluster", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService.PreviewDeleteGameServerCluster", + "service": { + "shortName": "GameServerClustersService", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_GameServerClustersService_UpdateGameServerCluster_async", + "title": "GameServerClustersService updateGameServerCluster Sample", + "origin": "API_DEFINITION", + "description": " Patches a single game server cluster.", + "canonical": true, + "file": "game_server_clusters_service.update_game_server_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateGameServerCluster", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService.UpdateGameServerCluster", + "async": true, + "parameters": [ + { + "name": "game_server_cluster", + "type": ".google.cloud.gaming.v1beta.GameServerCluster" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "GameServerClustersServiceClient", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersServiceClient" + }, + "method": { + "shortName": "UpdateGameServerCluster", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService.UpdateGameServerCluster", + "service": { + "shortName": "GameServerClustersService", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_GameServerClustersService_PreviewUpdateGameServerCluster_async", + "title": "GameServerClustersService previewUpdateGameServerCluster Sample", + "origin": "API_DEFINITION", + "description": " Previews updating a GameServerCluster.", + "canonical": true, + "file": "game_server_clusters_service.preview_update_game_server_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PreviewUpdateGameServerCluster", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService.PreviewUpdateGameServerCluster", + "async": true, + "parameters": [ + { + "name": "game_server_cluster", + "type": ".google.cloud.gaming.v1beta.GameServerCluster" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "preview_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse", + "client": { + "shortName": "GameServerClustersServiceClient", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersServiceClient" + }, + "method": { + "shortName": "PreviewUpdateGameServerCluster", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService.PreviewUpdateGameServerCluster", + "service": { + "shortName": "GameServerClustersService", + "fullName": "google.cloud.gaming.v1beta.GameServerClustersService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_GameServerConfigsService_ListGameServerConfigs_async", + "title": "GameServerClustersService listGameServerConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists game server configs in a given project, location, and game server deployment.", + "canonical": true, + "file": "game_server_configs_service.list_game_server_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListGameServerConfigs", + "fullName": "google.cloud.gaming.v1beta.GameServerConfigsService.ListGameServerConfigs", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gaming.v1beta.ListGameServerConfigsResponse", + "client": { + "shortName": "GameServerConfigsServiceClient", + "fullName": "google.cloud.gaming.v1beta.GameServerConfigsServiceClient" + }, + "method": { + "shortName": "ListGameServerConfigs", + "fullName": "google.cloud.gaming.v1beta.GameServerConfigsService.ListGameServerConfigs", + "service": { + "shortName": "GameServerConfigsService", + "fullName": "google.cloud.gaming.v1beta.GameServerConfigsService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_GameServerConfigsService_GetGameServerConfig_async", + "title": "GameServerClustersService getGameServerConfig Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single game server config.", + "canonical": true, + "file": "game_server_configs_service.get_game_server_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGameServerConfig", + "fullName": "google.cloud.gaming.v1beta.GameServerConfigsService.GetGameServerConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gaming.v1beta.GameServerConfig", + "client": { + "shortName": "GameServerConfigsServiceClient", + "fullName": "google.cloud.gaming.v1beta.GameServerConfigsServiceClient" + }, + "method": { + "shortName": "GetGameServerConfig", + "fullName": "google.cloud.gaming.v1beta.GameServerConfigsService.GetGameServerConfig", + "service": { + "shortName": "GameServerConfigsService", + "fullName": "google.cloud.gaming.v1beta.GameServerConfigsService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_GameServerConfigsService_CreateGameServerConfig_async", + "title": "GameServerClustersService createGameServerConfig Sample", + "origin": "API_DEFINITION", + "description": " Creates a new game server config in a given project, location, and game server deployment. Game server configs are immutable, and are not applied until referenced in the game server deployment rollout resource.", + "canonical": true, + "file": "game_server_configs_service.create_game_server_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateGameServerConfig", + "fullName": "google.cloud.gaming.v1beta.GameServerConfigsService.CreateGameServerConfig", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "config_id", + "type": "TYPE_STRING" + }, + { + "name": "game_server_config", + "type": ".google.cloud.gaming.v1beta.GameServerConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "GameServerConfigsServiceClient", + "fullName": "google.cloud.gaming.v1beta.GameServerConfigsServiceClient" + }, + "method": { + "shortName": "CreateGameServerConfig", + "fullName": "google.cloud.gaming.v1beta.GameServerConfigsService.CreateGameServerConfig", + "service": { + "shortName": "GameServerConfigsService", + "fullName": "google.cloud.gaming.v1beta.GameServerConfigsService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_GameServerConfigsService_DeleteGameServerConfig_async", + "title": "GameServerClustersService deleteGameServerConfig Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single game server config. The deletion will fail if the game server config is referenced in a game server deployment rollout.", + "canonical": true, + "file": "game_server_configs_service.delete_game_server_config.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteGameServerConfig", + "fullName": "google.cloud.gaming.v1beta.GameServerConfigsService.DeleteGameServerConfig", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "GameServerConfigsServiceClient", + "fullName": "google.cloud.gaming.v1beta.GameServerConfigsServiceClient" + }, + "method": { + "shortName": "DeleteGameServerConfig", + "fullName": "google.cloud.gaming.v1beta.GameServerConfigsService.DeleteGameServerConfig", + "service": { + "shortName": "GameServerConfigsService", + "fullName": "google.cloud.gaming.v1beta.GameServerConfigsService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_GameServerDeploymentsService_ListGameServerDeployments_async", + "title": "GameServerClustersService listGameServerDeployments Sample", + "origin": "API_DEFINITION", + "description": " Lists game server deployments in a given project and location.", + "canonical": true, + "file": "game_server_deployments_service.list_game_server_deployments.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListGameServerDeployments", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService.ListGameServerDeployments", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse", + "client": { + "shortName": "GameServerDeploymentsServiceClient", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsServiceClient" + }, + "method": { + "shortName": "ListGameServerDeployments", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService.ListGameServerDeployments", + "service": { + "shortName": "GameServerDeploymentsService", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_GameServerDeploymentsService_GetGameServerDeployment_async", + "title": "GameServerClustersService getGameServerDeployment Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single game server deployment.", + "canonical": true, + "file": "game_server_deployments_service.get_game_server_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGameServerDeployment", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService.GetGameServerDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gaming.v1beta.GameServerDeployment", + "client": { + "shortName": "GameServerDeploymentsServiceClient", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsServiceClient" + }, + "method": { + "shortName": "GetGameServerDeployment", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService.GetGameServerDeployment", + "service": { + "shortName": "GameServerDeploymentsService", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_GameServerDeploymentsService_CreateGameServerDeployment_async", + "title": "GameServerClustersService createGameServerDeployment Sample", + "origin": "API_DEFINITION", + "description": " Creates a new game server deployment in a given project and location.", + "canonical": true, + "file": "game_server_deployments_service.create_game_server_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateGameServerDeployment", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService.CreateGameServerDeployment", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "deployment_id", + "type": "TYPE_STRING" + }, + { + "name": "game_server_deployment", + "type": ".google.cloud.gaming.v1beta.GameServerDeployment" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "GameServerDeploymentsServiceClient", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsServiceClient" + }, + "method": { + "shortName": "CreateGameServerDeployment", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService.CreateGameServerDeployment", + "service": { + "shortName": "GameServerDeploymentsService", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_GameServerDeploymentsService_DeleteGameServerDeployment_async", + "title": "GameServerClustersService deleteGameServerDeployment Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single game server deployment.", + "canonical": true, + "file": "game_server_deployments_service.delete_game_server_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteGameServerDeployment", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService.DeleteGameServerDeployment", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "GameServerDeploymentsServiceClient", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsServiceClient" + }, + "method": { + "shortName": "DeleteGameServerDeployment", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService.DeleteGameServerDeployment", + "service": { + "shortName": "GameServerDeploymentsService", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_GameServerDeploymentsService_UpdateGameServerDeployment_async", + "title": "GameServerClustersService updateGameServerDeployment Sample", + "origin": "API_DEFINITION", + "description": " Patches a game server deployment.", + "canonical": true, + "file": "game_server_deployments_service.update_game_server_deployment.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateGameServerDeployment", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService.UpdateGameServerDeployment", + "async": true, + "parameters": [ + { + "name": "game_server_deployment", + "type": ".google.cloud.gaming.v1beta.GameServerDeployment" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "GameServerDeploymentsServiceClient", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsServiceClient" + }, + "method": { + "shortName": "UpdateGameServerDeployment", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService.UpdateGameServerDeployment", + "service": { + "shortName": "GameServerDeploymentsService", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_GameServerDeploymentsService_GetGameServerDeploymentRollout_async", + "title": "GameServerClustersService getGameServerDeploymentRollout Sample", + "origin": "API_DEFINITION", + "description": " Gets details a single game server deployment rollout.", + "canonical": true, + "file": "game_server_deployments_service.get_game_server_deployment_rollout.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGameServerDeploymentRollout", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService.GetGameServerDeploymentRollout", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gaming.v1beta.GameServerDeploymentRollout", + "client": { + "shortName": "GameServerDeploymentsServiceClient", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsServiceClient" + }, + "method": { + "shortName": "GetGameServerDeploymentRollout", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService.GetGameServerDeploymentRollout", + "service": { + "shortName": "GameServerDeploymentsService", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_GameServerDeploymentsService_UpdateGameServerDeploymentRollout_async", + "title": "GameServerClustersService updateGameServerDeploymentRollout Sample", + "origin": "API_DEFINITION", + "description": " Patches a single game server deployment rollout. The method will not return an error if the update does not affect any existing realms. For example - if the default_game_server_config is changed but all existing realms use the override, that is valid. Similarly, if a non existing realm is explicitly called out in game_server_config_overrides field, that will also not result in an error.", + "canonical": true, + "file": "game_server_deployments_service.update_game_server_deployment_rollout.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateGameServerDeploymentRollout", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService.UpdateGameServerDeploymentRollout", + "async": true, + "parameters": [ + { + "name": "rollout", + "type": ".google.cloud.gaming.v1beta.GameServerDeploymentRollout" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "GameServerDeploymentsServiceClient", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsServiceClient" + }, + "method": { + "shortName": "UpdateGameServerDeploymentRollout", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService.UpdateGameServerDeploymentRollout", + "service": { + "shortName": "GameServerDeploymentsService", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_GameServerDeploymentsService_PreviewGameServerDeploymentRollout_async", + "title": "GameServerClustersService previewGameServerDeploymentRollout Sample", + "origin": "API_DEFINITION", + "description": " Previews the game server deployment rollout. This API does not mutate the rollout resource.", + "canonical": true, + "file": "game_server_deployments_service.preview_game_server_deployment_rollout.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PreviewGameServerDeploymentRollout", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService.PreviewGameServerDeploymentRollout", + "async": true, + "parameters": [ + { + "name": "rollout", + "type": ".google.cloud.gaming.v1beta.GameServerDeploymentRollout" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "preview_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse", + "client": { + "shortName": "GameServerDeploymentsServiceClient", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsServiceClient" + }, + "method": { + "shortName": "PreviewGameServerDeploymentRollout", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService.PreviewGameServerDeploymentRollout", + "service": { + "shortName": "GameServerDeploymentsService", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_GameServerDeploymentsService_FetchDeploymentState_async", + "title": "GameServerClustersService fetchDeploymentState Sample", + "origin": "API_DEFINITION", + "description": " Retrieves information about the current state of the game server deployment. Gathers all the Agones fleets and Agones autoscalers, including fleets running an older version of the game server deployment.", + "canonical": true, + "file": "game_server_deployments_service.fetch_deployment_state.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchDeploymentState", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService.FetchDeploymentState", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gaming.v1beta.FetchDeploymentStateResponse", + "client": { + "shortName": "GameServerDeploymentsServiceClient", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsServiceClient" + }, + "method": { + "shortName": "FetchDeploymentState", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService.FetchDeploymentState", + "service": { + "shortName": "GameServerDeploymentsService", + "fullName": "google.cloud.gaming.v1beta.GameServerDeploymentsService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_RealmsService_ListRealms_async", + "title": "GameServerClustersService listRealms Sample", + "origin": "API_DEFINITION", + "description": " Lists realms in a given project and location.", + "canonical": true, + "file": "realms_service.list_realms.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRealms", + "fullName": "google.cloud.gaming.v1beta.RealmsService.ListRealms", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gaming.v1beta.ListRealmsResponse", + "client": { + "shortName": "RealmsServiceClient", + "fullName": "google.cloud.gaming.v1beta.RealmsServiceClient" + }, + "method": { + "shortName": "ListRealms", + "fullName": "google.cloud.gaming.v1beta.RealmsService.ListRealms", + "service": { + "shortName": "RealmsService", + "fullName": "google.cloud.gaming.v1beta.RealmsService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_RealmsService_GetRealm_async", + "title": "GameServerClustersService getRealm Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single realm.", + "canonical": true, + "file": "realms_service.get_realm.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRealm", + "fullName": "google.cloud.gaming.v1beta.RealmsService.GetRealm", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.gaming.v1beta.Realm", + "client": { + "shortName": "RealmsServiceClient", + "fullName": "google.cloud.gaming.v1beta.RealmsServiceClient" + }, + "method": { + "shortName": "GetRealm", + "fullName": "google.cloud.gaming.v1beta.RealmsService.GetRealm", + "service": { + "shortName": "RealmsService", + "fullName": "google.cloud.gaming.v1beta.RealmsService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_RealmsService_CreateRealm_async", + "title": "GameServerClustersService createRealm Sample", + "origin": "API_DEFINITION", + "description": " Creates a new realm in a given project and location.", + "canonical": true, + "file": "realms_service.create_realm.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 65, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateRealm", + "fullName": "google.cloud.gaming.v1beta.RealmsService.CreateRealm", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "realm_id", + "type": "TYPE_STRING" + }, + { + "name": "realm", + "type": ".google.cloud.gaming.v1beta.Realm" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "RealmsServiceClient", + "fullName": "google.cloud.gaming.v1beta.RealmsServiceClient" + }, + "method": { + "shortName": "CreateRealm", + "fullName": "google.cloud.gaming.v1beta.RealmsService.CreateRealm", + "service": { + "shortName": "RealmsService", + "fullName": "google.cloud.gaming.v1beta.RealmsService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_RealmsService_DeleteRealm_async", + "title": "GameServerClustersService deleteRealm Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single realm.", + "canonical": true, + "file": "realms_service.delete_realm.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteRealm", + "fullName": "google.cloud.gaming.v1beta.RealmsService.DeleteRealm", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "RealmsServiceClient", + "fullName": "google.cloud.gaming.v1beta.RealmsServiceClient" + }, + "method": { + "shortName": "DeleteRealm", + "fullName": "google.cloud.gaming.v1beta.RealmsService.DeleteRealm", + "service": { + "shortName": "RealmsService", + "fullName": "google.cloud.gaming.v1beta.RealmsService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_RealmsService_UpdateRealm_async", + "title": "GameServerClustersService updateRealm Sample", + "origin": "API_DEFINITION", + "description": " Patches a single realm.", + "canonical": true, + "file": "realms_service.update_realm.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateRealm", + "fullName": "google.cloud.gaming.v1beta.RealmsService.UpdateRealm", + "async": true, + "parameters": [ + { + "name": "realm", + "type": ".google.cloud.gaming.v1beta.Realm" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "RealmsServiceClient", + "fullName": "google.cloud.gaming.v1beta.RealmsServiceClient" + }, + "method": { + "shortName": "UpdateRealm", + "fullName": "google.cloud.gaming.v1beta.RealmsService.UpdateRealm", + "service": { + "shortName": "RealmsService", + "fullName": "google.cloud.gaming.v1beta.RealmsService" + } + } + } + }, + { + "regionTag": "gameservices_v1beta_generated_RealmsService_PreviewRealmUpdate_async", + "title": "GameServerClustersService previewRealmUpdate Sample", + "origin": "API_DEFINITION", + "description": " Previews patches to a single realm.", + "canonical": true, + "file": "realms_service.preview_realm_update.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 67, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "PreviewRealmUpdate", + "fullName": "google.cloud.gaming.v1beta.RealmsService.PreviewRealmUpdate", + "async": true, + "parameters": [ + { + "name": "realm", + "type": ".google.cloud.gaming.v1beta.Realm" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "preview_time", + "type": ".google.protobuf.Timestamp" + } + ], + "resultType": ".google.cloud.gaming.v1beta.PreviewRealmUpdateResponse", + "client": { + "shortName": "RealmsServiceClient", + "fullName": "google.cloud.gaming.v1beta.RealmsServiceClient" + }, + "method": { + "shortName": "PreviewRealmUpdate", + "fullName": "google.cloud.gaming.v1beta.RealmsService.PreviewRealmUpdate", + "service": { + "shortName": "RealmsService", + "fullName": "google.cloud.gaming.v1beta.RealmsService" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json new file mode 100644 index 00000000000..2dbc7d672ac --- /dev/null +++ b/packages/google-cloud-gaming/samples/package.json @@ -0,0 +1,24 @@ +{ + "name": "nodejs-game-server-samples", + "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/game-servers": "^3.1.3" + }, + "devDependencies": { + "c8": "^7.2.1", + "chai": "^4.2.0", + "mocha": "^8.0.0", + "uuid": "^9.0.0" + } +} diff --git a/packages/google-cloud-gaming/samples/quickstart.js b/packages/google-cloud-gaming/samples/quickstart.js new file mode 100644 index 00000000000..3a9c542322b --- /dev/null +++ b/packages/google-cloud-gaming/samples/quickstart.js @@ -0,0 +1,67 @@ +// 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. + +'use strict'; + +// sample-metadata: +// title: Create Game Server Realm +// description: Creates a new Realm within Cloud Game Servers +// usage: node quickstart.js + +/** + * Create a Game Servers realm. + * @param {string} projectId string project identifier. + * @param {string} location Compute Engine region. + * @param {string} realmId unique identifier for the realm. + */ +async function main(projectId, location, realmId) { + // [START cloud_game_servers_quickstart] + const {RealmsServiceClient} = require('@google-cloud/game-servers'); + + async function quickstart() { + const client = new RealmsServiceClient(); + + // TODO(developer): uncomment the following section, and add values + // const projectId = 'YOUR_PROJECT_ID'; + // const location = 'us-central1; + // const realmId = 'DESIRED_REALM_ID'; + + const request = { + parent: `projects/${projectId}/locations/${location}`, + realmId, + realm: { + // Must use a valid support time zone. + // See https://cloud.google.com/dataprep/docs/html/Supported-Time-Zone-Values_66194188 + timeZone: 'US/Pacific', + description: 'My Game Server realm', + }, + }; + + const [operation] = await client.createRealm(request); + const results = await operation.promise(); + const [realm] = results; + + console.log('Realm created:'); + + console.log(`\tRealm name: ${realm.name}`); + console.log(`\tRealm description: ${realm.description}`); + console.log(`\tRealm time zone: ${realm.timeZone}`); + } + quickstart(); + // [END cloud_game_servers_quickstart] +} + +main(...process.argv.slice(2)).catch(err => { + console.error(err); + process.exitCode = 1; +}); diff --git a/packages/google-cloud-gaming/samples/test/quickstart.test.js b/packages/google-cloud-gaming/samples/test/quickstart.test.js new file mode 100644 index 00000000000..e9faf4f0756 --- /dev/null +++ b/packages/google-cloud-gaming/samples/test/quickstart.test.js @@ -0,0 +1,53 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +const {assert} = require('chai'); +const cp = require('child_process'); +const {describe, it, after, before} = require('mocha'); +const uuid = require('uuid'); +const {RealmsServiceClient} = require('@google-cloud/game-servers'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +describe('Quickstart', () => { + let projectId; + let client; + const location = 'us-central1'; + const realmId = `realm-${uuid.v4().split('-')[0]}`; + + before(async () => { + client = new RealmsServiceClient(); + projectId = await client.getProjectId(); + }); + + it('should run quickstart', async () => { + const stdout = execSync( + `node quickstart.js ${projectId} ${location} ${realmId}` + ); + assert.include(stdout, 'Realm created:'); + }); + + after(async () => { + const [operation] = await client.deleteRealm({ + name: client.realmPath(projectId, location, realmId), + }); + await operation.promise(); + }); +}); diff --git a/packages/google-cloud-gaming/src/index.ts b/packages/google-cloud-gaming/src/index.ts new file mode 100644 index 00000000000..15ebde47822 --- /dev/null +++ b/packages/google-cloud-gaming/src/index.ts @@ -0,0 +1,49 @@ +// 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 v1beta from './v1beta'; + +const GameServerClustersServiceClient = v1.GameServerClustersServiceClient; +type GameServerClustersServiceClient = v1.GameServerClustersServiceClient; +const GameServerConfigsServiceClient = v1.GameServerConfigsServiceClient; +type GameServerConfigsServiceClient = v1.GameServerConfigsServiceClient; +const GameServerDeploymentsServiceClient = + v1.GameServerDeploymentsServiceClient; +type GameServerDeploymentsServiceClient = v1.GameServerDeploymentsServiceClient; +const RealmsServiceClient = v1.RealmsServiceClient; +type RealmsServiceClient = v1.RealmsServiceClient; + +export { + v1, + v1beta, + GameServerClustersServiceClient, + GameServerConfigsServiceClient, + GameServerDeploymentsServiceClient, + RealmsServiceClient, +}; +export default { + v1, + v1beta, + GameServerClustersServiceClient, + GameServerConfigsServiceClient, + GameServerDeploymentsServiceClient, + RealmsServiceClient, +}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-gaming/src/v1/game_server_clusters_service_client.ts b/packages/google-cloud-gaming/src/v1/game_server_clusters_service_client.ts new file mode 100644 index 00000000000..cafff0368fa --- /dev/null +++ b/packages/google-cloud-gaming/src/v1/game_server_clusters_service_client.ts @@ -0,0 +1,1910 @@ +// 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/game_server_clusters_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './game_server_clusters_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The game server cluster maps to Kubernetes clusters running Agones and is + * used to manage fleets within clusters. + * @class + * @memberof v1 + */ +export class GameServerClustersServiceClient { + 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; + gameServerClustersServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of GameServerClustersServiceClient. + * + * @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 GameServerClustersServiceClient({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 GameServerClustersServiceClient; + 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 = { + gameServerClusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}' + ), + gameServerConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}' + ), + gameServerDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}' + ), + gameServerDeploymentRolloutPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout' + ), + realmPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}' + ), + }; + + // 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 = { + listGameServerClusters: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'gameServerClusters' + ), + }; + + 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.cloud.location.Locations.GetLocation', + get: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1/{resource=projects/*/locations/*/gameServerDeployments/*}:getIamPolicy', + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/gameServerDeployments/*}:setIamPolicy', + body: '*', + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/gameServerDeployments/*}:testIamPermissions', + body: '*', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createGameServerClusterResponse = protoFilesRoot.lookup( + '.google.cloud.gaming.v1.GameServerCluster' + ) as gax.protobuf.Type; + const createGameServerClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteGameServerClusterResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteGameServerClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateGameServerClusterResponse = protoFilesRoot.lookup( + '.google.cloud.gaming.v1.GameServerCluster' + ) as gax.protobuf.Type; + const updateGameServerClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createGameServerCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createGameServerClusterResponse.decode.bind( + createGameServerClusterResponse + ), + createGameServerClusterMetadata.decode.bind( + createGameServerClusterMetadata + ) + ), + deleteGameServerCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteGameServerClusterResponse.decode.bind( + deleteGameServerClusterResponse + ), + deleteGameServerClusterMetadata.decode.bind( + deleteGameServerClusterMetadata + ) + ), + updateGameServerCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateGameServerClusterResponse.decode.bind( + updateGameServerClusterResponse + ), + updateGameServerClusterMetadata.decode.bind( + updateGameServerClusterMetadata + ) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.gaming.v1.GameServerClustersService', + 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.gameServerClustersServiceStub) { + return this.gameServerClustersServiceStub; + } + + // Put together the "service stub" for + // google.cloud.gaming.v1.GameServerClustersService. + this.gameServerClustersServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.gaming.v1.GameServerClustersService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.gaming.v1 + .GameServerClustersService, + 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 gameServerClustersServiceStubMethods = [ + 'listGameServerClusters', + 'getGameServerCluster', + 'createGameServerCluster', + 'previewCreateGameServerCluster', + 'deleteGameServerCluster', + 'previewDeleteGameServerCluster', + 'updateGameServerCluster', + 'previewUpdateGameServerCluster', + ]; + for (const methodName of gameServerClustersServiceStubMethods) { + const callPromise = this.gameServerClustersServiceStub.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.gameServerClustersServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'gameservices.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 'gameservices.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 -- + // ------------------- + /** + * Gets details of a single game server cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the game server cluster to retrieve, in the following form: + * `projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`. + * @param {google.cloud.gaming.v1.GameServerClusterView} [request.view] + * Optional. View for the returned GameServerCluster objects. When `FULL` is + * specified, the `cluster_state` field is also returned in the + * GameServerCluster object, which includes the state of the referenced + * Kubernetes cluster such as versions and provider info. The default/unset + * value is GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED, same as BASIC, which does + * not return the `cluster_state` field. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [GameServerCluster]{@link google.cloud.gaming.v1.GameServerCluster}. + * 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/game_server_clusters_service.get_game_server_cluster.js + * region_tag:gameservices_v1_generated_GameServerClustersService_GetGameServerCluster_async + */ + getGameServerCluster( + request?: protos.google.cloud.gaming.v1.IGetGameServerClusterRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1.IGameServerCluster, + protos.google.cloud.gaming.v1.IGetGameServerClusterRequest | undefined, + {} | undefined + ] + >; + getGameServerCluster( + request: protos.google.cloud.gaming.v1.IGetGameServerClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gaming.v1.IGameServerCluster, + | protos.google.cloud.gaming.v1.IGetGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGameServerCluster( + request: protos.google.cloud.gaming.v1.IGetGameServerClusterRequest, + callback: Callback< + protos.google.cloud.gaming.v1.IGameServerCluster, + | protos.google.cloud.gaming.v1.IGetGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGameServerCluster( + request?: protos.google.cloud.gaming.v1.IGetGameServerClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gaming.v1.IGameServerCluster, + | protos.google.cloud.gaming.v1.IGetGameServerClusterRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gaming.v1.IGameServerCluster, + | protos.google.cloud.gaming.v1.IGetGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gaming.v1.IGameServerCluster, + protos.google.cloud.gaming.v1.IGetGameServerClusterRequest | 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.getGameServerCluster(request, options, callback); + } + /** + * Previews creation of a new game server cluster in a given project and + * location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, in the following form: + * `projects/{project}/locations/{location}/realms/{realm}`. + * @param {string} request.gameServerClusterId + * Required. The ID of the game server cluster resource to be created. + * @param {google.cloud.gaming.v1.GameServerCluster} request.gameServerCluster + * Required. The game server cluster resource to be created. + * @param {google.protobuf.Timestamp} [request.previewTime] + * Optional. The target timestamp to compute the preview. + * @param {google.cloud.gaming.v1.GameServerClusterView} [request.view] + * Optional. This field is deprecated, preview will always return + * KubernetesClusterState. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [PreviewCreateGameServerClusterResponse]{@link google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse}. + * 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/game_server_clusters_service.preview_create_game_server_cluster.js + * region_tag:gameservices_v1_generated_GameServerClustersService_PreviewCreateGameServerCluster_async + */ + previewCreateGameServerCluster( + request?: protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse, + ( + | protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest + | undefined + ), + {} | undefined + ] + >; + previewCreateGameServerCluster( + request: protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse, + | protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): void; + previewCreateGameServerCluster( + request: protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest, + callback: Callback< + protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse, + | protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): void; + previewCreateGameServerCluster( + request?: protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse, + | protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse, + | protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse, + ( + | protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest + | 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.previewCreateGameServerCluster( + request, + options, + callback + ); + } + /** + * Previews deletion of a single game server cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the game server cluster to delete, in the following form: + * `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. + * @param {google.protobuf.Timestamp} [request.previewTime] + * Optional. The target timestamp to compute the preview. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [PreviewDeleteGameServerClusterResponse]{@link google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse}. + * 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/game_server_clusters_service.preview_delete_game_server_cluster.js + * region_tag:gameservices_v1_generated_GameServerClustersService_PreviewDeleteGameServerCluster_async + */ + previewDeleteGameServerCluster( + request?: protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse, + ( + | protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest + | undefined + ), + {} | undefined + ] + >; + previewDeleteGameServerCluster( + request: protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse, + | protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): void; + previewDeleteGameServerCluster( + request: protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest, + callback: Callback< + protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse, + | protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): void; + previewDeleteGameServerCluster( + request?: protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse, + | protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse, + | protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse, + ( + | protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest + | 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.previewDeleteGameServerCluster( + request, + options, + callback + ); + } + /** + * Previews updating a GameServerCluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.gaming.v1.GameServerCluster} request.gameServerCluster + * Required. The game server cluster to be updated. + * Only fields specified in update_mask are updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * @param {google.protobuf.Timestamp} [request.previewTime] + * Optional. The target timestamp to compute the preview. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [PreviewUpdateGameServerClusterResponse]{@link google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse}. + * 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/game_server_clusters_service.preview_update_game_server_cluster.js + * region_tag:gameservices_v1_generated_GameServerClustersService_PreviewUpdateGameServerCluster_async + */ + previewUpdateGameServerCluster( + request?: protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse, + ( + | protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest + | undefined + ), + {} | undefined + ] + >; + previewUpdateGameServerCluster( + request: protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse, + | protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): void; + previewUpdateGameServerCluster( + request: protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest, + callback: Callback< + protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse, + | protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): void; + previewUpdateGameServerCluster( + request?: protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse, + | protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse, + | protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse, + ( + | protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest + | 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({ + 'game_server_cluster.name': request.gameServerCluster!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.previewUpdateGameServerCluster( + request, + options, + callback + ); + } + + /** + * Creates a new game server cluster in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, in the following form: + * `projects/{project}/locations/{location}/realms/{realm-id}`. + * @param {string} request.gameServerClusterId + * Required. The ID of the game server cluster resource to be created. + * @param {google.cloud.gaming.v1.GameServerCluster} request.gameServerCluster + * Required. The game server cluster resource to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/game_server_clusters_service.create_game_server_cluster.js + * region_tag:gameservices_v1_generated_GameServerClustersService_CreateGameServerCluster_async + */ + createGameServerCluster( + request?: protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1.IGameServerCluster, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createGameServerCluster( + request: protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerCluster, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createGameServerCluster( + request: protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerCluster, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createGameServerCluster( + request?: protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerCluster, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerCluster, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1.IGameServerCluster, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createGameServerCluster( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createGameServerCluster()`. + * @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/game_server_clusters_service.create_game_server_cluster.js + * region_tag:gameservices_v1_generated_GameServerClustersService_CreateGameServerCluster_async + */ + async checkCreateGameServerClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1.GameServerCluster, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createGameServerCluster, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1.GameServerCluster, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + /** + * Deletes a single game server cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the game server cluster to delete, in the following form: + * `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/game_server_clusters_service.delete_game_server_cluster.js + * region_tag:gameservices_v1_generated_GameServerClustersService_DeleteGameServerCluster_async + */ + deleteGameServerCluster( + request?: protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteGameServerCluster( + request: protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGameServerCluster( + request: protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGameServerCluster( + request?: protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteGameServerCluster( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteGameServerCluster()`. + * @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/game_server_clusters_service.delete_game_server_cluster.js + * region_tag:gameservices_v1_generated_GameServerClustersService_DeleteGameServerCluster_async + */ + async checkDeleteGameServerClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteGameServerCluster, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + /** + * Patches a single game server cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.gaming.v1.GameServerCluster} request.gameServerCluster + * Required. The game server cluster to be updated. + * Only fields specified in update_mask are updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/game_server_clusters_service.update_game_server_cluster.js + * region_tag:gameservices_v1_generated_GameServerClustersService_UpdateGameServerCluster_async + */ + updateGameServerCluster( + request?: protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1.IGameServerCluster, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateGameServerCluster( + request: protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerCluster, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateGameServerCluster( + request: protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerCluster, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateGameServerCluster( + request?: protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerCluster, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerCluster, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1.IGameServerCluster, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'game_server_cluster.name': request.gameServerCluster!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateGameServerCluster( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updateGameServerCluster()`. + * @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/game_server_clusters_service.update_game_server_cluster.js + * region_tag:gameservices_v1_generated_GameServerClustersService_UpdateGameServerCluster_async + */ + async checkUpdateGameServerClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1.GameServerCluster, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateGameServerCluster, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1.GameServerCluster, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + /** + * Lists game server clusters in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, in the following form: + * "projects/{project}/locations/{location}/realms/{realm}". + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, the server + * will pick an appropriate default. The server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1.ListGameServerClustersResponse.next_page_token|next_page_token} to + * determine if there are more GameServerClusters left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous List request, if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @param {google.cloud.gaming.v1.GameServerClusterView} [request.view] + * Optional. View for the returned GameServerCluster objects. When `FULL` is + * specified, the `cluster_state` field is also returned in the + * GameServerCluster object, which includes the state of the referenced + * Kubernetes cluster such as versions and provider info. The default/unset + * value is GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED, same as BASIC, which does + * not return the `cluster_state` 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 [GameServerCluster]{@link google.cloud.gaming.v1.GameServerCluster}. + * 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 `listGameServerClustersAsync()` + * 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. + */ + listGameServerClusters( + request?: protos.google.cloud.gaming.v1.IListGameServerClustersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1.IGameServerCluster[], + protos.google.cloud.gaming.v1.IListGameServerClustersRequest | null, + protos.google.cloud.gaming.v1.IListGameServerClustersResponse + ] + >; + listGameServerClusters( + request: protos.google.cloud.gaming.v1.IListGameServerClustersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.gaming.v1.IListGameServerClustersRequest, + | protos.google.cloud.gaming.v1.IListGameServerClustersResponse + | null + | undefined, + protos.google.cloud.gaming.v1.IGameServerCluster + > + ): void; + listGameServerClusters( + request: protos.google.cloud.gaming.v1.IListGameServerClustersRequest, + callback: PaginationCallback< + protos.google.cloud.gaming.v1.IListGameServerClustersRequest, + | protos.google.cloud.gaming.v1.IListGameServerClustersResponse + | null + | undefined, + protos.google.cloud.gaming.v1.IGameServerCluster + > + ): void; + listGameServerClusters( + request?: protos.google.cloud.gaming.v1.IListGameServerClustersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.gaming.v1.IListGameServerClustersRequest, + | protos.google.cloud.gaming.v1.IListGameServerClustersResponse + | null + | undefined, + protos.google.cloud.gaming.v1.IGameServerCluster + >, + callback?: PaginationCallback< + protos.google.cloud.gaming.v1.IListGameServerClustersRequest, + | protos.google.cloud.gaming.v1.IListGameServerClustersResponse + | null + | undefined, + protos.google.cloud.gaming.v1.IGameServerCluster + > + ): Promise< + [ + protos.google.cloud.gaming.v1.IGameServerCluster[], + protos.google.cloud.gaming.v1.IListGameServerClustersRequest | null, + protos.google.cloud.gaming.v1.IListGameServerClustersResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listGameServerClusters( + 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, in the following form: + * "projects/{project}/locations/{location}/realms/{realm}". + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, the server + * will pick an appropriate default. The server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1.ListGameServerClustersResponse.next_page_token|next_page_token} to + * determine if there are more GameServerClusters left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous List request, if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @param {google.cloud.gaming.v1.GameServerClusterView} [request.view] + * Optional. View for the returned GameServerCluster objects. When `FULL` is + * specified, the `cluster_state` field is also returned in the + * GameServerCluster object, which includes the state of the referenced + * Kubernetes cluster such as versions and provider info. The default/unset + * value is GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED, same as BASIC, which does + * not return the `cluster_state` 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 [GameServerCluster]{@link google.cloud.gaming.v1.GameServerCluster} 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 `listGameServerClustersAsync()` + * 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. + */ + listGameServerClustersStream( + request?: protos.google.cloud.gaming.v1.IListGameServerClustersRequest, + 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['listGameServerClusters']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listGameServerClusters.createStream( + this.innerApiCalls.listGameServerClusters as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listGameServerClusters`, 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, in the following form: + * "projects/{project}/locations/{location}/realms/{realm}". + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, the server + * will pick an appropriate default. The server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1.ListGameServerClustersResponse.next_page_token|next_page_token} to + * determine if there are more GameServerClusters left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous List request, if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @param {google.cloud.gaming.v1.GameServerClusterView} [request.view] + * Optional. View for the returned GameServerCluster objects. When `FULL` is + * specified, the `cluster_state` field is also returned in the + * GameServerCluster object, which includes the state of the referenced + * Kubernetes cluster such as versions and provider info. The default/unset + * value is GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED, same as BASIC, which does + * not return the `cluster_state` 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 + * [GameServerCluster]{@link google.cloud.gaming.v1.GameServerCluster}. 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/game_server_clusters_service.list_game_server_clusters.js + * region_tag:gameservices_v1_generated_GameServerClustersService_ListGameServerClusters_async + */ + listGameServerClustersAsync( + request?: protos.google.cloud.gaming.v1.IListGameServerClustersRequest, + 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['listGameServerClusters']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listGameServerClusters.asyncIterate( + this.innerApiCalls['listGameServerClusters'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified gameServerCluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} realm + * @param {string} cluster + * @returns {string} Resource name string. + */ + gameServerClusterPath( + project: string, + location: string, + realm: string, + cluster: string + ) { + return this.pathTemplates.gameServerClusterPathTemplate.render({ + project: project, + location: location, + realm: realm, + cluster: cluster, + }); + } + + /** + * Parse the project from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).project; + } + + /** + * Parse the location from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).location; + } + + /** + * Parse the realm from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the realm. + */ + matchRealmFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).realm; + } + + /** + * Parse the cluster from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).cluster; + } + + /** + * Return a fully-qualified gameServerConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @param {string} config + * @returns {string} Resource name string. + */ + gameServerConfigPath( + project: string, + location: string, + deployment: string, + config: string + ) { + return this.pathTemplates.gameServerConfigPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + config: config, + }); + } + + /** + * Parse the project from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).project; + } + + /** + * Parse the location from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).location; + } + + /** + * Parse the deployment from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).deployment; + } + + /** + * Parse the config from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the config. + */ + matchConfigFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).config; + } + + /** + * Return a fully-qualified gameServerDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + gameServerDeploymentPath( + project: string, + location: string, + deployment: string + ) { + return this.pathTemplates.gameServerDeploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerDeploymentName(gameServerDeploymentName: string) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).project; + } + + /** + * Parse the location from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerDeploymentName(gameServerDeploymentName: string) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).location; + } + + /** + * Parse the deployment from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerDeploymentName( + gameServerDeploymentName: string + ) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).deployment; + } + + /** + * Return a fully-qualified gameServerDeploymentRollout resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + gameServerDeploymentRolloutPath( + project: string, + location: string, + deployment: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).project; + } + + /** + * Parse the location from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).location; + } + + /** + * Parse the deployment from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).deployment; + } + + /** + * Return a fully-qualified realm resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} realm + * @returns {string} Resource name string. + */ + realmPath(project: string, location: string, realm: string) { + return this.pathTemplates.realmPathTemplate.render({ + project: project, + location: location, + realm: realm, + }); + } + + /** + * Parse the project from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).project; + } + + /** + * Parse the location from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).location; + } + + /** + * Parse the realm from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the realm. + */ + matchRealmFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).realm; + } + + /** + * 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.gameServerClustersServiceStub && !this._terminated) { + return this.gameServerClustersServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-gaming/src/v1/game_server_clusters_service_client_config.json b/packages/google-cloud-gaming/src/v1/game_server_clusters_service_client_config.json new file mode 100644 index 00000000000..98341816f2b --- /dev/null +++ b/packages/google-cloud-gaming/src/v1/game_server_clusters_service_client_config.json @@ -0,0 +1,78 @@ +{ + "interfaces": { + "google.cloud.gaming.v1.GameServerClustersService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListGameServerClusters": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetGameServerCluster": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateGameServerCluster": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PreviewCreateGameServerCluster": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteGameServerCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PreviewDeleteGameServerCluster": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateGameServerCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PreviewUpdateGameServerCluster": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-cloud-gaming/src/v1/game_server_clusters_service_proto_list.json b/packages/google-cloud-gaming/src/v1/game_server_clusters_service_proto_list.json new file mode 100644 index 00000000000..3fc5cf10aeb --- /dev/null +++ b/packages/google-cloud-gaming/src/v1/game_server_clusters_service_proto_list.json @@ -0,0 +1,11 @@ +[ + "../../protos/google/cloud/gaming/v1/common.proto", + "../../protos/google/cloud/gaming/v1/game_server_clusters.proto", + "../../protos/google/cloud/gaming/v1/game_server_clusters_service.proto", + "../../protos/google/cloud/gaming/v1/game_server_configs.proto", + "../../protos/google/cloud/gaming/v1/game_server_configs_service.proto", + "../../protos/google/cloud/gaming/v1/game_server_deployments.proto", + "../../protos/google/cloud/gaming/v1/game_server_deployments_service.proto", + "../../protos/google/cloud/gaming/v1/realms.proto", + "../../protos/google/cloud/gaming/v1/realms_service.proto" +] diff --git a/packages/google-cloud-gaming/src/v1/game_server_configs_service_client.ts b/packages/google-cloud-gaming/src/v1/game_server_configs_service_client.ts new file mode 100644 index 00000000000..e2e1993fd11 --- /dev/null +++ b/packages/google-cloud-gaming/src/v1/game_server_configs_service_client.ts @@ -0,0 +1,1390 @@ +// 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/game_server_configs_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './game_server_configs_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The game server config configures the game servers in an Agones fleet. + * @class + * @memberof v1 + */ +export class GameServerConfigsServiceClient { + 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; + gameServerConfigsServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of GameServerConfigsServiceClient. + * + * @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 GameServerConfigsServiceClient({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 GameServerConfigsServiceClient; + 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 = { + gameServerClusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}' + ), + gameServerConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}' + ), + gameServerDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}' + ), + gameServerDeploymentRolloutPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout' + ), + realmPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}' + ), + }; + + // 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 = { + listGameServerConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'gameServerConfigs' + ), + }; + + 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.cloud.location.Locations.GetLocation', + get: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1/{resource=projects/*/locations/*/gameServerDeployments/*}:getIamPolicy', + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/gameServerDeployments/*}:setIamPolicy', + body: '*', + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/gameServerDeployments/*}:testIamPermissions', + body: '*', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createGameServerConfigResponse = protoFilesRoot.lookup( + '.google.cloud.gaming.v1.GameServerConfig' + ) as gax.protobuf.Type; + const createGameServerConfigMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteGameServerConfigResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteGameServerConfigMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createGameServerConfig: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createGameServerConfigResponse.decode.bind( + createGameServerConfigResponse + ), + createGameServerConfigMetadata.decode.bind( + createGameServerConfigMetadata + ) + ), + deleteGameServerConfig: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteGameServerConfigResponse.decode.bind( + deleteGameServerConfigResponse + ), + deleteGameServerConfigMetadata.decode.bind( + deleteGameServerConfigMetadata + ) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.gaming.v1.GameServerConfigsService', + 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.gameServerConfigsServiceStub) { + return this.gameServerConfigsServiceStub; + } + + // Put together the "service stub" for + // google.cloud.gaming.v1.GameServerConfigsService. + this.gameServerConfigsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.gaming.v1.GameServerConfigsService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.gaming.v1.GameServerConfigsService, + 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 gameServerConfigsServiceStubMethods = [ + 'listGameServerConfigs', + 'getGameServerConfig', + 'createGameServerConfig', + 'deleteGameServerConfig', + ]; + for (const methodName of gameServerConfigsServiceStubMethods) { + const callPromise = this.gameServerConfigsServiceStub.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.gameServerConfigsServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'gameservices.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 'gameservices.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 -- + // ------------------- + /** + * Gets details of a single game server config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the game server config to retrieve, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [GameServerConfig]{@link google.cloud.gaming.v1.GameServerConfig}. + * 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/game_server_configs_service.get_game_server_config.js + * region_tag:gameservices_v1_generated_GameServerConfigsService_GetGameServerConfig_async + */ + getGameServerConfig( + request?: protos.google.cloud.gaming.v1.IGetGameServerConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1.IGameServerConfig, + protos.google.cloud.gaming.v1.IGetGameServerConfigRequest | undefined, + {} | undefined + ] + >; + getGameServerConfig( + request: protos.google.cloud.gaming.v1.IGetGameServerConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gaming.v1.IGameServerConfig, + | protos.google.cloud.gaming.v1.IGetGameServerConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGameServerConfig( + request: protos.google.cloud.gaming.v1.IGetGameServerConfigRequest, + callback: Callback< + protos.google.cloud.gaming.v1.IGameServerConfig, + | protos.google.cloud.gaming.v1.IGetGameServerConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGameServerConfig( + request?: protos.google.cloud.gaming.v1.IGetGameServerConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gaming.v1.IGameServerConfig, + | protos.google.cloud.gaming.v1.IGetGameServerConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gaming.v1.IGameServerConfig, + | protos.google.cloud.gaming.v1.IGetGameServerConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gaming.v1.IGameServerConfig, + protos.google.cloud.gaming.v1.IGetGameServerConfigRequest | 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.getGameServerConfig(request, options, callback); + } + + /** + * Creates a new game server config in a given project, location, and game + * server deployment. Game server configs are immutable, and are not applied + * until referenced in the game server deployment rollout resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/`. + * @param {string} request.configId + * Required. The ID of the game server config resource to be created. + * @param {google.cloud.gaming.v1.GameServerConfig} request.gameServerConfig + * Required. The game server config resource to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/game_server_configs_service.create_game_server_config.js + * region_tag:gameservices_v1_generated_GameServerConfigsService_CreateGameServerConfig_async + */ + createGameServerConfig( + request?: protos.google.cloud.gaming.v1.ICreateGameServerConfigRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1.IGameServerConfig, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createGameServerConfig( + request: protos.google.cloud.gaming.v1.ICreateGameServerConfigRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerConfig, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createGameServerConfig( + request: protos.google.cloud.gaming.v1.ICreateGameServerConfigRequest, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerConfig, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createGameServerConfig( + request?: protos.google.cloud.gaming.v1.ICreateGameServerConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerConfig, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerConfig, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1.IGameServerConfig, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createGameServerConfig( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createGameServerConfig()`. + * @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/game_server_configs_service.create_game_server_config.js + * region_tag:gameservices_v1_generated_GameServerConfigsService_CreateGameServerConfig_async + */ + async checkCreateGameServerConfigProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1.GameServerConfig, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createGameServerConfig, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1.GameServerConfig, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + /** + * Deletes a single game server config. The deletion will fail if the game + * server config is referenced in a game server deployment rollout. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the game server config to delete, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/game_server_configs_service.delete_game_server_config.js + * region_tag:gameservices_v1_generated_GameServerConfigsService_DeleteGameServerConfig_async + */ + deleteGameServerConfig( + request?: protos.google.cloud.gaming.v1.IDeleteGameServerConfigRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteGameServerConfig( + request: protos.google.cloud.gaming.v1.IDeleteGameServerConfigRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGameServerConfig( + request: protos.google.cloud.gaming.v1.IDeleteGameServerConfigRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGameServerConfig( + request?: protos.google.cloud.gaming.v1.IDeleteGameServerConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteGameServerConfig( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteGameServerConfig()`. + * @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/game_server_configs_service.delete_game_server_config.js + * region_tag:gameservices_v1_generated_GameServerConfigsService_DeleteGameServerConfig_async + */ + async checkDeleteGameServerConfigProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteGameServerConfig, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + /** + * Lists game server configs in a given project, location, and game server + * deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/*`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1.ListGameServerConfigsResponse.next_page_token|next_page_token} to + * determine if there are more GameServerConfigs left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request, if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [GameServerConfig]{@link google.cloud.gaming.v1.GameServerConfig}. + * 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 `listGameServerConfigsAsync()` + * 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. + */ + listGameServerConfigs( + request?: protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1.IGameServerConfig[], + protos.google.cloud.gaming.v1.IListGameServerConfigsRequest | null, + protos.google.cloud.gaming.v1.IListGameServerConfigsResponse + ] + >; + listGameServerConfigs( + request: protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, + | protos.google.cloud.gaming.v1.IListGameServerConfigsResponse + | null + | undefined, + protos.google.cloud.gaming.v1.IGameServerConfig + > + ): void; + listGameServerConfigs( + request: protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, + | protos.google.cloud.gaming.v1.IListGameServerConfigsResponse + | null + | undefined, + protos.google.cloud.gaming.v1.IGameServerConfig + > + ): void; + listGameServerConfigs( + request?: protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, + | protos.google.cloud.gaming.v1.IListGameServerConfigsResponse + | null + | undefined, + protos.google.cloud.gaming.v1.IGameServerConfig + >, + callback?: PaginationCallback< + protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, + | protos.google.cloud.gaming.v1.IListGameServerConfigsResponse + | null + | undefined, + protos.google.cloud.gaming.v1.IGameServerConfig + > + ): Promise< + [ + protos.google.cloud.gaming.v1.IGameServerConfig[], + protos.google.cloud.gaming.v1.IListGameServerConfigsRequest | null, + protos.google.cloud.gaming.v1.IListGameServerConfigsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listGameServerConfigs(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, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/*`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1.ListGameServerConfigsResponse.next_page_token|next_page_token} to + * determine if there are more GameServerConfigs left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request, if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @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 [GameServerConfig]{@link google.cloud.gaming.v1.GameServerConfig} 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 `listGameServerConfigsAsync()` + * 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. + */ + listGameServerConfigsStream( + request?: protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, + 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['listGameServerConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listGameServerConfigs.createStream( + this.innerApiCalls.listGameServerConfigs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listGameServerConfigs`, 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, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/*`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1.ListGameServerConfigsResponse.next_page_token|next_page_token} to + * determine if there are more GameServerConfigs left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request, if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @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 + * [GameServerConfig]{@link google.cloud.gaming.v1.GameServerConfig}. 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/game_server_configs_service.list_game_server_configs.js + * region_tag:gameservices_v1_generated_GameServerConfigsService_ListGameServerConfigs_async + */ + listGameServerConfigsAsync( + request?: protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, + 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['listGameServerConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listGameServerConfigs.asyncIterate( + this.innerApiCalls['listGameServerConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified gameServerCluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} realm + * @param {string} cluster + * @returns {string} Resource name string. + */ + gameServerClusterPath( + project: string, + location: string, + realm: string, + cluster: string + ) { + return this.pathTemplates.gameServerClusterPathTemplate.render({ + project: project, + location: location, + realm: realm, + cluster: cluster, + }); + } + + /** + * Parse the project from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).project; + } + + /** + * Parse the location from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).location; + } + + /** + * Parse the realm from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the realm. + */ + matchRealmFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).realm; + } + + /** + * Parse the cluster from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).cluster; + } + + /** + * Return a fully-qualified gameServerConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @param {string} config + * @returns {string} Resource name string. + */ + gameServerConfigPath( + project: string, + location: string, + deployment: string, + config: string + ) { + return this.pathTemplates.gameServerConfigPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + config: config, + }); + } + + /** + * Parse the project from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).project; + } + + /** + * Parse the location from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).location; + } + + /** + * Parse the deployment from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).deployment; + } + + /** + * Parse the config from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the config. + */ + matchConfigFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).config; + } + + /** + * Return a fully-qualified gameServerDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + gameServerDeploymentPath( + project: string, + location: string, + deployment: string + ) { + return this.pathTemplates.gameServerDeploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerDeploymentName(gameServerDeploymentName: string) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).project; + } + + /** + * Parse the location from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerDeploymentName(gameServerDeploymentName: string) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).location; + } + + /** + * Parse the deployment from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerDeploymentName( + gameServerDeploymentName: string + ) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).deployment; + } + + /** + * Return a fully-qualified gameServerDeploymentRollout resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + gameServerDeploymentRolloutPath( + project: string, + location: string, + deployment: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).project; + } + + /** + * Parse the location from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).location; + } + + /** + * Parse the deployment from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).deployment; + } + + /** + * Return a fully-qualified realm resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} realm + * @returns {string} Resource name string. + */ + realmPath(project: string, location: string, realm: string) { + return this.pathTemplates.realmPathTemplate.render({ + project: project, + location: location, + realm: realm, + }); + } + + /** + * Parse the project from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).project; + } + + /** + * Parse the location from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).location; + } + + /** + * Parse the realm from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the realm. + */ + matchRealmFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).realm; + } + + /** + * 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.gameServerConfigsServiceStub && !this._terminated) { + return this.gameServerConfigsServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-gaming/src/v1/game_server_configs_service_client_config.json b/packages/google-cloud-gaming/src/v1/game_server_configs_service_client_config.json new file mode 100644 index 00000000000..6bce34cf60f --- /dev/null +++ b/packages/google-cloud-gaming/src/v1/game_server_configs_service_client_config.json @@ -0,0 +1,58 @@ +{ + "interfaces": { + "google.cloud.gaming.v1.GameServerConfigsService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListGameServerConfigs": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetGameServerConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateGameServerConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteGameServerConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-gaming/src/v1/game_server_configs_service_proto_list.json b/packages/google-cloud-gaming/src/v1/game_server_configs_service_proto_list.json new file mode 100644 index 00000000000..3fc5cf10aeb --- /dev/null +++ b/packages/google-cloud-gaming/src/v1/game_server_configs_service_proto_list.json @@ -0,0 +1,11 @@ +[ + "../../protos/google/cloud/gaming/v1/common.proto", + "../../protos/google/cloud/gaming/v1/game_server_clusters.proto", + "../../protos/google/cloud/gaming/v1/game_server_clusters_service.proto", + "../../protos/google/cloud/gaming/v1/game_server_configs.proto", + "../../protos/google/cloud/gaming/v1/game_server_configs_service.proto", + "../../protos/google/cloud/gaming/v1/game_server_deployments.proto", + "../../protos/google/cloud/gaming/v1/game_server_deployments_service.proto", + "../../protos/google/cloud/gaming/v1/realms.proto", + "../../protos/google/cloud/gaming/v1/realms_service.proto" +] diff --git a/packages/google-cloud-gaming/src/v1/game_server_deployments_service_client.ts b/packages/google-cloud-gaming/src/v1/game_server_deployments_service_client.ts new file mode 100644 index 00000000000..2771132e87b --- /dev/null +++ b/packages/google-cloud-gaming/src/v1/game_server_deployments_service_client.ts @@ -0,0 +1,2040 @@ +// 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/game_server_deployments_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './game_server_deployments_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The game server deployment is used to control the deployment of Agones + * fleets. + * @class + * @memberof v1 + */ +export class GameServerDeploymentsServiceClient { + 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; + gameServerDeploymentsServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of GameServerDeploymentsServiceClient. + * + * @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 GameServerDeploymentsServiceClient({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 GameServerDeploymentsServiceClient; + 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 = { + gameServerClusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}' + ), + gameServerConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}' + ), + gameServerDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}' + ), + gameServerDeploymentRolloutPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout' + ), + realmPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}' + ), + }; + + // 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 = { + listGameServerDeployments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'gameServerDeployments' + ), + }; + + 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.cloud.location.Locations.GetLocation', + get: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1/{resource=projects/*/locations/*/gameServerDeployments/*}:getIamPolicy', + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/gameServerDeployments/*}:setIamPolicy', + body: '*', + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/gameServerDeployments/*}:testIamPermissions', + body: '*', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createGameServerDeploymentResponse = protoFilesRoot.lookup( + '.google.cloud.gaming.v1.GameServerDeployment' + ) as gax.protobuf.Type; + const createGameServerDeploymentMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteGameServerDeploymentResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteGameServerDeploymentMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateGameServerDeploymentResponse = protoFilesRoot.lookup( + '.google.cloud.gaming.v1.GameServerDeployment' + ) as gax.protobuf.Type; + const updateGameServerDeploymentMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateGameServerDeploymentRolloutResponse = protoFilesRoot.lookup( + '.google.cloud.gaming.v1.GameServerDeployment' + ) as gax.protobuf.Type; + const updateGameServerDeploymentRolloutMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createGameServerDeployment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createGameServerDeploymentResponse.decode.bind( + createGameServerDeploymentResponse + ), + createGameServerDeploymentMetadata.decode.bind( + createGameServerDeploymentMetadata + ) + ), + deleteGameServerDeployment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteGameServerDeploymentResponse.decode.bind( + deleteGameServerDeploymentResponse + ), + deleteGameServerDeploymentMetadata.decode.bind( + deleteGameServerDeploymentMetadata + ) + ), + updateGameServerDeployment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateGameServerDeploymentResponse.decode.bind( + updateGameServerDeploymentResponse + ), + updateGameServerDeploymentMetadata.decode.bind( + updateGameServerDeploymentMetadata + ) + ), + updateGameServerDeploymentRollout: + new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateGameServerDeploymentRolloutResponse.decode.bind( + updateGameServerDeploymentRolloutResponse + ), + updateGameServerDeploymentRolloutMetadata.decode.bind( + updateGameServerDeploymentRolloutMetadata + ) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.gaming.v1.GameServerDeploymentsService', + 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.gameServerDeploymentsServiceStub) { + return this.gameServerDeploymentsServiceStub; + } + + // Put together the "service stub" for + // google.cloud.gaming.v1.GameServerDeploymentsService. + this.gameServerDeploymentsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.gaming.v1.GameServerDeploymentsService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.gaming.v1 + .GameServerDeploymentsService, + 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 gameServerDeploymentsServiceStubMethods = [ + 'listGameServerDeployments', + 'getGameServerDeployment', + 'createGameServerDeployment', + 'deleteGameServerDeployment', + 'updateGameServerDeployment', + 'getGameServerDeploymentRollout', + 'updateGameServerDeploymentRollout', + 'previewGameServerDeploymentRollout', + 'fetchDeploymentState', + ]; + for (const methodName of gameServerDeploymentsServiceStubMethods) { + const callPromise = this.gameServerDeploymentsServiceStub.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.gameServerDeploymentsServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'gameservices.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 'gameservices.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 -- + // ------------------- + /** + * Gets details of a single game server deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the game server delpoyment to retrieve, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [GameServerDeployment]{@link google.cloud.gaming.v1.GameServerDeployment}. + * 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/game_server_deployments_service.get_game_server_deployment.js + * region_tag:gameservices_v1_generated_GameServerDeploymentsService_GetGameServerDeployment_async + */ + getGameServerDeployment( + request?: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IGetGameServerDeploymentRequest | undefined, + {} | undefined + ] + >; + getGameServerDeployment( + request: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gaming.v1.IGameServerDeployment, + | protos.google.cloud.gaming.v1.IGetGameServerDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGameServerDeployment( + request: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRequest, + callback: Callback< + protos.google.cloud.gaming.v1.IGameServerDeployment, + | protos.google.cloud.gaming.v1.IGetGameServerDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGameServerDeployment( + request?: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gaming.v1.IGameServerDeployment, + | protos.google.cloud.gaming.v1.IGetGameServerDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gaming.v1.IGameServerDeployment, + | protos.google.cloud.gaming.v1.IGetGameServerDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IGetGameServerDeploymentRequest | 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.getGameServerDeployment( + request, + options, + callback + ); + } + /** + * Gets details a single game server deployment rollout. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the game server delpoyment to retrieve, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [GameServerDeploymentRollout]{@link google.cloud.gaming.v1.GameServerDeploymentRollout}. + * 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/game_server_deployments_service.get_game_server_deployment_rollout.js + * region_tag:gameservices_v1_generated_GameServerDeploymentsService_GetGameServerDeploymentRollout_async + */ + getGameServerDeploymentRollout( + request?: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1.IGameServerDeploymentRollout, + ( + | protos.google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest + | undefined + ), + {} | undefined + ] + >; + getGameServerDeploymentRollout( + request: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gaming.v1.IGameServerDeploymentRollout, + | protos.google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGameServerDeploymentRollout( + request: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest, + callback: Callback< + protos.google.cloud.gaming.v1.IGameServerDeploymentRollout, + | protos.google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGameServerDeploymentRollout( + request?: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gaming.v1.IGameServerDeploymentRollout, + | protos.google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gaming.v1.IGameServerDeploymentRollout, + | protos.google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gaming.v1.IGameServerDeploymentRollout, + ( + | protos.google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest + | 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.getGameServerDeploymentRollout( + request, + options, + callback + ); + } + /** + * Previews the game server deployment rollout. This API does not mutate the + * rollout resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.gaming.v1.GameServerDeploymentRollout} request.rollout + * Required. The game server deployment rollout to be updated. + * Only fields specified in update_mask are updated. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * @param {google.protobuf.Timestamp} [request.previewTime] + * Optional. The target timestamp to compute the preview. Defaults to the immediately + * after the proposed rollout completes. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [PreviewGameServerDeploymentRolloutResponse]{@link google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse}. + * 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/game_server_deployments_service.preview_game_server_deployment_rollout.js + * region_tag:gameservices_v1_generated_GameServerDeploymentsService_PreviewGameServerDeploymentRollout_async + */ + previewGameServerDeploymentRollout( + request?: protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutResponse, + ( + | protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest + | undefined + ), + {} | undefined + ] + >; + previewGameServerDeploymentRollout( + request: protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutResponse, + | protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest + | null + | undefined, + {} | null | undefined + > + ): void; + previewGameServerDeploymentRollout( + request: protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest, + callback: Callback< + protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutResponse, + | protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest + | null + | undefined, + {} | null | undefined + > + ): void; + previewGameServerDeploymentRollout( + request?: protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutResponse, + | protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutResponse, + | protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutResponse, + ( + | protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest + | 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({ + 'rollout.name': request.rollout!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.previewGameServerDeploymentRollout( + request, + options, + callback + ); + } + /** + * Retrieves information about the current state of the game server + * deployment. Gathers all the Agones fleets and Agones autoscalers, + * including fleets running an older version of the game server deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the game server delpoyment, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [FetchDeploymentStateResponse]{@link google.cloud.gaming.v1.FetchDeploymentStateResponse}. + * 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/game_server_deployments_service.fetch_deployment_state.js + * region_tag:gameservices_v1_generated_GameServerDeploymentsService_FetchDeploymentState_async + */ + fetchDeploymentState( + request?: protos.google.cloud.gaming.v1.IFetchDeploymentStateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1.IFetchDeploymentStateResponse, + protos.google.cloud.gaming.v1.IFetchDeploymentStateRequest | undefined, + {} | undefined + ] + >; + fetchDeploymentState( + request: protos.google.cloud.gaming.v1.IFetchDeploymentStateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gaming.v1.IFetchDeploymentStateResponse, + | protos.google.cloud.gaming.v1.IFetchDeploymentStateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + fetchDeploymentState( + request: protos.google.cloud.gaming.v1.IFetchDeploymentStateRequest, + callback: Callback< + protos.google.cloud.gaming.v1.IFetchDeploymentStateResponse, + | protos.google.cloud.gaming.v1.IFetchDeploymentStateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + fetchDeploymentState( + request?: protos.google.cloud.gaming.v1.IFetchDeploymentStateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gaming.v1.IFetchDeploymentStateResponse, + | protos.google.cloud.gaming.v1.IFetchDeploymentStateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gaming.v1.IFetchDeploymentStateResponse, + | protos.google.cloud.gaming.v1.IFetchDeploymentStateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gaming.v1.IFetchDeploymentStateResponse, + protos.google.cloud.gaming.v1.IFetchDeploymentStateRequest | 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.fetchDeploymentState(request, options, callback); + } + + /** + * Creates a new game server deployment in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, in the following form: + * `projects/{project}/locations/{location}`. + * @param {string} request.deploymentId + * Required. The ID of the game server delpoyment resource to be created. + * @param {google.cloud.gaming.v1.GameServerDeployment} request.gameServerDeployment + * Required. The game server delpoyment resource to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/game_server_deployments_service.create_game_server_deployment.js + * region_tag:gameservices_v1_generated_GameServerDeploymentsService_CreateGameServerDeployment_async + */ + createGameServerDeployment( + request?: protos.google.cloud.gaming.v1.ICreateGameServerDeploymentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createGameServerDeployment( + request: protos.google.cloud.gaming.v1.ICreateGameServerDeploymentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createGameServerDeployment( + request: protos.google.cloud.gaming.v1.ICreateGameServerDeploymentRequest, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createGameServerDeployment( + request?: protos.google.cloud.gaming.v1.ICreateGameServerDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createGameServerDeployment( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createGameServerDeployment()`. + * @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/game_server_deployments_service.create_game_server_deployment.js + * region_tag:gameservices_v1_generated_GameServerDeploymentsService_CreateGameServerDeployment_async + */ + async checkCreateGameServerDeploymentProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1.GameServerDeployment, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createGameServerDeployment, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1.GameServerDeployment, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + /** + * Deletes a single game server deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the game server delpoyment to delete, in the following form: + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/game_server_deployments_service.delete_game_server_deployment.js + * region_tag:gameservices_v1_generated_GameServerDeploymentsService_DeleteGameServerDeployment_async + */ + deleteGameServerDeployment( + request?: protos.google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteGameServerDeployment( + request: protos.google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGameServerDeployment( + request: protos.google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGameServerDeployment( + request?: protos.google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteGameServerDeployment( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteGameServerDeployment()`. + * @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/game_server_deployments_service.delete_game_server_deployment.js + * region_tag:gameservices_v1_generated_GameServerDeploymentsService_DeleteGameServerDeployment_async + */ + async checkDeleteGameServerDeploymentProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteGameServerDeployment, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + /** + * Patches a game server deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.gaming.v1.GameServerDeployment} request.gameServerDeployment + * Required. The game server delpoyment to be updated. + * Only fields specified in update_mask are updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/game_server_deployments_service.update_game_server_deployment.js + * region_tag:gameservices_v1_generated_GameServerDeploymentsService_UpdateGameServerDeployment_async + */ + updateGameServerDeployment( + request?: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateGameServerDeployment( + request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateGameServerDeployment( + request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateGameServerDeployment( + request?: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'game_server_deployment.name': request.gameServerDeployment!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateGameServerDeployment( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updateGameServerDeployment()`. + * @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/game_server_deployments_service.update_game_server_deployment.js + * region_tag:gameservices_v1_generated_GameServerDeploymentsService_UpdateGameServerDeployment_async + */ + async checkUpdateGameServerDeploymentProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1.GameServerDeployment, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateGameServerDeployment, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1.GameServerDeployment, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + /** + * Patches a single game server deployment rollout. + * The method will not return an error if the update does not affect any + * existing realms. For example - if the default_game_server_config is changed + * but all existing realms use the override, that is valid. Similarly, if a + * non existing realm is explicitly called out in game_server_config_overrides + * field, that will also not result in an error. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.gaming.v1.GameServerDeploymentRollout} request.rollout + * Required. The game server delpoyment rollout to be updated. + * Only fields specified in update_mask are updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/game_server_deployments_service.update_game_server_deployment_rollout.js + * region_tag:gameservices_v1_generated_GameServerDeploymentsService_UpdateGameServerDeploymentRollout_async + */ + updateGameServerDeploymentRollout( + request?: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateGameServerDeploymentRollout( + request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateGameServerDeploymentRollout( + request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateGameServerDeploymentRollout( + request?: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'rollout.name': request.rollout!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateGameServerDeploymentRollout( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updateGameServerDeploymentRollout()`. + * @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/game_server_deployments_service.update_game_server_deployment_rollout.js + * region_tag:gameservices_v1_generated_GameServerDeploymentsService_UpdateGameServerDeploymentRollout_async + */ + async checkUpdateGameServerDeploymentRolloutProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1.GameServerDeployment, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateGameServerDeploymentRollout, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1.GameServerDeployment, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + /** + * Lists game server deployments in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, in the following form: + * `projects/{project}/locations/{location}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, the server + * will pick an appropriate default. The server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1.ListGameServerDeploymentsResponse.next_page_token|next_page_token} to + * determine if there are more GameServerDeployments left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous List request, + * if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [GameServerDeployment]{@link google.cloud.gaming.v1.GameServerDeployment}. + * 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 `listGameServerDeploymentsAsync()` + * 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. + */ + listGameServerDeployments( + request?: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1.IGameServerDeployment[], + protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest | null, + protos.google.cloud.gaming.v1.IListGameServerDeploymentsResponse + ] + >; + listGameServerDeployments( + request: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, + | protos.google.cloud.gaming.v1.IListGameServerDeploymentsResponse + | null + | undefined, + protos.google.cloud.gaming.v1.IGameServerDeployment + > + ): void; + listGameServerDeployments( + request: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, + callback: PaginationCallback< + protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, + | protos.google.cloud.gaming.v1.IListGameServerDeploymentsResponse + | null + | undefined, + protos.google.cloud.gaming.v1.IGameServerDeployment + > + ): void; + listGameServerDeployments( + request?: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, + | protos.google.cloud.gaming.v1.IListGameServerDeploymentsResponse + | null + | undefined, + protos.google.cloud.gaming.v1.IGameServerDeployment + >, + callback?: PaginationCallback< + protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, + | protos.google.cloud.gaming.v1.IListGameServerDeploymentsResponse + | null + | undefined, + protos.google.cloud.gaming.v1.IGameServerDeployment + > + ): Promise< + [ + protos.google.cloud.gaming.v1.IGameServerDeployment[], + protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest | null, + protos.google.cloud.gaming.v1.IListGameServerDeploymentsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listGameServerDeployments( + 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, in the following form: + * `projects/{project}/locations/{location}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, the server + * will pick an appropriate default. The server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1.ListGameServerDeploymentsResponse.next_page_token|next_page_token} to + * determine if there are more GameServerDeployments left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous List request, + * if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @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 [GameServerDeployment]{@link google.cloud.gaming.v1.GameServerDeployment} 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 `listGameServerDeploymentsAsync()` + * 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. + */ + listGameServerDeploymentsStream( + request?: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, + 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['listGameServerDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listGameServerDeployments.createStream( + this.innerApiCalls.listGameServerDeployments as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listGameServerDeployments`, 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, in the following form: + * `projects/{project}/locations/{location}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, the server + * will pick an appropriate default. The server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1.ListGameServerDeploymentsResponse.next_page_token|next_page_token} to + * determine if there are more GameServerDeployments left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous List request, + * if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @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 + * [GameServerDeployment]{@link google.cloud.gaming.v1.GameServerDeployment}. 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/game_server_deployments_service.list_game_server_deployments.js + * region_tag:gameservices_v1_generated_GameServerDeploymentsService_ListGameServerDeployments_async + */ + listGameServerDeploymentsAsync( + request?: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, + 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['listGameServerDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listGameServerDeployments.asyncIterate( + this.innerApiCalls['listGameServerDeployments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified gameServerCluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} realm + * @param {string} cluster + * @returns {string} Resource name string. + */ + gameServerClusterPath( + project: string, + location: string, + realm: string, + cluster: string + ) { + return this.pathTemplates.gameServerClusterPathTemplate.render({ + project: project, + location: location, + realm: realm, + cluster: cluster, + }); + } + + /** + * Parse the project from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).project; + } + + /** + * Parse the location from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).location; + } + + /** + * Parse the realm from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the realm. + */ + matchRealmFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).realm; + } + + /** + * Parse the cluster from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).cluster; + } + + /** + * Return a fully-qualified gameServerConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @param {string} config + * @returns {string} Resource name string. + */ + gameServerConfigPath( + project: string, + location: string, + deployment: string, + config: string + ) { + return this.pathTemplates.gameServerConfigPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + config: config, + }); + } + + /** + * Parse the project from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).project; + } + + /** + * Parse the location from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).location; + } + + /** + * Parse the deployment from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).deployment; + } + + /** + * Parse the config from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the config. + */ + matchConfigFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).config; + } + + /** + * Return a fully-qualified gameServerDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + gameServerDeploymentPath( + project: string, + location: string, + deployment: string + ) { + return this.pathTemplates.gameServerDeploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerDeploymentName(gameServerDeploymentName: string) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).project; + } + + /** + * Parse the location from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerDeploymentName(gameServerDeploymentName: string) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).location; + } + + /** + * Parse the deployment from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerDeploymentName( + gameServerDeploymentName: string + ) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).deployment; + } + + /** + * Return a fully-qualified gameServerDeploymentRollout resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + gameServerDeploymentRolloutPath( + project: string, + location: string, + deployment: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).project; + } + + /** + * Parse the location from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).location; + } + + /** + * Parse the deployment from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).deployment; + } + + /** + * Return a fully-qualified realm resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} realm + * @returns {string} Resource name string. + */ + realmPath(project: string, location: string, realm: string) { + return this.pathTemplates.realmPathTemplate.render({ + project: project, + location: location, + realm: realm, + }); + } + + /** + * Parse the project from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).project; + } + + /** + * Parse the location from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).location; + } + + /** + * Parse the realm from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the realm. + */ + matchRealmFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).realm; + } + + /** + * 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.gameServerDeploymentsServiceStub && !this._terminated) { + return this.gameServerDeploymentsServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-gaming/src/v1/game_server_deployments_service_client_config.json b/packages/google-cloud-gaming/src/v1/game_server_deployments_service_client_config.json new file mode 100644 index 00000000000..b675806d575 --- /dev/null +++ b/packages/google-cloud-gaming/src/v1/game_server_deployments_service_client_config.json @@ -0,0 +1,83 @@ +{ + "interfaces": { + "google.cloud.gaming.v1.GameServerDeploymentsService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListGameServerDeployments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetGameServerDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateGameServerDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteGameServerDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateGameServerDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetGameServerDeploymentRollout": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateGameServerDeploymentRollout": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PreviewGameServerDeploymentRollout": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "FetchDeploymentState": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-cloud-gaming/src/v1/game_server_deployments_service_proto_list.json b/packages/google-cloud-gaming/src/v1/game_server_deployments_service_proto_list.json new file mode 100644 index 00000000000..3fc5cf10aeb --- /dev/null +++ b/packages/google-cloud-gaming/src/v1/game_server_deployments_service_proto_list.json @@ -0,0 +1,11 @@ +[ + "../../protos/google/cloud/gaming/v1/common.proto", + "../../protos/google/cloud/gaming/v1/game_server_clusters.proto", + "../../protos/google/cloud/gaming/v1/game_server_clusters_service.proto", + "../../protos/google/cloud/gaming/v1/game_server_configs.proto", + "../../protos/google/cloud/gaming/v1/game_server_configs_service.proto", + "../../protos/google/cloud/gaming/v1/game_server_deployments.proto", + "../../protos/google/cloud/gaming/v1/game_server_deployments_service.proto", + "../../protos/google/cloud/gaming/v1/realms.proto", + "../../protos/google/cloud/gaming/v1/realms_service.proto" +] diff --git a/packages/google-cloud-gaming/src/v1/gapic_metadata.json b/packages/google-cloud-gaming/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..8b66a5bfe79 --- /dev/null +++ b/packages/google-cloud-gaming/src/v1/gapic_metadata.json @@ -0,0 +1,351 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.gaming.v1", + "libraryPackage": "@google-cloud/game-servers", + "services": { + "GameServerClustersService": { + "clients": { + "grpc": { + "libraryClient": "GameServerClustersServiceClient", + "rpcs": { + "GetGameServerCluster": { + "methods": [ + "getGameServerCluster" + ] + }, + "PreviewCreateGameServerCluster": { + "methods": [ + "previewCreateGameServerCluster" + ] + }, + "PreviewDeleteGameServerCluster": { + "methods": [ + "previewDeleteGameServerCluster" + ] + }, + "PreviewUpdateGameServerCluster": { + "methods": [ + "previewUpdateGameServerCluster" + ] + }, + "CreateGameServerCluster": { + "methods": [ + "createGameServerCluster" + ] + }, + "DeleteGameServerCluster": { + "methods": [ + "deleteGameServerCluster" + ] + }, + "UpdateGameServerCluster": { + "methods": [ + "updateGameServerCluster" + ] + }, + "ListGameServerClusters": { + "methods": [ + "listGameServerClusters", + "listGameServerClustersStream", + "listGameServerClustersAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "GameServerClustersServiceClient", + "rpcs": { + "GetGameServerCluster": { + "methods": [ + "getGameServerCluster" + ] + }, + "PreviewCreateGameServerCluster": { + "methods": [ + "previewCreateGameServerCluster" + ] + }, + "PreviewDeleteGameServerCluster": { + "methods": [ + "previewDeleteGameServerCluster" + ] + }, + "PreviewUpdateGameServerCluster": { + "methods": [ + "previewUpdateGameServerCluster" + ] + }, + "CreateGameServerCluster": { + "methods": [ + "createGameServerCluster" + ] + }, + "DeleteGameServerCluster": { + "methods": [ + "deleteGameServerCluster" + ] + }, + "UpdateGameServerCluster": { + "methods": [ + "updateGameServerCluster" + ] + }, + "ListGameServerClusters": { + "methods": [ + "listGameServerClusters", + "listGameServerClustersStream", + "listGameServerClustersAsync" + ] + } + } + } + } + }, + "GameServerConfigsService": { + "clients": { + "grpc": { + "libraryClient": "GameServerConfigsServiceClient", + "rpcs": { + "GetGameServerConfig": { + "methods": [ + "getGameServerConfig" + ] + }, + "CreateGameServerConfig": { + "methods": [ + "createGameServerConfig" + ] + }, + "DeleteGameServerConfig": { + "methods": [ + "deleteGameServerConfig" + ] + }, + "ListGameServerConfigs": { + "methods": [ + "listGameServerConfigs", + "listGameServerConfigsStream", + "listGameServerConfigsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "GameServerConfigsServiceClient", + "rpcs": { + "GetGameServerConfig": { + "methods": [ + "getGameServerConfig" + ] + }, + "CreateGameServerConfig": { + "methods": [ + "createGameServerConfig" + ] + }, + "DeleteGameServerConfig": { + "methods": [ + "deleteGameServerConfig" + ] + }, + "ListGameServerConfigs": { + "methods": [ + "listGameServerConfigs", + "listGameServerConfigsStream", + "listGameServerConfigsAsync" + ] + } + } + } + } + }, + "GameServerDeploymentsService": { + "clients": { + "grpc": { + "libraryClient": "GameServerDeploymentsServiceClient", + "rpcs": { + "GetGameServerDeployment": { + "methods": [ + "getGameServerDeployment" + ] + }, + "GetGameServerDeploymentRollout": { + "methods": [ + "getGameServerDeploymentRollout" + ] + }, + "PreviewGameServerDeploymentRollout": { + "methods": [ + "previewGameServerDeploymentRollout" + ] + }, + "FetchDeploymentState": { + "methods": [ + "fetchDeploymentState" + ] + }, + "CreateGameServerDeployment": { + "methods": [ + "createGameServerDeployment" + ] + }, + "DeleteGameServerDeployment": { + "methods": [ + "deleteGameServerDeployment" + ] + }, + "UpdateGameServerDeployment": { + "methods": [ + "updateGameServerDeployment" + ] + }, + "UpdateGameServerDeploymentRollout": { + "methods": [ + "updateGameServerDeploymentRollout" + ] + }, + "ListGameServerDeployments": { + "methods": [ + "listGameServerDeployments", + "listGameServerDeploymentsStream", + "listGameServerDeploymentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "GameServerDeploymentsServiceClient", + "rpcs": { + "GetGameServerDeployment": { + "methods": [ + "getGameServerDeployment" + ] + }, + "GetGameServerDeploymentRollout": { + "methods": [ + "getGameServerDeploymentRollout" + ] + }, + "PreviewGameServerDeploymentRollout": { + "methods": [ + "previewGameServerDeploymentRollout" + ] + }, + "FetchDeploymentState": { + "methods": [ + "fetchDeploymentState" + ] + }, + "CreateGameServerDeployment": { + "methods": [ + "createGameServerDeployment" + ] + }, + "DeleteGameServerDeployment": { + "methods": [ + "deleteGameServerDeployment" + ] + }, + "UpdateGameServerDeployment": { + "methods": [ + "updateGameServerDeployment" + ] + }, + "UpdateGameServerDeploymentRollout": { + "methods": [ + "updateGameServerDeploymentRollout" + ] + }, + "ListGameServerDeployments": { + "methods": [ + "listGameServerDeployments", + "listGameServerDeploymentsStream", + "listGameServerDeploymentsAsync" + ] + } + } + } + } + }, + "RealmsService": { + "clients": { + "grpc": { + "libraryClient": "RealmsServiceClient", + "rpcs": { + "GetRealm": { + "methods": [ + "getRealm" + ] + }, + "PreviewRealmUpdate": { + "methods": [ + "previewRealmUpdate" + ] + }, + "CreateRealm": { + "methods": [ + "createRealm" + ] + }, + "DeleteRealm": { + "methods": [ + "deleteRealm" + ] + }, + "UpdateRealm": { + "methods": [ + "updateRealm" + ] + }, + "ListRealms": { + "methods": [ + "listRealms", + "listRealmsStream", + "listRealmsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RealmsServiceClient", + "rpcs": { + "GetRealm": { + "methods": [ + "getRealm" + ] + }, + "PreviewRealmUpdate": { + "methods": [ + "previewRealmUpdate" + ] + }, + "CreateRealm": { + "methods": [ + "createRealm" + ] + }, + "DeleteRealm": { + "methods": [ + "deleteRealm" + ] + }, + "UpdateRealm": { + "methods": [ + "updateRealm" + ] + }, + "ListRealms": { + "methods": [ + "listRealms", + "listRealmsStream", + "listRealmsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-gaming/src/v1/index.ts b/packages/google-cloud-gaming/src/v1/index.ts new file mode 100644 index 00000000000..86b711bd392 --- /dev/null +++ b/packages/google-cloud-gaming/src/v1/index.ts @@ -0,0 +1,22 @@ +// 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 {GameServerClustersServiceClient} from './game_server_clusters_service_client'; +export {GameServerConfigsServiceClient} from './game_server_configs_service_client'; +export {GameServerDeploymentsServiceClient} from './game_server_deployments_service_client'; +export {RealmsServiceClient} from './realms_service_client'; diff --git a/packages/google-cloud-gaming/src/v1/realms_service_client.ts b/packages/google-cloud-gaming/src/v1/realms_service_client.ts new file mode 100644 index 00000000000..7919c982d81 --- /dev/null +++ b/packages/google-cloud-gaming/src/v1/realms_service_client.ts @@ -0,0 +1,1611 @@ +// 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/realms_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './realms_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A realm is a grouping of game server clusters that are considered + * interchangeable. + * @class + * @memberof v1 + */ +export class RealmsServiceClient { + 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; + realmsServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RealmsServiceClient. + * + * @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 RealmsServiceClient({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 RealmsServiceClient; + 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 = { + gameServerClusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}' + ), + gameServerConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}' + ), + gameServerDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}' + ), + gameServerDeploymentRolloutPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout' + ), + realmPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}' + ), + }; + + // 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 = { + listRealms: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'realms' + ), + }; + + 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.cloud.location.Locations.GetLocation', + get: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1/{resource=projects/*/locations/*/gameServerDeployments/*}:getIamPolicy', + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/gameServerDeployments/*}:setIamPolicy', + body: '*', + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/gameServerDeployments/*}:testIamPermissions', + body: '*', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createRealmResponse = protoFilesRoot.lookup( + '.google.cloud.gaming.v1.Realm' + ) as gax.protobuf.Type; + const createRealmMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteRealmResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteRealmMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateRealmResponse = protoFilesRoot.lookup( + '.google.cloud.gaming.v1.Realm' + ) as gax.protobuf.Type; + const updateRealmMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createRealm: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createRealmResponse.decode.bind(createRealmResponse), + createRealmMetadata.decode.bind(createRealmMetadata) + ), + deleteRealm: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteRealmResponse.decode.bind(deleteRealmResponse), + deleteRealmMetadata.decode.bind(deleteRealmMetadata) + ), + updateRealm: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateRealmResponse.decode.bind(updateRealmResponse), + updateRealmMetadata.decode.bind(updateRealmMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.gaming.v1.RealmsService', + 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.realmsServiceStub) { + return this.realmsServiceStub; + } + + // Put together the "service stub" for + // google.cloud.gaming.v1.RealmsService. + this.realmsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.gaming.v1.RealmsService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.gaming.v1.RealmsService, + 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 realmsServiceStubMethods = [ + 'listRealms', + 'getRealm', + 'createRealm', + 'deleteRealm', + 'updateRealm', + 'previewRealmUpdate', + ]; + for (const methodName of realmsServiceStubMethods) { + const callPromise = this.realmsServiceStub.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.realmsServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'gameservices.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 'gameservices.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 -- + // ------------------- + /** + * Gets details of a single realm. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the realm to retrieve, in the following form: + * `projects/{project}/locations/{location}/realms/{realm}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Realm]{@link google.cloud.gaming.v1.Realm}. + * 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/realms_service.get_realm.js + * region_tag:gameservices_v1_generated_RealmsService_GetRealm_async + */ + getRealm( + request?: protos.google.cloud.gaming.v1.IGetRealmRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1.IRealm, + protos.google.cloud.gaming.v1.IGetRealmRequest | undefined, + {} | undefined + ] + >; + getRealm( + request: protos.google.cloud.gaming.v1.IGetRealmRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gaming.v1.IRealm, + protos.google.cloud.gaming.v1.IGetRealmRequest | null | undefined, + {} | null | undefined + > + ): void; + getRealm( + request: protos.google.cloud.gaming.v1.IGetRealmRequest, + callback: Callback< + protos.google.cloud.gaming.v1.IRealm, + protos.google.cloud.gaming.v1.IGetRealmRequest | null | undefined, + {} | null | undefined + > + ): void; + getRealm( + request?: protos.google.cloud.gaming.v1.IGetRealmRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gaming.v1.IRealm, + protos.google.cloud.gaming.v1.IGetRealmRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gaming.v1.IRealm, + protos.google.cloud.gaming.v1.IGetRealmRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gaming.v1.IRealm, + protos.google.cloud.gaming.v1.IGetRealmRequest | 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.getRealm(request, options, callback); + } + /** + * Previews patches to a single realm. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.gaming.v1.Realm} request.realm + * Required. The realm to be updated. + * Only fields specified in update_mask are updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * @param {google.protobuf.Timestamp} [request.previewTime] + * Optional. The target timestamp to compute the preview. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [PreviewRealmUpdateResponse]{@link google.cloud.gaming.v1.PreviewRealmUpdateResponse}. + * 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/realms_service.preview_realm_update.js + * region_tag:gameservices_v1_generated_RealmsService_PreviewRealmUpdate_async + */ + previewRealmUpdate( + request?: protos.google.cloud.gaming.v1.IPreviewRealmUpdateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1.IPreviewRealmUpdateResponse, + protos.google.cloud.gaming.v1.IPreviewRealmUpdateRequest | undefined, + {} | undefined + ] + >; + previewRealmUpdate( + request: protos.google.cloud.gaming.v1.IPreviewRealmUpdateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gaming.v1.IPreviewRealmUpdateResponse, + | protos.google.cloud.gaming.v1.IPreviewRealmUpdateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + previewRealmUpdate( + request: protos.google.cloud.gaming.v1.IPreviewRealmUpdateRequest, + callback: Callback< + protos.google.cloud.gaming.v1.IPreviewRealmUpdateResponse, + | protos.google.cloud.gaming.v1.IPreviewRealmUpdateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + previewRealmUpdate( + request?: protos.google.cloud.gaming.v1.IPreviewRealmUpdateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gaming.v1.IPreviewRealmUpdateResponse, + | protos.google.cloud.gaming.v1.IPreviewRealmUpdateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gaming.v1.IPreviewRealmUpdateResponse, + | protos.google.cloud.gaming.v1.IPreviewRealmUpdateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gaming.v1.IPreviewRealmUpdateResponse, + protos.google.cloud.gaming.v1.IPreviewRealmUpdateRequest | 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({ + 'realm.name': request.realm!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.previewRealmUpdate(request, options, callback); + } + + /** + * Creates a new realm in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, in the following form: + * `projects/{project}/locations/{location}`. + * @param {string} request.realmId + * Required. The ID of the realm resource to be created. + * @param {google.cloud.gaming.v1.Realm} request.realm + * Required. The realm resource to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/realms_service.create_realm.js + * region_tag:gameservices_v1_generated_RealmsService_CreateRealm_async + */ + createRealm( + request?: protos.google.cloud.gaming.v1.ICreateRealmRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1.IRealm, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createRealm( + request: protos.google.cloud.gaming.v1.ICreateRealmRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1.IRealm, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createRealm( + request: protos.google.cloud.gaming.v1.ICreateRealmRequest, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1.IRealm, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createRealm( + request?: protos.google.cloud.gaming.v1.ICreateRealmRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gaming.v1.IRealm, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gaming.v1.IRealm, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1.IRealm, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createRealm(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createRealm()`. + * @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/realms_service.create_realm.js + * region_tag:gameservices_v1_generated_RealmsService_CreateRealm_async + */ + async checkCreateRealmProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1.Realm, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createRealm, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1.Realm, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + /** + * Deletes a single realm. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the realm to delete, in the following form: + * `projects/{project}/locations/{location}/realms/{realm}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/realms_service.delete_realm.js + * region_tag:gameservices_v1_generated_RealmsService_DeleteRealm_async + */ + deleteRealm( + request?: protos.google.cloud.gaming.v1.IDeleteRealmRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteRealm( + request: protos.google.cloud.gaming.v1.IDeleteRealmRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteRealm( + request: protos.google.cloud.gaming.v1.IDeleteRealmRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteRealm( + request?: protos.google.cloud.gaming.v1.IDeleteRealmRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteRealm(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteRealm()`. + * @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/realms_service.delete_realm.js + * region_tag:gameservices_v1_generated_RealmsService_DeleteRealm_async + */ + async checkDeleteRealmProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteRealm, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + /** + * Patches a single realm. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.gaming.v1.Realm} request.realm + * Required. The realm to be updated. + * Only fields specified in update_mask are updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/realms_service.update_realm.js + * region_tag:gameservices_v1_generated_RealmsService_UpdateRealm_async + */ + updateRealm( + request?: protos.google.cloud.gaming.v1.IUpdateRealmRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1.IRealm, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateRealm( + request: protos.google.cloud.gaming.v1.IUpdateRealmRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1.IRealm, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateRealm( + request: protos.google.cloud.gaming.v1.IUpdateRealmRequest, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1.IRealm, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateRealm( + request?: protos.google.cloud.gaming.v1.IUpdateRealmRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gaming.v1.IRealm, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gaming.v1.IRealm, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1.IRealm, + protos.google.cloud.gaming.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'realm.name': request.realm!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateRealm(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateRealm()`. + * @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/realms_service.update_realm.js + * region_tag:gameservices_v1_generated_RealmsService_UpdateRealm_async + */ + async checkUpdateRealmProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1.Realm, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateRealm, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1.Realm, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + /** + * Lists realms in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name, in the following form: + * `projects/{project}/locations/{location}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1.ListRealmsResponse.next_page_token|next_page_token} to + * determine if there are more realms left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous List request, + * if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Realm]{@link google.cloud.gaming.v1.Realm}. + * 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 `listRealmsAsync()` + * 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. + */ + listRealms( + request?: protos.google.cloud.gaming.v1.IListRealmsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1.IRealm[], + protos.google.cloud.gaming.v1.IListRealmsRequest | null, + protos.google.cloud.gaming.v1.IListRealmsResponse + ] + >; + listRealms( + request: protos.google.cloud.gaming.v1.IListRealmsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.gaming.v1.IListRealmsRequest, + protos.google.cloud.gaming.v1.IListRealmsResponse | null | undefined, + protos.google.cloud.gaming.v1.IRealm + > + ): void; + listRealms( + request: protos.google.cloud.gaming.v1.IListRealmsRequest, + callback: PaginationCallback< + protos.google.cloud.gaming.v1.IListRealmsRequest, + protos.google.cloud.gaming.v1.IListRealmsResponse | null | undefined, + protos.google.cloud.gaming.v1.IRealm + > + ): void; + listRealms( + request?: protos.google.cloud.gaming.v1.IListRealmsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.gaming.v1.IListRealmsRequest, + protos.google.cloud.gaming.v1.IListRealmsResponse | null | undefined, + protos.google.cloud.gaming.v1.IRealm + >, + callback?: PaginationCallback< + protos.google.cloud.gaming.v1.IListRealmsRequest, + protos.google.cloud.gaming.v1.IListRealmsResponse | null | undefined, + protos.google.cloud.gaming.v1.IRealm + > + ): Promise< + [ + protos.google.cloud.gaming.v1.IRealm[], + protos.google.cloud.gaming.v1.IListRealmsRequest | null, + protos.google.cloud.gaming.v1.IListRealmsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listRealms(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, in the following form: + * `projects/{project}/locations/{location}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1.ListRealmsResponse.next_page_token|next_page_token} to + * determine if there are more realms left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous List request, + * if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @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 [Realm]{@link google.cloud.gaming.v1.Realm} 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 `listRealmsAsync()` + * 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. + */ + listRealmsStream( + request?: protos.google.cloud.gaming.v1.IListRealmsRequest, + 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['listRealms']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRealms.createStream( + this.innerApiCalls.listRealms as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listRealms`, 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, in the following form: + * `projects/{project}/locations/{location}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1.ListRealmsResponse.next_page_token|next_page_token} to + * determine if there are more realms left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous List request, + * if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @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 + * [Realm]{@link google.cloud.gaming.v1.Realm}. 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/realms_service.list_realms.js + * region_tag:gameservices_v1_generated_RealmsService_ListRealms_async + */ + listRealmsAsync( + request?: protos.google.cloud.gaming.v1.IListRealmsRequest, + 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['listRealms']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRealms.asyncIterate( + this.innerApiCalls['listRealms'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified gameServerCluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} realm + * @param {string} cluster + * @returns {string} Resource name string. + */ + gameServerClusterPath( + project: string, + location: string, + realm: string, + cluster: string + ) { + return this.pathTemplates.gameServerClusterPathTemplate.render({ + project: project, + location: location, + realm: realm, + cluster: cluster, + }); + } + + /** + * Parse the project from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).project; + } + + /** + * Parse the location from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).location; + } + + /** + * Parse the realm from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the realm. + */ + matchRealmFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).realm; + } + + /** + * Parse the cluster from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).cluster; + } + + /** + * Return a fully-qualified gameServerConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @param {string} config + * @returns {string} Resource name string. + */ + gameServerConfigPath( + project: string, + location: string, + deployment: string, + config: string + ) { + return this.pathTemplates.gameServerConfigPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + config: config, + }); + } + + /** + * Parse the project from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).project; + } + + /** + * Parse the location from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).location; + } + + /** + * Parse the deployment from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).deployment; + } + + /** + * Parse the config from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the config. + */ + matchConfigFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).config; + } + + /** + * Return a fully-qualified gameServerDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + gameServerDeploymentPath( + project: string, + location: string, + deployment: string + ) { + return this.pathTemplates.gameServerDeploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerDeploymentName(gameServerDeploymentName: string) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).project; + } + + /** + * Parse the location from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerDeploymentName(gameServerDeploymentName: string) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).location; + } + + /** + * Parse the deployment from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerDeploymentName( + gameServerDeploymentName: string + ) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).deployment; + } + + /** + * Return a fully-qualified gameServerDeploymentRollout resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + gameServerDeploymentRolloutPath( + project: string, + location: string, + deployment: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).project; + } + + /** + * Parse the location from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).location; + } + + /** + * Parse the deployment from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).deployment; + } + + /** + * Return a fully-qualified realm resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} realm + * @returns {string} Resource name string. + */ + realmPath(project: string, location: string, realm: string) { + return this.pathTemplates.realmPathTemplate.render({ + project: project, + location: location, + realm: realm, + }); + } + + /** + * Parse the project from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).project; + } + + /** + * Parse the location from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).location; + } + + /** + * Parse the realm from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the realm. + */ + matchRealmFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).realm; + } + + /** + * 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.realmsServiceStub && !this._terminated) { + return this.realmsServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-gaming/src/v1/realms_service_client_config.json b/packages/google-cloud-gaming/src/v1/realms_service_client_config.json new file mode 100644 index 00000000000..73dbb3c11d1 --- /dev/null +++ b/packages/google-cloud-gaming/src/v1/realms_service_client_config.json @@ -0,0 +1,68 @@ +{ + "interfaces": { + "google.cloud.gaming.v1.RealmsService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListRealms": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetRealm": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateRealm": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteRealm": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateRealm": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PreviewRealmUpdate": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-cloud-gaming/src/v1/realms_service_proto_list.json b/packages/google-cloud-gaming/src/v1/realms_service_proto_list.json new file mode 100644 index 00000000000..3fc5cf10aeb --- /dev/null +++ b/packages/google-cloud-gaming/src/v1/realms_service_proto_list.json @@ -0,0 +1,11 @@ +[ + "../../protos/google/cloud/gaming/v1/common.proto", + "../../protos/google/cloud/gaming/v1/game_server_clusters.proto", + "../../protos/google/cloud/gaming/v1/game_server_clusters_service.proto", + "../../protos/google/cloud/gaming/v1/game_server_configs.proto", + "../../protos/google/cloud/gaming/v1/game_server_configs_service.proto", + "../../protos/google/cloud/gaming/v1/game_server_deployments.proto", + "../../protos/google/cloud/gaming/v1/game_server_deployments_service.proto", + "../../protos/google/cloud/gaming/v1/realms.proto", + "../../protos/google/cloud/gaming/v1/realms_service.proto" +] diff --git a/packages/google-cloud-gaming/src/v1beta/game_server_clusters_service_client.ts b/packages/google-cloud-gaming/src/v1beta/game_server_clusters_service_client.ts new file mode 100644 index 00000000000..c34886ce6bf --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/game_server_clusters_service_client.ts @@ -0,0 +1,1873 @@ +// 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/v1beta/game_server_clusters_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './game_server_clusters_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The game server cluster maps to Kubernetes clusters running Agones and is + * used to manage fleets within clusters. + * @class + * @memberof v1beta + */ +export class GameServerClustersServiceClient { + 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; + gameServerClustersServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of GameServerClustersServiceClient. + * + * @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 GameServerClustersServiceClient({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 GameServerClustersServiceClient; + 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 = { + gameServerClusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}' + ), + gameServerConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}' + ), + gameServerDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}' + ), + gameServerDeploymentRolloutPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout' + ), + realmPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}' + ), + }; + + // 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 = { + listGameServerClusters: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'gameServerClusters' + ), + }; + + 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: '/v1beta/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1beta/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1beta/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1beta/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createGameServerClusterResponse = protoFilesRoot.lookup( + '.google.cloud.gaming.v1beta.GameServerCluster' + ) as gax.protobuf.Type; + const createGameServerClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1beta.OperationMetadata' + ) as gax.protobuf.Type; + const deleteGameServerClusterResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteGameServerClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1beta.OperationMetadata' + ) as gax.protobuf.Type; + const updateGameServerClusterResponse = protoFilesRoot.lookup( + '.google.cloud.gaming.v1beta.GameServerCluster' + ) as gax.protobuf.Type; + const updateGameServerClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1beta.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createGameServerCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createGameServerClusterResponse.decode.bind( + createGameServerClusterResponse + ), + createGameServerClusterMetadata.decode.bind( + createGameServerClusterMetadata + ) + ), + deleteGameServerCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteGameServerClusterResponse.decode.bind( + deleteGameServerClusterResponse + ), + deleteGameServerClusterMetadata.decode.bind( + deleteGameServerClusterMetadata + ) + ), + updateGameServerCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateGameServerClusterResponse.decode.bind( + updateGameServerClusterResponse + ), + updateGameServerClusterMetadata.decode.bind( + updateGameServerClusterMetadata + ) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.gaming.v1beta.GameServerClustersService', + 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.gameServerClustersServiceStub) { + return this.gameServerClustersServiceStub; + } + + // Put together the "service stub" for + // google.cloud.gaming.v1beta.GameServerClustersService. + this.gameServerClustersServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.gaming.v1beta.GameServerClustersService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.gaming.v1beta + .GameServerClustersService, + 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 gameServerClustersServiceStubMethods = [ + 'listGameServerClusters', + 'getGameServerCluster', + 'createGameServerCluster', + 'previewCreateGameServerCluster', + 'deleteGameServerCluster', + 'previewDeleteGameServerCluster', + 'updateGameServerCluster', + 'previewUpdateGameServerCluster', + ]; + for (const methodName of gameServerClustersServiceStubMethods) { + const callPromise = this.gameServerClustersServiceStub.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.gameServerClustersServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'gameservices.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 'gameservices.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 -- + // ------------------- + /** + * Gets details of a single game server cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the game server cluster to retrieve. Uses the form: + * + * `projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [GameServerCluster]{@link google.cloud.gaming.v1beta.GameServerCluster}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/game_server_clusters_service.get_game_server_cluster.js + * region_tag:gameservices_v1beta_generated_GameServerClustersService_GetGameServerCluster_async + */ + getGameServerCluster( + request?: protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IGameServerCluster, + ( + | protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest + | undefined + ), + {} | undefined + ] + >; + getGameServerCluster( + request: protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gaming.v1beta.IGameServerCluster, + | protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGameServerCluster( + request: protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, + callback: Callback< + protos.google.cloud.gaming.v1beta.IGameServerCluster, + | protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGameServerCluster( + request?: protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gaming.v1beta.IGameServerCluster, + | protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gaming.v1beta.IGameServerCluster, + | protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IGameServerCluster, + ( + | protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest + | 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.getGameServerCluster(request, options, callback); + } + /** + * Previews creation of a new game server cluster in a given project and + * location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. Uses the form: + * `projects/{project}/locations/{location}/realms/{realm}`. + * @param {string} request.gameServerClusterId + * Required. The ID of the game server cluster resource to be created. + * @param {google.cloud.gaming.v1beta.GameServerCluster} request.gameServerCluster + * Required. The game server cluster resource to be created. + * @param {google.protobuf.Timestamp} [request.previewTime] + * Optional. The target timestamp to compute the preview. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [PreviewCreateGameServerClusterResponse]{@link google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/game_server_clusters_service.preview_create_game_server_cluster.js + * region_tag:gameservices_v1beta_generated_GameServerClustersService_PreviewCreateGameServerCluster_async + */ + previewCreateGameServerCluster( + request?: protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, + ( + | protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest + | undefined + ), + {} | undefined + ] + >; + previewCreateGameServerCluster( + request: protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, + | protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): void; + previewCreateGameServerCluster( + request: protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, + callback: Callback< + protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, + | protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): void; + previewCreateGameServerCluster( + request?: protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, + | protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, + | protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, + ( + | protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest + | 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.previewCreateGameServerCluster( + request, + options, + callback + ); + } + /** + * Previews deletion of a single game server cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the game server cluster to delete. Uses the form: + * `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. + * @param {google.protobuf.Timestamp} [request.previewTime] + * Optional. The target timestamp to compute the preview. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [PreviewDeleteGameServerClusterResponse]{@link google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/game_server_clusters_service.preview_delete_game_server_cluster.js + * region_tag:gameservices_v1beta_generated_GameServerClustersService_PreviewDeleteGameServerCluster_async + */ + previewDeleteGameServerCluster( + request?: protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, + ( + | protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest + | undefined + ), + {} | undefined + ] + >; + previewDeleteGameServerCluster( + request: protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, + | protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): void; + previewDeleteGameServerCluster( + request: protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, + callback: Callback< + protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, + | protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): void; + previewDeleteGameServerCluster( + request?: protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, + | protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, + | protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, + ( + | protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest + | 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.previewDeleteGameServerCluster( + request, + options, + callback + ); + } + /** + * Previews updating a GameServerCluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.gaming.v1beta.GameServerCluster} request.gameServerCluster + * Required. The game server cluster to be updated. + * Only fields specified in update_mask are updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * + * https: + * //developers.google.com/protocol-buffers + * // /docs/reference/google.protobuf#fieldmask + * @param {google.protobuf.Timestamp} [request.previewTime] + * Optional. The target timestamp to compute the preview. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [PreviewUpdateGameServerClusterResponse]{@link google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/game_server_clusters_service.preview_update_game_server_cluster.js + * region_tag:gameservices_v1beta_generated_GameServerClustersService_PreviewUpdateGameServerCluster_async + */ + previewUpdateGameServerCluster( + request?: protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, + ( + | protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest + | undefined + ), + {} | undefined + ] + >; + previewUpdateGameServerCluster( + request: protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, + | protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): void; + previewUpdateGameServerCluster( + request: protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, + callback: Callback< + protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, + | protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): void; + previewUpdateGameServerCluster( + request?: protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, + | protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, + | protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, + ( + | protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest + | 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({ + 'game_server_cluster.name': request.gameServerCluster!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.previewUpdateGameServerCluster( + request, + options, + callback + ); + } + + /** + * Creates a new game server cluster in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. Uses the form: + * `projects/{project}/locations/{location}/realms/{realm-id}`. + * @param {string} request.gameServerClusterId + * Required. The ID of the game server cluster resource to be created. + * @param {google.cloud.gaming.v1beta.GameServerCluster} request.gameServerCluster + * Required. The game server cluster resource to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/v1beta/game_server_clusters_service.create_game_server_cluster.js + * region_tag:gameservices_v1beta_generated_GameServerClustersService_CreateGameServerCluster_async + */ + createGameServerCluster( + request?: protos.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createGameServerCluster( + request: protos.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createGameServerCluster( + request: protos.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createGameServerCluster( + request?: protos.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createGameServerCluster( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createGameServerCluster()`. + * @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/v1beta/game_server_clusters_service.create_game_server_cluster.js + * region_tag:gameservices_v1beta_generated_GameServerClustersService_CreateGameServerCluster_async + */ + async checkCreateGameServerClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1beta.GameServerCluster, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createGameServerCluster, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1beta.GameServerCluster, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } + /** + * Deletes a single game server cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the game server cluster to delete. Uses the form: + * `projects/{project}/locations/{location}/gameServerClusters/{cluster}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v1beta/game_server_clusters_service.delete_game_server_cluster.js + * region_tag:gameservices_v1beta_generated_GameServerClustersService_DeleteGameServerCluster_async + */ + deleteGameServerCluster( + request?: protos.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteGameServerCluster( + request: protos.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGameServerCluster( + request: protos.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGameServerCluster( + request?: protos.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteGameServerCluster( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteGameServerCluster()`. + * @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/v1beta/game_server_clusters_service.delete_game_server_cluster.js + * region_tag:gameservices_v1beta_generated_GameServerClustersService_DeleteGameServerCluster_async + */ + async checkDeleteGameServerClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteGameServerCluster, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } + /** + * Patches a single game server cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.gaming.v1beta.GameServerCluster} request.gameServerCluster + * Required. The game server cluster to be updated. + * Only fields specified in update_mask are updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * + * https: + * //developers.google.com/protocol-buffers + * // /docs/reference/google.protobuf#fieldmask + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/v1beta/game_server_clusters_service.update_game_server_cluster.js + * region_tag:gameservices_v1beta_generated_GameServerClustersService_UpdateGameServerCluster_async + */ + updateGameServerCluster( + request?: protos.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateGameServerCluster( + request: protos.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateGameServerCluster( + request: protos.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateGameServerCluster( + request?: protos.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'game_server_cluster.name': request.gameServerCluster!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateGameServerCluster( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updateGameServerCluster()`. + * @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/v1beta/game_server_clusters_service.update_game_server_cluster.js + * region_tag:gameservices_v1beta_generated_GameServerClustersService_UpdateGameServerCluster_async + */ + async checkUpdateGameServerClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1beta.GameServerCluster, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateGameServerCluster, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1beta.GameServerCluster, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } + /** + * Lists game server clusters in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. Uses the form: + * "projects/{project}/locations/{location}/realms/{realm}". + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, the + * server will pick an appropriate default. The server may return fewer items + * than requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1beta.ListGameServerClustersResponse.next_page_token|next_page_token} + * to determine if there are more GameServerClusters left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous List request, + * if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [GameServerCluster]{@link google.cloud.gaming.v1beta.GameServerCluster}. + * 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 `listGameServerClustersAsync()` + * 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. + */ + listGameServerClusters( + request?: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IGameServerCluster[], + protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest | null, + protos.google.cloud.gaming.v1beta.IListGameServerClustersResponse + ] + >; + listGameServerClusters( + request: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + | protos.google.cloud.gaming.v1beta.IListGameServerClustersResponse + | null + | undefined, + protos.google.cloud.gaming.v1beta.IGameServerCluster + > + ): void; + listGameServerClusters( + request: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + callback: PaginationCallback< + protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + | protos.google.cloud.gaming.v1beta.IListGameServerClustersResponse + | null + | undefined, + protos.google.cloud.gaming.v1beta.IGameServerCluster + > + ): void; + listGameServerClusters( + request?: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + | protos.google.cloud.gaming.v1beta.IListGameServerClustersResponse + | null + | undefined, + protos.google.cloud.gaming.v1beta.IGameServerCluster + >, + callback?: PaginationCallback< + protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + | protos.google.cloud.gaming.v1beta.IListGameServerClustersResponse + | null + | undefined, + protos.google.cloud.gaming.v1beta.IGameServerCluster + > + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IGameServerCluster[], + protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest | null, + protos.google.cloud.gaming.v1beta.IListGameServerClustersResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listGameServerClusters( + 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. Uses the form: + * "projects/{project}/locations/{location}/realms/{realm}". + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, the + * server will pick an appropriate default. The server may return fewer items + * than requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1beta.ListGameServerClustersResponse.next_page_token|next_page_token} + * to determine if there are more GameServerClusters left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous List request, + * if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @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 [GameServerCluster]{@link google.cloud.gaming.v1beta.GameServerCluster} 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 `listGameServerClustersAsync()` + * 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. + */ + listGameServerClustersStream( + request?: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + 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['listGameServerClusters']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listGameServerClusters.createStream( + this.innerApiCalls.listGameServerClusters as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listGameServerClusters`, 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. Uses the form: + * "projects/{project}/locations/{location}/realms/{realm}". + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, the + * server will pick an appropriate default. The server may return fewer items + * than requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1beta.ListGameServerClustersResponse.next_page_token|next_page_token} + * to determine if there are more GameServerClusters left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous List request, + * if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @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 + * [GameServerCluster]{@link google.cloud.gaming.v1beta.GameServerCluster}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta/game_server_clusters_service.list_game_server_clusters.js + * region_tag:gameservices_v1beta_generated_GameServerClustersService_ListGameServerClusters_async + */ + listGameServerClustersAsync( + request?: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + 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['listGameServerClusters']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listGameServerClusters.asyncIterate( + this.innerApiCalls['listGameServerClusters'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified gameServerCluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} realm + * @param {string} cluster + * @returns {string} Resource name string. + */ + gameServerClusterPath( + project: string, + location: string, + realm: string, + cluster: string + ) { + return this.pathTemplates.gameServerClusterPathTemplate.render({ + project: project, + location: location, + realm: realm, + cluster: cluster, + }); + } + + /** + * Parse the project from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).project; + } + + /** + * Parse the location from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).location; + } + + /** + * Parse the realm from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the realm. + */ + matchRealmFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).realm; + } + + /** + * Parse the cluster from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).cluster; + } + + /** + * Return a fully-qualified gameServerConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @param {string} config + * @returns {string} Resource name string. + */ + gameServerConfigPath( + project: string, + location: string, + deployment: string, + config: string + ) { + return this.pathTemplates.gameServerConfigPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + config: config, + }); + } + + /** + * Parse the project from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).project; + } + + /** + * Parse the location from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).location; + } + + /** + * Parse the deployment from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).deployment; + } + + /** + * Parse the config from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the config. + */ + matchConfigFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).config; + } + + /** + * Return a fully-qualified gameServerDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + gameServerDeploymentPath( + project: string, + location: string, + deployment: string + ) { + return this.pathTemplates.gameServerDeploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerDeploymentName(gameServerDeploymentName: string) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).project; + } + + /** + * Parse the location from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerDeploymentName(gameServerDeploymentName: string) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).location; + } + + /** + * Parse the deployment from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerDeploymentName( + gameServerDeploymentName: string + ) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).deployment; + } + + /** + * Return a fully-qualified gameServerDeploymentRollout resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + gameServerDeploymentRolloutPath( + project: string, + location: string, + deployment: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).project; + } + + /** + * Parse the location from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).location; + } + + /** + * Parse the deployment from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).deployment; + } + + /** + * Return a fully-qualified realm resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} realm + * @returns {string} Resource name string. + */ + realmPath(project: string, location: string, realm: string) { + return this.pathTemplates.realmPathTemplate.render({ + project: project, + location: location, + realm: realm, + }); + } + + /** + * Parse the project from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).project; + } + + /** + * Parse the location from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).location; + } + + /** + * Parse the realm from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the realm. + */ + matchRealmFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).realm; + } + + /** + * 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.gameServerClustersServiceStub && !this._terminated) { + return this.gameServerClustersServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-gaming/src/v1beta/game_server_clusters_service_client_config.json b/packages/google-cloud-gaming/src/v1beta/game_server_clusters_service_client_config.json new file mode 100644 index 00000000000..e5e66fdb13c --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/game_server_clusters_service_client_config.json @@ -0,0 +1,78 @@ +{ + "interfaces": { + "google.cloud.gaming.v1beta.GameServerClustersService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListGameServerClusters": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetGameServerCluster": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateGameServerCluster": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PreviewCreateGameServerCluster": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "DeleteGameServerCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PreviewDeleteGameServerCluster": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateGameServerCluster": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PreviewUpdateGameServerCluster": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-cloud-gaming/src/v1beta/game_server_clusters_service_proto_list.json b/packages/google-cloud-gaming/src/v1beta/game_server_clusters_service_proto_list.json new file mode 100644 index 00000000000..1a93d2cf41f --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/game_server_clusters_service_proto_list.json @@ -0,0 +1,11 @@ +[ + "../../protos/google/cloud/gaming/v1beta/common.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_clusters.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_clusters_service.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_configs.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_configs_service.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_deployments.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_deployments_service.proto", + "../../protos/google/cloud/gaming/v1beta/realms.proto", + "../../protos/google/cloud/gaming/v1beta/realms_service.proto" +] diff --git a/packages/google-cloud-gaming/src/v1beta/game_server_configs_service_client.ts b/packages/google-cloud-gaming/src/v1beta/game_server_configs_service_client.ts new file mode 100644 index 00000000000..9d732969c0f --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/game_server_configs_service_client.ts @@ -0,0 +1,1378 @@ +// 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/v1beta/game_server_configs_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './game_server_configs_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The game server config configures the game servers in an Agones fleet. + * @class + * @memberof v1beta + */ +export class GameServerConfigsServiceClient { + 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; + gameServerConfigsServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of GameServerConfigsServiceClient. + * + * @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 GameServerConfigsServiceClient({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 GameServerConfigsServiceClient; + 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 = { + gameServerClusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}' + ), + gameServerConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}' + ), + gameServerDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}' + ), + gameServerDeploymentRolloutPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout' + ), + realmPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}' + ), + }; + + // 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 = { + listGameServerConfigs: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'gameServerConfigs' + ), + }; + + 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: '/v1beta/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1beta/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1beta/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1beta/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createGameServerConfigResponse = protoFilesRoot.lookup( + '.google.cloud.gaming.v1beta.GameServerConfig' + ) as gax.protobuf.Type; + const createGameServerConfigMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1beta.OperationMetadata' + ) as gax.protobuf.Type; + const deleteGameServerConfigResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteGameServerConfigMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1beta.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createGameServerConfig: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createGameServerConfigResponse.decode.bind( + createGameServerConfigResponse + ), + createGameServerConfigMetadata.decode.bind( + createGameServerConfigMetadata + ) + ), + deleteGameServerConfig: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteGameServerConfigResponse.decode.bind( + deleteGameServerConfigResponse + ), + deleteGameServerConfigMetadata.decode.bind( + deleteGameServerConfigMetadata + ) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.gaming.v1beta.GameServerConfigsService', + 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.gameServerConfigsServiceStub) { + return this.gameServerConfigsServiceStub; + } + + // Put together the "service stub" for + // google.cloud.gaming.v1beta.GameServerConfigsService. + this.gameServerConfigsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.gaming.v1beta.GameServerConfigsService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.gaming.v1beta + .GameServerConfigsService, + 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 gameServerConfigsServiceStubMethods = [ + 'listGameServerConfigs', + 'getGameServerConfig', + 'createGameServerConfig', + 'deleteGameServerConfig', + ]; + for (const methodName of gameServerConfigsServiceStubMethods) { + const callPromise = this.gameServerConfigsServiceStub.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.gameServerConfigsServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'gameservices.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 'gameservices.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 -- + // ------------------- + /** + * Gets details of a single game server config. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the game server config to retrieve. Uses the form: + * + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [GameServerConfig]{@link google.cloud.gaming.v1beta.GameServerConfig}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/game_server_configs_service.get_game_server_config.js + * region_tag:gameservices_v1beta_generated_GameServerConfigsService_GetGameServerConfig_async + */ + getGameServerConfig( + request?: protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest | undefined, + {} | undefined + ] + >; + getGameServerConfig( + request: protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gaming.v1beta.IGameServerConfig, + | protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGameServerConfig( + request: protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, + callback: Callback< + protos.google.cloud.gaming.v1beta.IGameServerConfig, + | protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGameServerConfig( + request?: protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gaming.v1beta.IGameServerConfig, + | protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gaming.v1beta.IGameServerConfig, + | protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest | 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.getGameServerConfig(request, options, callback); + } + + /** + * Creates a new game server config in a given project, location, and game + * server deployment. Game server configs are immutable, and are not applied + * until referenced in the game server deployment rollout resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. Uses the form: + * + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/`. + * @param {string} request.configId + * Required. The ID of the game server config resource to be created. + * @param {google.cloud.gaming.v1beta.GameServerConfig} request.gameServerConfig + * Required. The game server config resource to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/v1beta/game_server_configs_service.create_game_server_config.js + * region_tag:gameservices_v1beta_generated_GameServerConfigsService_CreateGameServerConfig_async + */ + createGameServerConfig( + request?: protos.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createGameServerConfig( + request: protos.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createGameServerConfig( + request: protos.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createGameServerConfig( + request?: protos.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createGameServerConfig( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createGameServerConfig()`. + * @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/v1beta/game_server_configs_service.create_game_server_config.js + * region_tag:gameservices_v1beta_generated_GameServerConfigsService_CreateGameServerConfig_async + */ + async checkCreateGameServerConfigProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1beta.GameServerConfig, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createGameServerConfig, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1beta.GameServerConfig, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } + /** + * Deletes a single game server config. The deletion will fail if the game + * server config is referenced in a game server deployment rollout. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the game server config to delete. Uses the form: + * + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v1beta/game_server_configs_service.delete_game_server_config.js + * region_tag:gameservices_v1beta_generated_GameServerConfigsService_DeleteGameServerConfig_async + */ + deleteGameServerConfig( + request?: protos.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteGameServerConfig( + request: protos.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGameServerConfig( + request: protos.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGameServerConfig( + request?: protos.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteGameServerConfig( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteGameServerConfig()`. + * @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/v1beta/game_server_configs_service.delete_game_server_config.js + * region_tag:gameservices_v1beta_generated_GameServerConfigsService_DeleteGameServerConfig_async + */ + async checkDeleteGameServerConfigProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteGameServerConfig, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } + /** + * Lists game server configs in a given project, location, and game server + * deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. Uses the form: + * + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/*`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1beta.ListGameServerConfigsResponse.next_page_token|next_page_token} + * to determine if there are more GameServerConfigs left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request, + * if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [GameServerConfig]{@link google.cloud.gaming.v1beta.GameServerConfig}. + * 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 `listGameServerConfigsAsync()` + * 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. + */ + listGameServerConfigs( + request?: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IGameServerConfig[], + protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest | null, + protos.google.cloud.gaming.v1beta.IListGameServerConfigsResponse + ] + >; + listGameServerConfigs( + request: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + | protos.google.cloud.gaming.v1beta.IListGameServerConfigsResponse + | null + | undefined, + protos.google.cloud.gaming.v1beta.IGameServerConfig + > + ): void; + listGameServerConfigs( + request: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + | protos.google.cloud.gaming.v1beta.IListGameServerConfigsResponse + | null + | undefined, + protos.google.cloud.gaming.v1beta.IGameServerConfig + > + ): void; + listGameServerConfigs( + request?: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + | protos.google.cloud.gaming.v1beta.IListGameServerConfigsResponse + | null + | undefined, + protos.google.cloud.gaming.v1beta.IGameServerConfig + >, + callback?: PaginationCallback< + protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + | protos.google.cloud.gaming.v1beta.IListGameServerConfigsResponse + | null + | undefined, + protos.google.cloud.gaming.v1beta.IGameServerConfig + > + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IGameServerConfig[], + protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest | null, + protos.google.cloud.gaming.v1beta.IListGameServerConfigsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listGameServerConfigs(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. Uses the form: + * + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/*`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1beta.ListGameServerConfigsResponse.next_page_token|next_page_token} + * to determine if there are more GameServerConfigs left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request, + * if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @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 [GameServerConfig]{@link google.cloud.gaming.v1beta.GameServerConfig} 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 `listGameServerConfigsAsync()` + * 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. + */ + listGameServerConfigsStream( + request?: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + 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['listGameServerConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listGameServerConfigs.createStream( + this.innerApiCalls.listGameServerConfigs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listGameServerConfigs`, 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. Uses the form: + * + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/*`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1beta.ListGameServerConfigsResponse.next_page_token|next_page_token} + * to determine if there are more GameServerConfigs left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request, + * if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @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 + * [GameServerConfig]{@link google.cloud.gaming.v1beta.GameServerConfig}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta/game_server_configs_service.list_game_server_configs.js + * region_tag:gameservices_v1beta_generated_GameServerConfigsService_ListGameServerConfigs_async + */ + listGameServerConfigsAsync( + request?: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + 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['listGameServerConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listGameServerConfigs.asyncIterate( + this.innerApiCalls['listGameServerConfigs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified gameServerCluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} realm + * @param {string} cluster + * @returns {string} Resource name string. + */ + gameServerClusterPath( + project: string, + location: string, + realm: string, + cluster: string + ) { + return this.pathTemplates.gameServerClusterPathTemplate.render({ + project: project, + location: location, + realm: realm, + cluster: cluster, + }); + } + + /** + * Parse the project from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).project; + } + + /** + * Parse the location from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).location; + } + + /** + * Parse the realm from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the realm. + */ + matchRealmFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).realm; + } + + /** + * Parse the cluster from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).cluster; + } + + /** + * Return a fully-qualified gameServerConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @param {string} config + * @returns {string} Resource name string. + */ + gameServerConfigPath( + project: string, + location: string, + deployment: string, + config: string + ) { + return this.pathTemplates.gameServerConfigPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + config: config, + }); + } + + /** + * Parse the project from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).project; + } + + /** + * Parse the location from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).location; + } + + /** + * Parse the deployment from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).deployment; + } + + /** + * Parse the config from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the config. + */ + matchConfigFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).config; + } + + /** + * Return a fully-qualified gameServerDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + gameServerDeploymentPath( + project: string, + location: string, + deployment: string + ) { + return this.pathTemplates.gameServerDeploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerDeploymentName(gameServerDeploymentName: string) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).project; + } + + /** + * Parse the location from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerDeploymentName(gameServerDeploymentName: string) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).location; + } + + /** + * Parse the deployment from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerDeploymentName( + gameServerDeploymentName: string + ) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).deployment; + } + + /** + * Return a fully-qualified gameServerDeploymentRollout resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + gameServerDeploymentRolloutPath( + project: string, + location: string, + deployment: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).project; + } + + /** + * Parse the location from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).location; + } + + /** + * Parse the deployment from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).deployment; + } + + /** + * Return a fully-qualified realm resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} realm + * @returns {string} Resource name string. + */ + realmPath(project: string, location: string, realm: string) { + return this.pathTemplates.realmPathTemplate.render({ + project: project, + location: location, + realm: realm, + }); + } + + /** + * Parse the project from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).project; + } + + /** + * Parse the location from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).location; + } + + /** + * Parse the realm from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the realm. + */ + matchRealmFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).realm; + } + + /** + * 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.gameServerConfigsServiceStub && !this._terminated) { + return this.gameServerConfigsServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-gaming/src/v1beta/game_server_configs_service_client_config.json b/packages/google-cloud-gaming/src/v1beta/game_server_configs_service_client_config.json new file mode 100644 index 00000000000..0782290b888 --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/game_server_configs_service_client_config.json @@ -0,0 +1,58 @@ +{ + "interfaces": { + "google.cloud.gaming.v1beta.GameServerConfigsService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListGameServerConfigs": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetGameServerConfig": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateGameServerConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteGameServerConfig": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-gaming/src/v1beta/game_server_configs_service_proto_list.json b/packages/google-cloud-gaming/src/v1beta/game_server_configs_service_proto_list.json new file mode 100644 index 00000000000..1a93d2cf41f --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/game_server_configs_service_proto_list.json @@ -0,0 +1,11 @@ +[ + "../../protos/google/cloud/gaming/v1beta/common.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_clusters.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_clusters_service.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_configs.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_configs_service.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_deployments.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_deployments_service.proto", + "../../protos/google/cloud/gaming/v1beta/realms.proto", + "../../protos/google/cloud/gaming/v1beta/realms_service.proto" +] diff --git a/packages/google-cloud-gaming/src/v1beta/game_server_deployments_service_client.ts b/packages/google-cloud-gaming/src/v1beta/game_server_deployments_service_client.ts new file mode 100644 index 00000000000..522a0babf82 --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/game_server_deployments_service_client.ts @@ -0,0 +1,2045 @@ +// 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/v1beta/game_server_deployments_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './game_server_deployments_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The game server deployment is used to control the deployment of Agones + * fleets. + * @class + * @memberof v1beta + */ +export class GameServerDeploymentsServiceClient { + 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; + gameServerDeploymentsServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of GameServerDeploymentsServiceClient. + * + * @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 GameServerDeploymentsServiceClient({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 GameServerDeploymentsServiceClient; + 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 = { + gameServerClusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}' + ), + gameServerConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}' + ), + gameServerDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}' + ), + gameServerDeploymentRolloutPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout' + ), + realmPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}' + ), + }; + + // 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 = { + listGameServerDeployments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'gameServerDeployments' + ), + }; + + 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: '/v1beta/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1beta/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1beta/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1beta/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createGameServerDeploymentResponse = protoFilesRoot.lookup( + '.google.cloud.gaming.v1beta.GameServerDeployment' + ) as gax.protobuf.Type; + const createGameServerDeploymentMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1beta.OperationMetadata' + ) as gax.protobuf.Type; + const deleteGameServerDeploymentResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteGameServerDeploymentMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1beta.OperationMetadata' + ) as gax.protobuf.Type; + const updateGameServerDeploymentResponse = protoFilesRoot.lookup( + '.google.cloud.gaming.v1beta.GameServerDeployment' + ) as gax.protobuf.Type; + const updateGameServerDeploymentMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1beta.OperationMetadata' + ) as gax.protobuf.Type; + const updateGameServerDeploymentRolloutResponse = protoFilesRoot.lookup( + '.google.cloud.gaming.v1beta.GameServerDeployment' + ) as gax.protobuf.Type; + const updateGameServerDeploymentRolloutMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1beta.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createGameServerDeployment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createGameServerDeploymentResponse.decode.bind( + createGameServerDeploymentResponse + ), + createGameServerDeploymentMetadata.decode.bind( + createGameServerDeploymentMetadata + ) + ), + deleteGameServerDeployment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteGameServerDeploymentResponse.decode.bind( + deleteGameServerDeploymentResponse + ), + deleteGameServerDeploymentMetadata.decode.bind( + deleteGameServerDeploymentMetadata + ) + ), + updateGameServerDeployment: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateGameServerDeploymentResponse.decode.bind( + updateGameServerDeploymentResponse + ), + updateGameServerDeploymentMetadata.decode.bind( + updateGameServerDeploymentMetadata + ) + ), + updateGameServerDeploymentRollout: + new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateGameServerDeploymentRolloutResponse.decode.bind( + updateGameServerDeploymentRolloutResponse + ), + updateGameServerDeploymentRolloutMetadata.decode.bind( + updateGameServerDeploymentRolloutMetadata + ) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.gaming.v1beta.GameServerDeploymentsService', + 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.gameServerDeploymentsServiceStub) { + return this.gameServerDeploymentsServiceStub; + } + + // Put together the "service stub" for + // google.cloud.gaming.v1beta.GameServerDeploymentsService. + this.gameServerDeploymentsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.gaming.v1beta.GameServerDeploymentsService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.gaming.v1beta + .GameServerDeploymentsService, + 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 gameServerDeploymentsServiceStubMethods = [ + 'listGameServerDeployments', + 'getGameServerDeployment', + 'createGameServerDeployment', + 'deleteGameServerDeployment', + 'updateGameServerDeployment', + 'getGameServerDeploymentRollout', + 'updateGameServerDeploymentRollout', + 'previewGameServerDeploymentRollout', + 'fetchDeploymentState', + ]; + for (const methodName of gameServerDeploymentsServiceStubMethods) { + const callPromise = this.gameServerDeploymentsServiceStub.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.gameServerDeploymentsServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'gameservices.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 'gameservices.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 -- + // ------------------- + /** + * Gets details of a single game server deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the game server delpoyment to retrieve. Uses the + * form: + * + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [GameServerDeployment]{@link google.cloud.gaming.v1beta.GameServerDeployment}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/game_server_deployments_service.get_game_server_deployment.js + * region_tag:gameservices_v1beta_generated_GameServerDeploymentsService_GetGameServerDeployment_async + */ + getGameServerDeployment( + request?: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + ( + | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest + | undefined + ), + {} | undefined + ] + >; + getGameServerDeployment( + request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGameServerDeployment( + request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, + callback: Callback< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGameServerDeployment( + request?: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + ( + | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest + | 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.getGameServerDeployment( + request, + options, + callback + ); + } + /** + * Gets details a single game server deployment rollout. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the game server delpoyment to retrieve. Uses the + * form: + * + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [GameServerDeploymentRollout]{@link google.cloud.gaming.v1beta.GameServerDeploymentRollout}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/game_server_deployments_service.get_game_server_deployment_rollout.js + * region_tag:gameservices_v1beta_generated_GameServerDeploymentsService_GetGameServerDeploymentRollout_async + */ + getGameServerDeploymentRollout( + request?: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, + ( + | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest + | undefined + ), + {} | undefined + ] + >; + getGameServerDeploymentRollout( + request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, + | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGameServerDeploymentRollout( + request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, + callback: Callback< + protos.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, + | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGameServerDeploymentRollout( + request?: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, + | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, + | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, + ( + | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest + | 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.getGameServerDeploymentRollout( + request, + options, + callback + ); + } + /** + * Previews the game server deployment rollout. This API does not mutate the + * rollout resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.gaming.v1beta.GameServerDeploymentRollout} request.rollout + * Required. The game server deployment rollout to be updated. + * Only fields specified in update_mask are updated. + * @param {google.protobuf.FieldMask} [request.updateMask] + * Optional. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * + * https: + * //developers.google.com/protocol-buffers + * // /docs/reference/google.protobuf#fieldmask + * @param {google.protobuf.Timestamp} [request.previewTime] + * Optional. The target timestamp to compute the preview. Defaults to the + * immediately after the proposed rollout completes. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [PreviewGameServerDeploymentRolloutResponse]{@link google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/game_server_deployments_service.preview_game_server_deployment_rollout.js + * region_tag:gameservices_v1beta_generated_GameServerDeploymentsService_PreviewGameServerDeploymentRollout_async + */ + previewGameServerDeploymentRollout( + request?: protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, + ( + | protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest + | undefined + ), + {} | undefined + ] + >; + previewGameServerDeploymentRollout( + request: protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, + | protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest + | null + | undefined, + {} | null | undefined + > + ): void; + previewGameServerDeploymentRollout( + request: protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, + callback: Callback< + protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, + | protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest + | null + | undefined, + {} | null | undefined + > + ): void; + previewGameServerDeploymentRollout( + request?: protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, + | protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, + | protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, + ( + | protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest + | 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({ + 'rollout.name': request.rollout!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.previewGameServerDeploymentRollout( + request, + options, + callback + ); + } + /** + * Retrieves information about the current state of the game server + * deployment. Gathers all the Agones fleets and Agones autoscalers, + * including fleets running an older version of the game server deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the game server delpoyment. Uses the form: + * + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [FetchDeploymentStateResponse]{@link google.cloud.gaming.v1beta.FetchDeploymentStateResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/game_server_deployments_service.fetch_deployment_state.js + * region_tag:gameservices_v1beta_generated_GameServerDeploymentsService_FetchDeploymentState_async + */ + fetchDeploymentState( + request?: protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, + ( + | protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest + | undefined + ), + {} | undefined + ] + >; + fetchDeploymentState( + request: protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, + | protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + fetchDeploymentState( + request: protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, + callback: Callback< + protos.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, + | protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + fetchDeploymentState( + request?: protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, + | protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, + | protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, + ( + | protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest + | 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.fetchDeploymentState(request, options, callback); + } + + /** + * Creates a new game server deployment in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. Uses the form: + * `projects/{project}/locations/{location}`. + * @param {string} request.deploymentId + * Required. The ID of the game server delpoyment resource to be created. + * @param {google.cloud.gaming.v1beta.GameServerDeployment} request.gameServerDeployment + * Required. The game server delpoyment resource to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/v1beta/game_server_deployments_service.create_game_server_deployment.js + * region_tag:gameservices_v1beta_generated_GameServerDeploymentsService_CreateGameServerDeployment_async + */ + createGameServerDeployment( + request?: protos.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createGameServerDeployment( + request: protos.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createGameServerDeployment( + request: protos.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createGameServerDeployment( + request?: protos.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createGameServerDeployment( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createGameServerDeployment()`. + * @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/v1beta/game_server_deployments_service.create_game_server_deployment.js + * region_tag:gameservices_v1beta_generated_GameServerDeploymentsService_CreateGameServerDeployment_async + */ + async checkCreateGameServerDeploymentProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1beta.GameServerDeployment, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createGameServerDeployment, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1beta.GameServerDeployment, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } + /** + * Deletes a single game server deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the game server delpoyment to delete. Uses the form: + * + * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v1beta/game_server_deployments_service.delete_game_server_deployment.js + * region_tag:gameservices_v1beta_generated_GameServerDeploymentsService_DeleteGameServerDeployment_async + */ + deleteGameServerDeployment( + request?: protos.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteGameServerDeployment( + request: protos.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGameServerDeployment( + request: protos.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGameServerDeployment( + request?: protos.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteGameServerDeployment( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteGameServerDeployment()`. + * @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/v1beta/game_server_deployments_service.delete_game_server_deployment.js + * region_tag:gameservices_v1beta_generated_GameServerDeploymentsService_DeleteGameServerDeployment_async + */ + async checkDeleteGameServerDeploymentProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteGameServerDeployment, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } + /** + * Patches a game server deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.gaming.v1beta.GameServerDeployment} request.gameServerDeployment + * Required. The game server delpoyment to be updated. + * Only fields specified in update_mask are updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * + * https: + * //developers.google.com/protocol-buffers + * // /docs/reference/google.protobuf#fieldmask + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/v1beta/game_server_deployments_service.update_game_server_deployment.js + * region_tag:gameservices_v1beta_generated_GameServerDeploymentsService_UpdateGameServerDeployment_async + */ + updateGameServerDeployment( + request?: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateGameServerDeployment( + request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateGameServerDeployment( + request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateGameServerDeployment( + request?: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'game_server_deployment.name': request.gameServerDeployment!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateGameServerDeployment( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updateGameServerDeployment()`. + * @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/v1beta/game_server_deployments_service.update_game_server_deployment.js + * region_tag:gameservices_v1beta_generated_GameServerDeploymentsService_UpdateGameServerDeployment_async + */ + async checkUpdateGameServerDeploymentProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1beta.GameServerDeployment, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateGameServerDeployment, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1beta.GameServerDeployment, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } + /** + * Patches a single game server deployment rollout. + * The method will not return an error if the update does not affect any + * existing realms. For example - if the default_game_server_config is changed + * but all existing realms use the override, that is valid. Similarly, if a + * non existing realm is explicitly called out in game_server_config_overrides + * field, that will also not result in an error. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.gaming.v1beta.GameServerDeploymentRollout} request.rollout + * Required. The game server delpoyment rollout to be updated. + * Only fields specified in update_mask are updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. At least one path must be supplied in + * this field. For the `FieldMask` definition, see + * + * https: + * //developers.google.com/protocol-buffers + * // /docs/reference/google.protobuf#fieldmask + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/v1beta/game_server_deployments_service.update_game_server_deployment_rollout.js + * region_tag:gameservices_v1beta_generated_GameServerDeploymentsService_UpdateGameServerDeploymentRollout_async + */ + updateGameServerDeploymentRollout( + request?: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateGameServerDeploymentRollout( + request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateGameServerDeploymentRollout( + request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateGameServerDeploymentRollout( + request?: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'rollout.name': request.rollout!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateGameServerDeploymentRollout( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updateGameServerDeploymentRollout()`. + * @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/v1beta/game_server_deployments_service.update_game_server_deployment_rollout.js + * region_tag:gameservices_v1beta_generated_GameServerDeploymentsService_UpdateGameServerDeploymentRollout_async + */ + async checkUpdateGameServerDeploymentRolloutProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1beta.GameServerDeployment, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateGameServerDeploymentRollout, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1beta.GameServerDeployment, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } + /** + * Lists game server deployments in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. Uses the form: + * `projects/{project}/locations/{location}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, the + * server will pick an appropriate default. The server may return fewer items + * than requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse.next_page_token|next_page_token} + * to determine if there are more GameServerDeployments left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous List request, + * if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [GameServerDeployment]{@link google.cloud.gaming.v1beta.GameServerDeployment}. + * 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 `listGameServerDeploymentsAsync()` + * 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. + */ + listGameServerDeployments( + request?: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IGameServerDeployment[], + protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest | null, + protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse + ] + >; + listGameServerDeployments( + request: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + | protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse + | null + | undefined, + protos.google.cloud.gaming.v1beta.IGameServerDeployment + > + ): void; + listGameServerDeployments( + request: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + callback: PaginationCallback< + protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + | protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse + | null + | undefined, + protos.google.cloud.gaming.v1beta.IGameServerDeployment + > + ): void; + listGameServerDeployments( + request?: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + | protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse + | null + | undefined, + protos.google.cloud.gaming.v1beta.IGameServerDeployment + >, + callback?: PaginationCallback< + protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + | protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse + | null + | undefined, + protos.google.cloud.gaming.v1beta.IGameServerDeployment + > + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IGameServerDeployment[], + protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest | null, + protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listGameServerDeployments( + 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. Uses the form: + * `projects/{project}/locations/{location}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, the + * server will pick an appropriate default. The server may return fewer items + * than requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse.next_page_token|next_page_token} + * to determine if there are more GameServerDeployments left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous List request, + * if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @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 [GameServerDeployment]{@link google.cloud.gaming.v1beta.GameServerDeployment} 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 `listGameServerDeploymentsAsync()` + * 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. + */ + listGameServerDeploymentsStream( + request?: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + 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['listGameServerDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listGameServerDeployments.createStream( + this.innerApiCalls.listGameServerDeployments as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listGameServerDeployments`, 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. Uses the form: + * `projects/{project}/locations/{location}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, the + * server will pick an appropriate default. The server may return fewer items + * than requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse.next_page_token|next_page_token} + * to determine if there are more GameServerDeployments left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous List request, + * if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @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 + * [GameServerDeployment]{@link google.cloud.gaming.v1beta.GameServerDeployment}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta/game_server_deployments_service.list_game_server_deployments.js + * region_tag:gameservices_v1beta_generated_GameServerDeploymentsService_ListGameServerDeployments_async + */ + listGameServerDeploymentsAsync( + request?: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + 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['listGameServerDeployments']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listGameServerDeployments.asyncIterate( + this.innerApiCalls['listGameServerDeployments'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified gameServerCluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} realm + * @param {string} cluster + * @returns {string} Resource name string. + */ + gameServerClusterPath( + project: string, + location: string, + realm: string, + cluster: string + ) { + return this.pathTemplates.gameServerClusterPathTemplate.render({ + project: project, + location: location, + realm: realm, + cluster: cluster, + }); + } + + /** + * Parse the project from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).project; + } + + /** + * Parse the location from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).location; + } + + /** + * Parse the realm from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the realm. + */ + matchRealmFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).realm; + } + + /** + * Parse the cluster from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).cluster; + } + + /** + * Return a fully-qualified gameServerConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @param {string} config + * @returns {string} Resource name string. + */ + gameServerConfigPath( + project: string, + location: string, + deployment: string, + config: string + ) { + return this.pathTemplates.gameServerConfigPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + config: config, + }); + } + + /** + * Parse the project from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).project; + } + + /** + * Parse the location from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).location; + } + + /** + * Parse the deployment from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).deployment; + } + + /** + * Parse the config from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the config. + */ + matchConfigFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).config; + } + + /** + * Return a fully-qualified gameServerDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + gameServerDeploymentPath( + project: string, + location: string, + deployment: string + ) { + return this.pathTemplates.gameServerDeploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerDeploymentName(gameServerDeploymentName: string) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).project; + } + + /** + * Parse the location from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerDeploymentName(gameServerDeploymentName: string) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).location; + } + + /** + * Parse the deployment from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerDeploymentName( + gameServerDeploymentName: string + ) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).deployment; + } + + /** + * Return a fully-qualified gameServerDeploymentRollout resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + gameServerDeploymentRolloutPath( + project: string, + location: string, + deployment: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).project; + } + + /** + * Parse the location from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).location; + } + + /** + * Parse the deployment from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).deployment; + } + + /** + * Return a fully-qualified realm resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} realm + * @returns {string} Resource name string. + */ + realmPath(project: string, location: string, realm: string) { + return this.pathTemplates.realmPathTemplate.render({ + project: project, + location: location, + realm: realm, + }); + } + + /** + * Parse the project from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).project; + } + + /** + * Parse the location from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).location; + } + + /** + * Parse the realm from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the realm. + */ + matchRealmFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).realm; + } + + /** + * 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.gameServerDeploymentsServiceStub && !this._terminated) { + return this.gameServerDeploymentsServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-gaming/src/v1beta/game_server_deployments_service_client_config.json b/packages/google-cloud-gaming/src/v1beta/game_server_deployments_service_client_config.json new file mode 100644 index 00000000000..8c0ada7f727 --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/game_server_deployments_service_client_config.json @@ -0,0 +1,83 @@ +{ + "interfaces": { + "google.cloud.gaming.v1beta.GameServerDeploymentsService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListGameServerDeployments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetGameServerDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateGameServerDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteGameServerDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateGameServerDeployment": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetGameServerDeploymentRollout": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateGameServerDeploymentRollout": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PreviewGameServerDeploymentRollout": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "FetchDeploymentState": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-cloud-gaming/src/v1beta/game_server_deployments_service_proto_list.json b/packages/google-cloud-gaming/src/v1beta/game_server_deployments_service_proto_list.json new file mode 100644 index 00000000000..1a93d2cf41f --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/game_server_deployments_service_proto_list.json @@ -0,0 +1,11 @@ +[ + "../../protos/google/cloud/gaming/v1beta/common.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_clusters.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_clusters_service.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_configs.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_configs_service.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_deployments.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_deployments_service.proto", + "../../protos/google/cloud/gaming/v1beta/realms.proto", + "../../protos/google/cloud/gaming/v1beta/realms_service.proto" +] diff --git a/packages/google-cloud-gaming/src/v1beta/gapic_metadata.json b/packages/google-cloud-gaming/src/v1beta/gapic_metadata.json new file mode 100644 index 00000000000..8ed1d3e868d --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/gapic_metadata.json @@ -0,0 +1,351 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.gaming.v1beta", + "libraryPackage": "@google-cloud/game-servers", + "services": { + "GameServerClustersService": { + "clients": { + "grpc": { + "libraryClient": "GameServerClustersServiceClient", + "rpcs": { + "GetGameServerCluster": { + "methods": [ + "getGameServerCluster" + ] + }, + "PreviewCreateGameServerCluster": { + "methods": [ + "previewCreateGameServerCluster" + ] + }, + "PreviewDeleteGameServerCluster": { + "methods": [ + "previewDeleteGameServerCluster" + ] + }, + "PreviewUpdateGameServerCluster": { + "methods": [ + "previewUpdateGameServerCluster" + ] + }, + "CreateGameServerCluster": { + "methods": [ + "createGameServerCluster" + ] + }, + "DeleteGameServerCluster": { + "methods": [ + "deleteGameServerCluster" + ] + }, + "UpdateGameServerCluster": { + "methods": [ + "updateGameServerCluster" + ] + }, + "ListGameServerClusters": { + "methods": [ + "listGameServerClusters", + "listGameServerClustersStream", + "listGameServerClustersAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "GameServerClustersServiceClient", + "rpcs": { + "GetGameServerCluster": { + "methods": [ + "getGameServerCluster" + ] + }, + "PreviewCreateGameServerCluster": { + "methods": [ + "previewCreateGameServerCluster" + ] + }, + "PreviewDeleteGameServerCluster": { + "methods": [ + "previewDeleteGameServerCluster" + ] + }, + "PreviewUpdateGameServerCluster": { + "methods": [ + "previewUpdateGameServerCluster" + ] + }, + "CreateGameServerCluster": { + "methods": [ + "createGameServerCluster" + ] + }, + "DeleteGameServerCluster": { + "methods": [ + "deleteGameServerCluster" + ] + }, + "UpdateGameServerCluster": { + "methods": [ + "updateGameServerCluster" + ] + }, + "ListGameServerClusters": { + "methods": [ + "listGameServerClusters", + "listGameServerClustersStream", + "listGameServerClustersAsync" + ] + } + } + } + } + }, + "GameServerConfigsService": { + "clients": { + "grpc": { + "libraryClient": "GameServerConfigsServiceClient", + "rpcs": { + "GetGameServerConfig": { + "methods": [ + "getGameServerConfig" + ] + }, + "CreateGameServerConfig": { + "methods": [ + "createGameServerConfig" + ] + }, + "DeleteGameServerConfig": { + "methods": [ + "deleteGameServerConfig" + ] + }, + "ListGameServerConfigs": { + "methods": [ + "listGameServerConfigs", + "listGameServerConfigsStream", + "listGameServerConfigsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "GameServerConfigsServiceClient", + "rpcs": { + "GetGameServerConfig": { + "methods": [ + "getGameServerConfig" + ] + }, + "CreateGameServerConfig": { + "methods": [ + "createGameServerConfig" + ] + }, + "DeleteGameServerConfig": { + "methods": [ + "deleteGameServerConfig" + ] + }, + "ListGameServerConfigs": { + "methods": [ + "listGameServerConfigs", + "listGameServerConfigsStream", + "listGameServerConfigsAsync" + ] + } + } + } + } + }, + "GameServerDeploymentsService": { + "clients": { + "grpc": { + "libraryClient": "GameServerDeploymentsServiceClient", + "rpcs": { + "GetGameServerDeployment": { + "methods": [ + "getGameServerDeployment" + ] + }, + "GetGameServerDeploymentRollout": { + "methods": [ + "getGameServerDeploymentRollout" + ] + }, + "PreviewGameServerDeploymentRollout": { + "methods": [ + "previewGameServerDeploymentRollout" + ] + }, + "FetchDeploymentState": { + "methods": [ + "fetchDeploymentState" + ] + }, + "CreateGameServerDeployment": { + "methods": [ + "createGameServerDeployment" + ] + }, + "DeleteGameServerDeployment": { + "methods": [ + "deleteGameServerDeployment" + ] + }, + "UpdateGameServerDeployment": { + "methods": [ + "updateGameServerDeployment" + ] + }, + "UpdateGameServerDeploymentRollout": { + "methods": [ + "updateGameServerDeploymentRollout" + ] + }, + "ListGameServerDeployments": { + "methods": [ + "listGameServerDeployments", + "listGameServerDeploymentsStream", + "listGameServerDeploymentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "GameServerDeploymentsServiceClient", + "rpcs": { + "GetGameServerDeployment": { + "methods": [ + "getGameServerDeployment" + ] + }, + "GetGameServerDeploymentRollout": { + "methods": [ + "getGameServerDeploymentRollout" + ] + }, + "PreviewGameServerDeploymentRollout": { + "methods": [ + "previewGameServerDeploymentRollout" + ] + }, + "FetchDeploymentState": { + "methods": [ + "fetchDeploymentState" + ] + }, + "CreateGameServerDeployment": { + "methods": [ + "createGameServerDeployment" + ] + }, + "DeleteGameServerDeployment": { + "methods": [ + "deleteGameServerDeployment" + ] + }, + "UpdateGameServerDeployment": { + "methods": [ + "updateGameServerDeployment" + ] + }, + "UpdateGameServerDeploymentRollout": { + "methods": [ + "updateGameServerDeploymentRollout" + ] + }, + "ListGameServerDeployments": { + "methods": [ + "listGameServerDeployments", + "listGameServerDeploymentsStream", + "listGameServerDeploymentsAsync" + ] + } + } + } + } + }, + "RealmsService": { + "clients": { + "grpc": { + "libraryClient": "RealmsServiceClient", + "rpcs": { + "GetRealm": { + "methods": [ + "getRealm" + ] + }, + "PreviewRealmUpdate": { + "methods": [ + "previewRealmUpdate" + ] + }, + "CreateRealm": { + "methods": [ + "createRealm" + ] + }, + "DeleteRealm": { + "methods": [ + "deleteRealm" + ] + }, + "UpdateRealm": { + "methods": [ + "updateRealm" + ] + }, + "ListRealms": { + "methods": [ + "listRealms", + "listRealmsStream", + "listRealmsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "RealmsServiceClient", + "rpcs": { + "GetRealm": { + "methods": [ + "getRealm" + ] + }, + "PreviewRealmUpdate": { + "methods": [ + "previewRealmUpdate" + ] + }, + "CreateRealm": { + "methods": [ + "createRealm" + ] + }, + "DeleteRealm": { + "methods": [ + "deleteRealm" + ] + }, + "UpdateRealm": { + "methods": [ + "updateRealm" + ] + }, + "ListRealms": { + "methods": [ + "listRealms", + "listRealmsStream", + "listRealmsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-gaming/src/v1beta/index.ts b/packages/google-cloud-gaming/src/v1beta/index.ts new file mode 100644 index 00000000000..86b711bd392 --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/index.ts @@ -0,0 +1,22 @@ +// 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 {GameServerClustersServiceClient} from './game_server_clusters_service_client'; +export {GameServerConfigsServiceClient} from './game_server_configs_service_client'; +export {GameServerDeploymentsServiceClient} from './game_server_deployments_service_client'; +export {RealmsServiceClient} from './realms_service_client'; diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts new file mode 100644 index 00000000000..d85db5bce1a --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -0,0 +1,1597 @@ +// 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/v1beta/realms_service_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './realms_service_client_config.json'; +const version = require('../../../package.json').version; + +/** + * A realm is a grouping of game server clusters that are considered + * interchangeable. + * @class + * @memberof v1beta + */ +export class RealmsServiceClient { + 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; + realmsServiceStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RealmsServiceClient. + * + * @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 RealmsServiceClient({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 RealmsServiceClient; + 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 = { + gameServerClusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}' + ), + gameServerConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}' + ), + gameServerDeploymentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}' + ), + gameServerDeploymentRolloutPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout' + ), + realmPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}' + ), + }; + + // 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 = { + listRealms: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'realms' + ), + }; + + 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: '/v1beta/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1beta/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1beta/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1beta/{name=projects/*/locations/*}/operations', + }, + ]; + } + this.operationsClient = this._gaxModule + .lro(lroOptions) + .operationsClient(opts); + const createRealmResponse = protoFilesRoot.lookup( + '.google.cloud.gaming.v1beta.Realm' + ) as gax.protobuf.Type; + const createRealmMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1beta.OperationMetadata' + ) as gax.protobuf.Type; + const deleteRealmResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteRealmMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1beta.OperationMetadata' + ) as gax.protobuf.Type; + const updateRealmResponse = protoFilesRoot.lookup( + '.google.cloud.gaming.v1beta.Realm' + ) as gax.protobuf.Type; + const updateRealmMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1beta.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createRealm: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createRealmResponse.decode.bind(createRealmResponse), + createRealmMetadata.decode.bind(createRealmMetadata) + ), + deleteRealm: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteRealmResponse.decode.bind(deleteRealmResponse), + deleteRealmMetadata.decode.bind(deleteRealmMetadata) + ), + updateRealm: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateRealmResponse.decode.bind(updateRealmResponse), + updateRealmMetadata.decode.bind(updateRealmMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.gaming.v1beta.RealmsService', + 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.realmsServiceStub) { + return this.realmsServiceStub; + } + + // Put together the "service stub" for + // google.cloud.gaming.v1beta.RealmsService. + this.realmsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.gaming.v1beta.RealmsService' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.gaming.v1beta.RealmsService, + 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 realmsServiceStubMethods = [ + 'listRealms', + 'getRealm', + 'createRealm', + 'deleteRealm', + 'updateRealm', + 'previewRealmUpdate', + ]; + for (const methodName of realmsServiceStubMethods) { + const callPromise = this.realmsServiceStub.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.realmsServiceStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'gameservices.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 'gameservices.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 -- + // ------------------- + /** + * Gets details of a single realm. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the realm to retrieve. Uses the form: + * `projects/{project}/locations/{location}/realms/{realm}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Realm]{@link google.cloud.gaming.v1beta.Realm}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/realms_service.get_realm.js + * region_tag:gameservices_v1beta_generated_RealmsService_GetRealm_async + */ + getRealm( + request?: protos.google.cloud.gaming.v1beta.IGetRealmRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IGetRealmRequest | undefined, + {} | undefined + ] + >; + getRealm( + request: protos.google.cloud.gaming.v1beta.IGetRealmRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IGetRealmRequest | null | undefined, + {} | null | undefined + > + ): void; + getRealm( + request: protos.google.cloud.gaming.v1beta.IGetRealmRequest, + callback: Callback< + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IGetRealmRequest | null | undefined, + {} | null | undefined + > + ): void; + getRealm( + request?: protos.google.cloud.gaming.v1beta.IGetRealmRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IGetRealmRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IGetRealmRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IGetRealmRequest | 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.getRealm(request, options, callback); + } + /** + * Previews patches to a single realm. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.gaming.v1beta.Realm} request.realm + * Required. The realm to be updated. + * Only fields specified in update_mask are updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * + * https: + * //developers.google.com/protocol-buffers + * // /docs/reference/google.protobuf#fieldmask + * @param {google.protobuf.Timestamp} [request.previewTime] + * Optional. The target timestamp to compute the preview. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [PreviewRealmUpdateResponse]{@link google.cloud.gaming.v1beta.PreviewRealmUpdateResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta/realms_service.preview_realm_update.js + * region_tag:gameservices_v1beta_generated_RealmsService_PreviewRealmUpdate_async + */ + previewRealmUpdate( + request?: protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, + protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest | undefined, + {} | undefined + ] + >; + previewRealmUpdate( + request: protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, + | protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + previewRealmUpdate( + request: protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, + callback: Callback< + protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, + | protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest + | null + | undefined, + {} | null | undefined + > + ): void; + previewRealmUpdate( + request?: protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, + | protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, + | protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, + protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest | 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({ + 'realm.name': request.realm!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.previewRealmUpdate(request, options, callback); + } + + /** + * Creates a new realm in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. Uses the form: + * `projects/{project}/locations/{location}`. + * @param {string} request.realmId + * Required. The ID of the realm resource to be created. + * @param {google.cloud.gaming.v1beta.Realm} request.realm + * Required. The realm resource to be created. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/v1beta/realms_service.create_realm.js + * region_tag:gameservices_v1beta_generated_RealmsService_CreateRealm_async + */ + createRealm( + request?: protos.google.cloud.gaming.v1beta.ICreateRealmRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createRealm( + request: protos.google.cloud.gaming.v1beta.ICreateRealmRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createRealm( + request: protos.google.cloud.gaming.v1beta.ICreateRealmRequest, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createRealm( + request?: protos.google.cloud.gaming.v1beta.ICreateRealmRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createRealm(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createRealm()`. + * @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/v1beta/realms_service.create_realm.js + * region_tag:gameservices_v1beta_generated_RealmsService_CreateRealm_async + */ + async checkCreateRealmProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1beta.Realm, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createRealm, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1beta.Realm, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } + /** + * Deletes a single realm. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the realm to delete. Uses the form: + * `projects/{project}/locations/{location}/realms/{realm}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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/v1beta/realms_service.delete_realm.js + * region_tag:gameservices_v1beta_generated_RealmsService_DeleteRealm_async + */ + deleteRealm( + request?: protos.google.cloud.gaming.v1beta.IDeleteRealmRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteRealm( + request: protos.google.cloud.gaming.v1beta.IDeleteRealmRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteRealm( + request: protos.google.cloud.gaming.v1beta.IDeleteRealmRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteRealm( + request?: protos.google.cloud.gaming.v1beta.IDeleteRealmRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteRealm(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteRealm()`. + * @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/v1beta/realms_service.delete_realm.js + * region_tag:gameservices_v1beta_generated_RealmsService_DeleteRealm_async + */ + async checkDeleteRealmProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteRealm, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } + /** + * Patches a single realm. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.gaming.v1beta.Realm} request.realm + * Required. The realm to be updated. + * Only fields specified in update_mask are updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The update mask applies to the resource. For the `FieldMask` + * definition, see + * + * https: + * //developers.google.com/protocol-buffers + * // /docs/reference/google.protobuf#fieldmask + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/v1beta/realms_service.update_realm.js + * region_tag:gameservices_v1beta_generated_RealmsService_UpdateRealm_async + */ + updateRealm( + request?: protos.google.cloud.gaming.v1beta.IUpdateRealmRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateRealm( + request: protos.google.cloud.gaming.v1beta.IUpdateRealmRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateRealm( + request: protos.google.cloud.gaming.v1beta.IUpdateRealmRequest, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateRealm( + request?: protos.google.cloud.gaming.v1beta.IUpdateRealmRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'realm.name': request.realm!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateRealm(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateRealm()`. + * @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/v1beta/realms_service.update_realm.js + * region_tag:gameservices_v1beta_generated_RealmsService_UpdateRealm_async + */ + async checkUpdateRealmProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1beta.Realm, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateRealm, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1beta.Realm, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } + /** + * Lists realms in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. Uses the form: + * `projects/{project}/locations/{location}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1beta.ListRealmsResponse.next_page_token|next_page_token} + * to determine if there are more realms left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous List request, + * if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 [Realm]{@link google.cloud.gaming.v1beta.Realm}. + * 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 `listRealmsAsync()` + * 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. + */ + listRealms( + request?: protos.google.cloud.gaming.v1beta.IListRealmsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IRealm[], + protos.google.cloud.gaming.v1beta.IListRealmsRequest | null, + protos.google.cloud.gaming.v1beta.IListRealmsResponse + ] + >; + listRealms( + request: protos.google.cloud.gaming.v1beta.IListRealmsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.gaming.v1beta.IListRealmsRequest, + protos.google.cloud.gaming.v1beta.IListRealmsResponse | null | undefined, + protos.google.cloud.gaming.v1beta.IRealm + > + ): void; + listRealms( + request: protos.google.cloud.gaming.v1beta.IListRealmsRequest, + callback: PaginationCallback< + protos.google.cloud.gaming.v1beta.IListRealmsRequest, + protos.google.cloud.gaming.v1beta.IListRealmsResponse | null | undefined, + protos.google.cloud.gaming.v1beta.IRealm + > + ): void; + listRealms( + request?: protos.google.cloud.gaming.v1beta.IListRealmsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.gaming.v1beta.IListRealmsRequest, + | protos.google.cloud.gaming.v1beta.IListRealmsResponse + | null + | undefined, + protos.google.cloud.gaming.v1beta.IRealm + >, + callback?: PaginationCallback< + protos.google.cloud.gaming.v1beta.IListRealmsRequest, + protos.google.cloud.gaming.v1beta.IListRealmsResponse | null | undefined, + protos.google.cloud.gaming.v1beta.IRealm + > + ): Promise< + [ + protos.google.cloud.gaming.v1beta.IRealm[], + protos.google.cloud.gaming.v1beta.IListRealmsRequest | null, + protos.google.cloud.gaming.v1beta.IListRealmsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as 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.listRealms(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. Uses the form: + * `projects/{project}/locations/{location}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1beta.ListRealmsResponse.next_page_token|next_page_token} + * to determine if there are more realms left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous List request, + * if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @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 [Realm]{@link google.cloud.gaming.v1beta.Realm} 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 `listRealmsAsync()` + * 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. + */ + listRealmsStream( + request?: protos.google.cloud.gaming.v1beta.IListRealmsRequest, + 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['listRealms']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRealms.createStream( + this.innerApiCalls.listRealms as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listRealms`, 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. Uses the form: + * `projects/{project}/locations/{location}`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return. If unspecified, server + * will pick an appropriate default. Server may return fewer items than + * requested. A caller should only rely on response's + * {@link google.cloud.gaming.v1beta.ListRealmsResponse.next_page_token|next_page_token} + * to determine if there are more realms left to be queried. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous List request, + * if any. + * @param {string} [request.filter] + * Optional. The filter to apply to list results. + * @param {string} [request.orderBy] + * Optional. Specifies the ordering of results following syntax at + * https://cloud.google.com/apis/design/design_patterns#sorting_order. + * @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 + * [Realm]{@link google.cloud.gaming.v1beta.Realm}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta/realms_service.list_realms.js + * region_tag:gameservices_v1beta_generated_RealmsService_ListRealms_async + */ + listRealmsAsync( + request?: protos.google.cloud.gaming.v1beta.IListRealmsRequest, + 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['listRealms']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRealms.asyncIterate( + this.innerApiCalls['listRealms'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified gameServerCluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} realm + * @param {string} cluster + * @returns {string} Resource name string. + */ + gameServerClusterPath( + project: string, + location: string, + realm: string, + cluster: string + ) { + return this.pathTemplates.gameServerClusterPathTemplate.render({ + project: project, + location: location, + realm: realm, + cluster: cluster, + }); + } + + /** + * Parse the project from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).project; + } + + /** + * Parse the location from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).location; + } + + /** + * Parse the realm from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the realm. + */ + matchRealmFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).realm; + } + + /** + * Parse the cluster from GameServerCluster resource. + * + * @param {string} gameServerClusterName + * A fully-qualified path representing GameServerCluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromGameServerClusterName(gameServerClusterName: string) { + return this.pathTemplates.gameServerClusterPathTemplate.match( + gameServerClusterName + ).cluster; + } + + /** + * Return a fully-qualified gameServerConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @param {string} config + * @returns {string} Resource name string. + */ + gameServerConfigPath( + project: string, + location: string, + deployment: string, + config: string + ) { + return this.pathTemplates.gameServerConfigPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + config: config, + }); + } + + /** + * Parse the project from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).project; + } + + /** + * Parse the location from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).location; + } + + /** + * Parse the deployment from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).deployment; + } + + /** + * Parse the config from GameServerConfig resource. + * + * @param {string} gameServerConfigName + * A fully-qualified path representing GameServerConfig resource. + * @returns {string} A string representing the config. + */ + matchConfigFromGameServerConfigName(gameServerConfigName: string) { + return this.pathTemplates.gameServerConfigPathTemplate.match( + gameServerConfigName + ).config; + } + + /** + * Return a fully-qualified gameServerDeployment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + gameServerDeploymentPath( + project: string, + location: string, + deployment: string + ) { + return this.pathTemplates.gameServerDeploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerDeploymentName(gameServerDeploymentName: string) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).project; + } + + /** + * Parse the location from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerDeploymentName(gameServerDeploymentName: string) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).location; + } + + /** + * Parse the deployment from GameServerDeployment resource. + * + * @param {string} gameServerDeploymentName + * A fully-qualified path representing GameServerDeployment resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerDeploymentName( + gameServerDeploymentName: string + ) { + return this.pathTemplates.gameServerDeploymentPathTemplate.match( + gameServerDeploymentName + ).deployment; + } + + /** + * Return a fully-qualified gameServerDeploymentRollout resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} deployment + * @returns {string} Resource name string. + */ + gameServerDeploymentRolloutPath( + project: string, + location: string, + deployment: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + }); + } + + /** + * Parse the project from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).project; + } + + /** + * Parse the location from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the location. + */ + matchLocationFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).location; + } + + /** + * Parse the deployment from GameServerDeploymentRollout resource. + * + * @param {string} gameServerDeploymentRolloutName + * A fully-qualified path representing GameServerDeploymentRollout resource. + * @returns {string} A string representing the deployment. + */ + matchDeploymentFromGameServerDeploymentRolloutName( + gameServerDeploymentRolloutName: string + ) { + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + gameServerDeploymentRolloutName + ).deployment; + } + + /** + * Return a fully-qualified realm resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} realm + * @returns {string} Resource name string. + */ + realmPath(project: string, location: string, realm: string) { + return this.pathTemplates.realmPathTemplate.render({ + project: project, + location: location, + realm: realm, + }); + } + + /** + * Parse the project from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).project; + } + + /** + * Parse the location from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the location. + */ + matchLocationFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).location; + } + + /** + * Parse the realm from Realm resource. + * + * @param {string} realmName + * A fully-qualified path representing Realm resource. + * @returns {string} A string representing the realm. + */ + matchRealmFromRealmName(realmName: string) { + return this.pathTemplates.realmPathTemplate.match(realmName).realm; + } + + /** + * 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.realmsServiceStub && !this._terminated) { + return this.realmsServiceStub.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client_config.json b/packages/google-cloud-gaming/src/v1beta/realms_service_client_config.json new file mode 100644 index 00000000000..fc607b80a10 --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client_config.json @@ -0,0 +1,68 @@ +{ + "interfaces": { + "google.cloud.gaming.v1beta.RealmsService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListRealms": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetRealm": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateRealm": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteRealm": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateRealm": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PreviewRealmUpdate": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_proto_list.json b/packages/google-cloud-gaming/src/v1beta/realms_service_proto_list.json new file mode 100644 index 00000000000..1a93d2cf41f --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_proto_list.json @@ -0,0 +1,11 @@ +[ + "../../protos/google/cloud/gaming/v1beta/common.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_clusters.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_clusters_service.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_configs.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_configs_service.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_deployments.proto", + "../../protos/google/cloud/gaming/v1beta/game_server_deployments_service.proto", + "../../protos/google/cloud/gaming/v1beta/realms.proto", + "../../protos/google/cloud/gaming/v1beta/realms_service.proto" +] diff --git a/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.js b/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..84204c96442 --- /dev/null +++ b/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.js @@ -0,0 +1,32 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const gaming = require('@google-cloud/game-servers'); + +function main() { + const gameServerClustersServiceClient = + new gaming.GameServerClustersServiceClient(); + const gameServerConfigsServiceClient = + new gaming.GameServerConfigsServiceClient(); + const gameServerDeploymentsServiceClient = + new gaming.GameServerDeploymentsServiceClient(); + const realmsServiceClient = new gaming.RealmsServiceClient(); +} + +main(); diff --git a/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..6d282fc65bd --- /dev/null +++ b/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,64 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import { + GameServerClustersServiceClient, + GameServerConfigsServiceClient, + GameServerDeploymentsServiceClient, + RealmsServiceClient, +} from '@google-cloud/game-servers'; + +// check that the client class type name can be used +function doStuffWithGameServerClustersServiceClient( + client: GameServerClustersServiceClient +) { + client.close(); +} +function doStuffWithGameServerConfigsServiceClient( + client: GameServerConfigsServiceClient +) { + client.close(); +} +function doStuffWithGameServerDeploymentsServiceClient( + client: GameServerDeploymentsServiceClient +) { + client.close(); +} +function doStuffWithRealmsServiceClient(client: RealmsServiceClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const gameServerClustersServiceClient = new GameServerClustersServiceClient(); + doStuffWithGameServerClustersServiceClient(gameServerClustersServiceClient); + // check that the client instance can be created + const gameServerConfigsServiceClient = new GameServerConfigsServiceClient(); + doStuffWithGameServerConfigsServiceClient(gameServerConfigsServiceClient); + // check that the client instance can be created + const gameServerDeploymentsServiceClient = + new GameServerDeploymentsServiceClient(); + doStuffWithGameServerDeploymentsServiceClient( + gameServerDeploymentsServiceClient + ); + // check that the client instance can be created + const realmsServiceClient = new RealmsServiceClient(); + doStuffWithRealmsServiceClient(realmsServiceClient); +} + +main(); diff --git a/packages/google-cloud-gaming/system-test/install.ts b/packages/google-cloud-gaming/system-test/install.ts new file mode 100644 index 00000000000..6dd1eaadafa --- /dev/null +++ b/packages/google-cloud-gaming/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-gaming/test/gapic_game_server_clusters_service_v1.ts b/packages/google-cloud-gaming/test/gapic_game_server_clusters_service_v1.ts new file mode 100644 index 00000000000..954a3867635 --- /dev/null +++ b/packages/google-cloud-gaming/test/gapic_game_server_clusters_service_v1.ts @@ -0,0 +1,2204 @@ +// 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 gameserverclustersserviceModule 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.GameServerClustersServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + gameserverclustersserviceModule.v1.GameServerClustersServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + gameserverclustersserviceModule.v1.GameServerClustersServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + gameserverclustersserviceModule.v1.GameServerClustersServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.gameServerClustersServiceStub, undefined); + await client.initialize(); + assert(client.gameServerClustersServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.gameServerClustersServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.gameServerClustersServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + 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 gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + 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('getGameServerCluster', () => { + it('invokes getGameServerCluster without error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.GetGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerCluster() + ); + client.innerApiCalls.getGameServerCluster = + stubSimpleCall(expectedResponse); + const [response] = await client.getGameServerCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerCluster without error using callback', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.GetGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerCluster() + ); + client.innerApiCalls.getGameServerCluster = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGameServerCluster( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1.IGameServerCluster | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerCluster with error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.GetGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getGameServerCluster = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getGameServerCluster(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerCluster with closed client', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.GetGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getGameServerCluster(request), expectedError); + }); + }); + + describe('previewCreateGameServerCluster', () => { + it('invokes previewCreateGameServerCluster without error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse() + ); + client.innerApiCalls.previewCreateGameServerCluster = + stubSimpleCall(expectedResponse); + const [response] = await client.previewCreateGameServerCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.previewCreateGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewCreateGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewCreateGameServerCluster without error using callback', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse() + ); + client.innerApiCalls.previewCreateGameServerCluster = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.previewCreateGameServerCluster( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.previewCreateGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewCreateGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewCreateGameServerCluster with error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.previewCreateGameServerCluster = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.previewCreateGameServerCluster(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.previewCreateGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewCreateGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewCreateGameServerCluster with closed client', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.previewCreateGameServerCluster(request), + expectedError + ); + }); + }); + + describe('previewDeleteGameServerCluster', () => { + it('invokes previewDeleteGameServerCluster without error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse() + ); + client.innerApiCalls.previewDeleteGameServerCluster = + stubSimpleCall(expectedResponse); + const [response] = await client.previewDeleteGameServerCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.previewDeleteGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewDeleteGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewDeleteGameServerCluster without error using callback', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse() + ); + client.innerApiCalls.previewDeleteGameServerCluster = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.previewDeleteGameServerCluster( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.previewDeleteGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewDeleteGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewDeleteGameServerCluster with error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.previewDeleteGameServerCluster = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.previewDeleteGameServerCluster(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.previewDeleteGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewDeleteGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewDeleteGameServerCluster with closed client', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.previewDeleteGameServerCluster(request), + expectedError + ); + }); + }); + + describe('previewUpdateGameServerCluster', () => { + it('invokes previewUpdateGameServerCluster without error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest() + ); + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse() + ); + client.innerApiCalls.previewUpdateGameServerCluster = + stubSimpleCall(expectedResponse); + const [response] = await client.previewUpdateGameServerCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.previewUpdateGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewUpdateGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewUpdateGameServerCluster without error using callback', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest() + ); + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse() + ); + client.innerApiCalls.previewUpdateGameServerCluster = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.previewUpdateGameServerCluster( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.previewUpdateGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewUpdateGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewUpdateGameServerCluster with error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest() + ); + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.previewUpdateGameServerCluster = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.previewUpdateGameServerCluster(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.previewUpdateGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewUpdateGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewUpdateGameServerCluster with closed client', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest() + ); + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.previewUpdateGameServerCluster(request), + expectedError + ); + }); + }); + + describe('createGameServerCluster', () => { + it('invokes createGameServerCluster without error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.CreateGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.CreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGameServerCluster = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createGameServerCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGameServerCluster without error using callback', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.CreateGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.CreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGameServerCluster = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createGameServerCluster( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.gaming.v1.IGameServerCluster, + protos.google.cloud.gaming.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gaming.v1.IGameServerCluster, + protos.google.cloud.gaming.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGameServerCluster with call error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.CreateGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.CreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerCluster = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createGameServerCluster(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGameServerCluster with LRO error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.CreateGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.CreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerCluster = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createGameServerCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateGameServerClusterProgress without error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + 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.checkCreateGameServerClusterProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateGameServerClusterProgress with error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + 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.checkCreateGameServerClusterProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteGameServerCluster', () => { + it('invokes deleteGameServerCluster without error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.DeleteGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.DeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGameServerCluster = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteGameServerCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGameServerCluster without error using callback', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.DeleteGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.DeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGameServerCluster = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteGameServerCluster( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGameServerCluster with call error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.DeleteGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.DeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerCluster = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteGameServerCluster(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGameServerCluster with LRO error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.DeleteGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.DeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerCluster = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteGameServerCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteGameServerClusterProgress without error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + 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.checkDeleteGameServerClusterProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteGameServerClusterProgress with error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + 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.checkDeleteGameServerClusterProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateGameServerCluster', () => { + it('invokes updateGameServerCluster without error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.UpdateGameServerClusterRequest() + ); + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.UpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateGameServerCluster = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateGameServerCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGameServerCluster without error using callback', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.UpdateGameServerClusterRequest() + ); + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.UpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateGameServerCluster = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateGameServerCluster( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.gaming.v1.IGameServerCluster, + protos.google.cloud.gaming.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gaming.v1.IGameServerCluster, + protos.google.cloud.gaming.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGameServerCluster with call error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.UpdateGameServerClusterRequest() + ); + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.UpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerCluster = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateGameServerCluster(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGameServerCluster with LRO error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.UpdateGameServerClusterRequest() + ); + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.UpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerCluster = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateGameServerCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateGameServerClusterProgress without error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + 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.checkUpdateGameServerClusterProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateGameServerClusterProgress with error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + 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.checkUpdateGameServerClusterProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listGameServerClusters', () => { + it('invokes listGameServerClusters without error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListGameServerClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerCluster() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerCluster() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerCluster() + ), + ]; + client.innerApiCalls.listGameServerClusters = + stubSimpleCall(expectedResponse); + const [response] = await client.listGameServerClusters(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listGameServerClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGameServerClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGameServerClusters without error using callback', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListGameServerClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerCluster() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerCluster() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerCluster() + ), + ]; + client.innerApiCalls.listGameServerClusters = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listGameServerClusters( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1.IGameServerCluster[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listGameServerClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGameServerClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGameServerClusters with error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListGameServerClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listGameServerClusters = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listGameServerClusters(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listGameServerClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGameServerClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGameServerClustersStream without error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListGameServerClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerCluster() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerCluster() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerCluster() + ), + ]; + client.descriptors.page.listGameServerClusters.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listGameServerClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gaming.v1.GameServerCluster[] = []; + stream.on( + 'data', + (response: protos.google.cloud.gaming.v1.GameServerCluster) => { + 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.listGameServerClusters + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listGameServerClusters, request) + ); + assert( + ( + client.descriptors.page.listGameServerClusters + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listGameServerClustersStream with error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListGameServerClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listGameServerClusters.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listGameServerClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gaming.v1.GameServerCluster[] = []; + stream.on( + 'data', + (response: protos.google.cloud.gaming.v1.GameServerCluster) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listGameServerClusters + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listGameServerClusters, request) + ); + assert( + ( + client.descriptors.page.listGameServerClusters + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGameServerClusters without error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListGameServerClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerCluster() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerCluster() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerCluster() + ), + ]; + client.descriptors.page.listGameServerClusters.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.gaming.v1.IGameServerCluster[] = []; + const iterable = client.listGameServerClustersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listGameServerClusters + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listGameServerClusters + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGameServerClusters with error', async () => { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListGameServerClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listGameServerClusters.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listGameServerClustersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.gaming.v1.IGameServerCluster[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listGameServerClusters + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listGameServerClusters + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('gameServerCluster', () => { + const fakePath = '/rendered/path/gameServerCluster'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + realm: 'realmValue', + cluster: 'clusterValue', + }; + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.gameServerClusterPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerClusterPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerClusterPath', () => { + const result = client.gameServerClusterPath( + 'projectValue', + 'locationValue', + 'realmValue', + 'clusterValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerClusterName', () => { + const result = client.matchProjectFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerClusterName', () => { + const result = client.matchLocationFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRealmFromGameServerClusterName', () => { + const result = client.matchRealmFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'realmValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchClusterFromGameServerClusterName', () => { + const result = client.matchClusterFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerConfig', () => { + const fakePath = '/rendered/path/gameServerConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + config: 'configValue', + }; + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.gameServerConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerConfigPath', () => { + const result = client.gameServerConfigPath( + 'projectValue', + 'locationValue', + 'deploymentValue', + 'configValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerConfigName', () => { + const result = client.matchProjectFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerConfigName', () => { + const result = client.matchLocationFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerConfigName', () => { + const result = client.matchDeploymentFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConfigFromGameServerConfigName', () => { + const result = client.matchConfigFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'configValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerDeployment', () => { + const fakePath = '/rendered/path/gameServerDeployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.gameServerDeploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerDeploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerDeploymentPath', () => { + const result = client.gameServerDeploymentPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerDeploymentName', () => { + const result = + client.matchProjectFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerDeploymentName', () => { + const result = + client.matchLocationFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerDeploymentName', () => { + const result = + client.matchDeploymentFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerDeploymentRollout', () => { + const fakePath = '/rendered/path/gameServerDeploymentRollout'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.gameServerDeploymentRolloutPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gameServerDeploymentRolloutPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerDeploymentRolloutPath', () => { + const result = client.gameServerDeploymentRolloutPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerDeploymentRolloutName', () => { + const result = + client.matchProjectFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerDeploymentRolloutName', () => { + const result = + client.matchLocationFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerDeploymentRolloutName', () => { + const result = + client.matchDeploymentFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('realm', () => { + const fakePath = '/rendered/path/realm'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + realm: 'realmValue', + }; + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.realmPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.realmPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('realmPath', () => { + const result = client.realmPath( + 'projectValue', + 'locationValue', + 'realmValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.realmPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRealmName', () => { + const result = client.matchProjectFromRealmName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRealmName', () => { + const result = client.matchLocationFromRealmName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRealmFromRealmName', () => { + const result = client.matchRealmFromRealmName(fakePath); + assert.strictEqual(result, 'realmValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-gaming/test/gapic_game_server_clusters_service_v1beta.ts b/packages/google-cloud-gaming/test/gapic_game_server_clusters_service_v1beta.ts new file mode 100644 index 00000000000..c7ba664efec --- /dev/null +++ b/packages/google-cloud-gaming/test/gapic_game_server_clusters_service_v1beta.ts @@ -0,0 +1,2314 @@ +// 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 gameserverclustersserviceModule 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('v1beta.GameServerClustersServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient + .port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.gameServerClustersServiceStub, undefined); + await client.initialize(); + assert(client.gameServerClustersServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.gameServerClustersServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.gameServerClustersServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + 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 gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + 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('getGameServerCluster', () => { + it('invokes getGameServerCluster without error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GetGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerCluster() + ); + client.innerApiCalls.getGameServerCluster = + stubSimpleCall(expectedResponse); + const [response] = await client.getGameServerCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerCluster without error using callback', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GetGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerCluster() + ); + client.innerApiCalls.getGameServerCluster = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGameServerCluster( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1beta.IGameServerCluster | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerCluster with error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GetGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getGameServerCluster = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getGameServerCluster(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerCluster with closed client', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GetGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getGameServerCluster(request), expectedError); + }); + }); + + describe('previewCreateGameServerCluster', () => { + it('invokes previewCreateGameServerCluster without error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse() + ); + client.innerApiCalls.previewCreateGameServerCluster = + stubSimpleCall(expectedResponse); + const [response] = await client.previewCreateGameServerCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.previewCreateGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewCreateGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewCreateGameServerCluster without error using callback', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse() + ); + client.innerApiCalls.previewCreateGameServerCluster = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.previewCreateGameServerCluster( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.previewCreateGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewCreateGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewCreateGameServerCluster with error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.previewCreateGameServerCluster = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.previewCreateGameServerCluster(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.previewCreateGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewCreateGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewCreateGameServerCluster with closed client', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.previewCreateGameServerCluster(request), + expectedError + ); + }); + }); + + describe('previewDeleteGameServerCluster', () => { + it('invokes previewDeleteGameServerCluster without error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse() + ); + client.innerApiCalls.previewDeleteGameServerCluster = + stubSimpleCall(expectedResponse); + const [response] = await client.previewDeleteGameServerCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.previewDeleteGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewDeleteGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewDeleteGameServerCluster without error using callback', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse() + ); + client.innerApiCalls.previewDeleteGameServerCluster = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.previewDeleteGameServerCluster( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.previewDeleteGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewDeleteGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewDeleteGameServerCluster with error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.previewDeleteGameServerCluster = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.previewDeleteGameServerCluster(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.previewDeleteGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewDeleteGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewDeleteGameServerCluster with closed client', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.previewDeleteGameServerCluster(request), + expectedError + ); + }); + }); + + describe('previewUpdateGameServerCluster', () => { + it('invokes previewUpdateGameServerCluster without error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest() + ); + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse() + ); + client.innerApiCalls.previewUpdateGameServerCluster = + stubSimpleCall(expectedResponse); + const [response] = await client.previewUpdateGameServerCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.previewUpdateGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewUpdateGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewUpdateGameServerCluster without error using callback', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest() + ); + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse() + ); + client.innerApiCalls.previewUpdateGameServerCluster = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.previewUpdateGameServerCluster( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.previewUpdateGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewUpdateGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewUpdateGameServerCluster with error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest() + ); + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.previewUpdateGameServerCluster = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.previewUpdateGameServerCluster(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.previewUpdateGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewUpdateGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewUpdateGameServerCluster with closed client', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest() + ); + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.previewUpdateGameServerCluster(request), + expectedError + ); + }); + }); + + describe('createGameServerCluster', () => { + it('invokes createGameServerCluster without error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.CreateGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.CreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGameServerCluster = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createGameServerCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGameServerCluster without error using callback', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.CreateGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.CreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGameServerCluster = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createGameServerCluster( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGameServerCluster with call error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.CreateGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.CreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerCluster = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createGameServerCluster(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGameServerCluster with LRO error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.CreateGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.CreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerCluster = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createGameServerCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateGameServerClusterProgress without error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + 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.checkCreateGameServerClusterProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateGameServerClusterProgress with error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + 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.checkCreateGameServerClusterProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteGameServerCluster', () => { + it('invokes deleteGameServerCluster without error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGameServerCluster = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteGameServerCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGameServerCluster without error using callback', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGameServerCluster = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteGameServerCluster( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGameServerCluster with call error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerCluster = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteGameServerCluster(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGameServerCluster with LRO error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerCluster = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteGameServerCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteGameServerClusterProgress without error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + 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.checkDeleteGameServerClusterProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteGameServerClusterProgress with error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + 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.checkDeleteGameServerClusterProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateGameServerCluster', () => { + it('invokes updateGameServerCluster without error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.UpdateGameServerClusterRequest() + ); + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.UpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateGameServerCluster = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateGameServerCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGameServerCluster without error using callback', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.UpdateGameServerClusterRequest() + ); + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.UpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateGameServerCluster = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateGameServerCluster( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGameServerCluster with call error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.UpdateGameServerClusterRequest() + ); + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.UpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerCluster = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateGameServerCluster(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGameServerCluster with LRO error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.UpdateGameServerClusterRequest() + ); + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.UpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerCluster = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateGameServerCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateGameServerCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateGameServerClusterProgress without error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + 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.checkUpdateGameServerClusterProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateGameServerClusterProgress with error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + 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.checkUpdateGameServerClusterProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listGameServerClusters', () => { + it('invokes listGameServerClusters without error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerCluster() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerCluster() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerCluster() + ), + ]; + client.innerApiCalls.listGameServerClusters = + stubSimpleCall(expectedResponse); + const [response] = await client.listGameServerClusters(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listGameServerClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGameServerClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGameServerClusters without error using callback', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerCluster() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerCluster() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerCluster() + ), + ]; + client.innerApiCalls.listGameServerClusters = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listGameServerClusters( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.gaming.v1beta.IGameServerCluster[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listGameServerClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGameServerClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGameServerClusters with error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listGameServerClusters = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listGameServerClusters(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listGameServerClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGameServerClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGameServerClustersStream without error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerCluster() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerCluster() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerCluster() + ), + ]; + client.descriptors.page.listGameServerClusters.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listGameServerClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gaming.v1beta.GameServerCluster[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.gaming.v1beta.GameServerCluster) => { + 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.listGameServerClusters + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listGameServerClusters, request) + ); + assert( + ( + client.descriptors.page.listGameServerClusters + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listGameServerClustersStream with error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listGameServerClusters.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listGameServerClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gaming.v1beta.GameServerCluster[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.gaming.v1beta.GameServerCluster) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listGameServerClusters + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listGameServerClusters, request) + ); + assert( + ( + client.descriptors.page.listGameServerClusters + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGameServerClusters without error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerCluster() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerCluster() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerCluster() + ), + ]; + client.descriptors.page.listGameServerClusters.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.gaming.v1beta.IGameServerCluster[] = + []; + const iterable = client.listGameServerClustersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listGameServerClusters + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listGameServerClusters + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGameServerClusters with error', async () => { + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listGameServerClusters.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listGameServerClustersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.gaming.v1beta.IGameServerCluster[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listGameServerClusters + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listGameServerClusters + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('gameServerCluster', () => { + const fakePath = '/rendered/path/gameServerCluster'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + realm: 'realmValue', + cluster: 'clusterValue', + }; + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.gameServerClusterPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerClusterPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerClusterPath', () => { + const result = client.gameServerClusterPath( + 'projectValue', + 'locationValue', + 'realmValue', + 'clusterValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerClusterName', () => { + const result = client.matchProjectFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerClusterName', () => { + const result = client.matchLocationFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRealmFromGameServerClusterName', () => { + const result = client.matchRealmFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'realmValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchClusterFromGameServerClusterName', () => { + const result = client.matchClusterFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerConfig', () => { + const fakePath = '/rendered/path/gameServerConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + config: 'configValue', + }; + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.gameServerConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerConfigPath', () => { + const result = client.gameServerConfigPath( + 'projectValue', + 'locationValue', + 'deploymentValue', + 'configValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerConfigName', () => { + const result = client.matchProjectFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerConfigName', () => { + const result = client.matchLocationFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerConfigName', () => { + const result = client.matchDeploymentFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConfigFromGameServerConfigName', () => { + const result = client.matchConfigFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'configValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerDeployment', () => { + const fakePath = '/rendered/path/gameServerDeployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.gameServerDeploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerDeploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerDeploymentPath', () => { + const result = client.gameServerDeploymentPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerDeploymentName', () => { + const result = + client.matchProjectFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerDeploymentName', () => { + const result = + client.matchLocationFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerDeploymentName', () => { + const result = + client.matchDeploymentFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerDeploymentRollout', () => { + const fakePath = '/rendered/path/gameServerDeploymentRollout'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.gameServerDeploymentRolloutPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gameServerDeploymentRolloutPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerDeploymentRolloutPath', () => { + const result = client.gameServerDeploymentRolloutPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerDeploymentRolloutName', () => { + const result = + client.matchProjectFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerDeploymentRolloutName', () => { + const result = + client.matchLocationFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerDeploymentRolloutName', () => { + const result = + client.matchDeploymentFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('realm', () => { + const fakePath = '/rendered/path/realm'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + realm: 'realmValue', + }; + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.realmPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.realmPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('realmPath', () => { + const result = client.realmPath( + 'projectValue', + 'locationValue', + 'realmValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.realmPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRealmName', () => { + const result = client.matchProjectFromRealmName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRealmName', () => { + const result = client.matchLocationFromRealmName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRealmFromRealmName', () => { + const result = client.matchRealmFromRealmName(fakePath); + assert.strictEqual(result, 'realmValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-gaming/test/gapic_game_server_configs_service_v1.ts b/packages/google-cloud-gaming/test/gapic_game_server_configs_service_v1.ts new file mode 100644 index 00000000000..0919f345313 --- /dev/null +++ b/packages/google-cloud-gaming/test/gapic_game_server_configs_service_v1.ts @@ -0,0 +1,1566 @@ +// 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 gameserverconfigsserviceModule 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.GameServerConfigsServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.gameServerConfigsServiceStub, undefined); + await client.initialize(); + assert(client.gameServerConfigsServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.gameServerConfigsServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.gameServerConfigsServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + 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 gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + 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('getGameServerConfig', () => { + it('invokes getGameServerConfig without error', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.GetGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerConfig() + ); + client.innerApiCalls.getGameServerConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.getGameServerConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGameServerConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerConfig without error using callback', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.GetGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerConfig() + ); + client.innerApiCalls.getGameServerConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGameServerConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1.IGameServerConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGameServerConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerConfig with error', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.GetGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getGameServerConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getGameServerConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getGameServerConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerConfig with closed client', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.GetGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getGameServerConfig(request), expectedError); + }); + }); + + describe('createGameServerConfig', () => { + it('invokes createGameServerConfig without error', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.CreateGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.CreateGameServerConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGameServerConfig = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createGameServerConfig(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createGameServerConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGameServerConfig without error using callback', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.CreateGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.CreateGameServerConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGameServerConfig = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createGameServerConfig( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.gaming.v1.IGameServerConfig, + protos.google.cloud.gaming.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gaming.v1.IGameServerConfig, + protos.google.cloud.gaming.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createGameServerConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGameServerConfig with call error', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.CreateGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.CreateGameServerConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerConfig = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createGameServerConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createGameServerConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGameServerConfig with LRO error', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.CreateGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.CreateGameServerConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerConfig = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createGameServerConfig(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createGameServerConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateGameServerConfigProgress without error', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + 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.checkCreateGameServerConfigProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateGameServerConfigProgress with error', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + 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.checkCreateGameServerConfigProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteGameServerConfig', () => { + it('invokes deleteGameServerConfig without error', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.DeleteGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.DeleteGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGameServerConfig = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteGameServerConfig(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteGameServerConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGameServerConfig without error using callback', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.DeleteGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.DeleteGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGameServerConfig = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteGameServerConfig( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteGameServerConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGameServerConfig with call error', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.DeleteGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.DeleteGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerConfig = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteGameServerConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteGameServerConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGameServerConfig with LRO error', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.DeleteGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.DeleteGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerConfig = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteGameServerConfig(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteGameServerConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteGameServerConfigProgress without error', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + 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.checkDeleteGameServerConfigProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteGameServerConfigProgress with error', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + 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.checkDeleteGameServerConfigProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listGameServerConfigs', () => { + it('invokes listGameServerConfigs without error', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListGameServerConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerConfig() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerConfig() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerConfig() + ), + ]; + client.innerApiCalls.listGameServerConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.listGameServerConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listGameServerConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGameServerConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGameServerConfigs without error using callback', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListGameServerConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerConfig() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerConfig() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerConfig() + ), + ]; + client.innerApiCalls.listGameServerConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listGameServerConfigs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1.IGameServerConfig[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listGameServerConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGameServerConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGameServerConfigs with error', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListGameServerConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listGameServerConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listGameServerConfigs(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listGameServerConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGameServerConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGameServerConfigsStream without error', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListGameServerConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerConfig() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerConfig() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerConfig() + ), + ]; + client.descriptors.page.listGameServerConfigs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listGameServerConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gaming.v1.GameServerConfig[] = []; + stream.on( + 'data', + (response: protos.google.cloud.gaming.v1.GameServerConfig) => { + 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.listGameServerConfigs + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listGameServerConfigs, request) + ); + assert( + ( + client.descriptors.page.listGameServerConfigs + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listGameServerConfigsStream with error', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListGameServerConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listGameServerConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listGameServerConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gaming.v1.GameServerConfig[] = []; + stream.on( + 'data', + (response: protos.google.cloud.gaming.v1.GameServerConfig) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listGameServerConfigs + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listGameServerConfigs, request) + ); + assert( + ( + client.descriptors.page.listGameServerConfigs + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGameServerConfigs without error', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListGameServerConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerConfig() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerConfig() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerConfig() + ), + ]; + client.descriptors.page.listGameServerConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.gaming.v1.IGameServerConfig[] = []; + const iterable = client.listGameServerConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listGameServerConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listGameServerConfigs + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGameServerConfigs with error', async () => { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListGameServerConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listGameServerConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listGameServerConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.gaming.v1.IGameServerConfig[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listGameServerConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listGameServerConfigs + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('gameServerCluster', () => { + const fakePath = '/rendered/path/gameServerCluster'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + realm: 'realmValue', + cluster: 'clusterValue', + }; + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.gameServerClusterPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerClusterPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerClusterPath', () => { + const result = client.gameServerClusterPath( + 'projectValue', + 'locationValue', + 'realmValue', + 'clusterValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerClusterName', () => { + const result = client.matchProjectFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerClusterName', () => { + const result = client.matchLocationFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRealmFromGameServerClusterName', () => { + const result = client.matchRealmFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'realmValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchClusterFromGameServerClusterName', () => { + const result = client.matchClusterFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerConfig', () => { + const fakePath = '/rendered/path/gameServerConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + config: 'configValue', + }; + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.gameServerConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerConfigPath', () => { + const result = client.gameServerConfigPath( + 'projectValue', + 'locationValue', + 'deploymentValue', + 'configValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerConfigName', () => { + const result = client.matchProjectFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerConfigName', () => { + const result = client.matchLocationFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerConfigName', () => { + const result = client.matchDeploymentFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConfigFromGameServerConfigName', () => { + const result = client.matchConfigFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'configValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerDeployment', () => { + const fakePath = '/rendered/path/gameServerDeployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.gameServerDeploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerDeploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerDeploymentPath', () => { + const result = client.gameServerDeploymentPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerDeploymentName', () => { + const result = + client.matchProjectFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerDeploymentName', () => { + const result = + client.matchLocationFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerDeploymentName', () => { + const result = + client.matchDeploymentFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerDeploymentRollout', () => { + const fakePath = '/rendered/path/gameServerDeploymentRollout'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.gameServerDeploymentRolloutPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gameServerDeploymentRolloutPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerDeploymentRolloutPath', () => { + const result = client.gameServerDeploymentRolloutPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerDeploymentRolloutName', () => { + const result = + client.matchProjectFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerDeploymentRolloutName', () => { + const result = + client.matchLocationFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerDeploymentRolloutName', () => { + const result = + client.matchDeploymentFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('realm', () => { + const fakePath = '/rendered/path/realm'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + realm: 'realmValue', + }; + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.realmPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.realmPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('realmPath', () => { + const result = client.realmPath( + 'projectValue', + 'locationValue', + 'realmValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.realmPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRealmName', () => { + const result = client.matchProjectFromRealmName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRealmName', () => { + const result = client.matchLocationFromRealmName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRealmFromRealmName', () => { + const result = client.matchRealmFromRealmName(fakePath); + assert.strictEqual(result, 'realmValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-gaming/test/gapic_game_server_configs_service_v1beta.ts b/packages/google-cloud-gaming/test/gapic_game_server_configs_service_v1beta.ts new file mode 100644 index 00000000000..548bd600681 --- /dev/null +++ b/packages/google-cloud-gaming/test/gapic_game_server_configs_service_v1beta.ts @@ -0,0 +1,1641 @@ +// 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 gameserverconfigsserviceModule 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('v1beta.GameServerConfigsServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient + .port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.gameServerConfigsServiceStub, undefined); + await client.initialize(); + assert(client.gameServerConfigsServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.gameServerConfigsServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.gameServerConfigsServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + 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 gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + 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('getGameServerConfig', () => { + it('invokes getGameServerConfig without error', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GetGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerConfig() + ); + client.innerApiCalls.getGameServerConfig = + stubSimpleCall(expectedResponse); + const [response] = await client.getGameServerConfig(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGameServerConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerConfig without error using callback', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GetGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerConfig() + ); + client.innerApiCalls.getGameServerConfig = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGameServerConfig( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1beta.IGameServerConfig | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGameServerConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerConfig with error', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GetGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getGameServerConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getGameServerConfig(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getGameServerConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerConfig with closed client', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GetGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getGameServerConfig(request), expectedError); + }); + }); + + describe('createGameServerConfig', () => { + it('invokes createGameServerConfig without error', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.CreateGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.CreateGameServerConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGameServerConfig = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createGameServerConfig(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createGameServerConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGameServerConfig without error using callback', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.CreateGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.CreateGameServerConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGameServerConfig = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createGameServerConfig( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createGameServerConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGameServerConfig with call error', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.CreateGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.CreateGameServerConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerConfig = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createGameServerConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createGameServerConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGameServerConfig with LRO error', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.CreateGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.CreateGameServerConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerConfig = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createGameServerConfig(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createGameServerConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateGameServerConfigProgress without error', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + 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.checkCreateGameServerConfigProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateGameServerConfigProgress with error', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + 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.checkCreateGameServerConfigProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteGameServerConfig', () => { + it('invokes deleteGameServerConfig without error', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGameServerConfig = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteGameServerConfig(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteGameServerConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGameServerConfig without error using callback', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGameServerConfig = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteGameServerConfig( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteGameServerConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGameServerConfig with call error', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerConfig = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteGameServerConfig(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteGameServerConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGameServerConfig with LRO error', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerConfig = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteGameServerConfig(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteGameServerConfig as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerConfig as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteGameServerConfigProgress without error', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + 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.checkDeleteGameServerConfigProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteGameServerConfigProgress with error', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + 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.checkDeleteGameServerConfigProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listGameServerConfigs', () => { + it('invokes listGameServerConfigs without error', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerConfig() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerConfig() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerConfig() + ), + ]; + client.innerApiCalls.listGameServerConfigs = + stubSimpleCall(expectedResponse); + const [response] = await client.listGameServerConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listGameServerConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGameServerConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGameServerConfigs without error using callback', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerConfig() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerConfig() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerConfig() + ), + ]; + client.innerApiCalls.listGameServerConfigs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listGameServerConfigs( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.gaming.v1beta.IGameServerConfig[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listGameServerConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGameServerConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGameServerConfigs with error', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listGameServerConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listGameServerConfigs(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listGameServerConfigs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGameServerConfigs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGameServerConfigsStream without error', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerConfig() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerConfig() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerConfig() + ), + ]; + client.descriptors.page.listGameServerConfigs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listGameServerConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gaming.v1beta.GameServerConfig[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.gaming.v1beta.GameServerConfig) => { + 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.listGameServerConfigs + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listGameServerConfigs, request) + ); + assert( + ( + client.descriptors.page.listGameServerConfigs + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listGameServerConfigsStream with error', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listGameServerConfigs.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listGameServerConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gaming.v1beta.GameServerConfig[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.gaming.v1beta.GameServerConfig) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listGameServerConfigs + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listGameServerConfigs, request) + ); + assert( + ( + client.descriptors.page.listGameServerConfigs + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGameServerConfigs without error', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerConfig() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerConfig() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerConfig() + ), + ]; + client.descriptors.page.listGameServerConfigs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.gaming.v1beta.IGameServerConfig[] = + []; + const iterable = client.listGameServerConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listGameServerConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listGameServerConfigs + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGameServerConfigs with error', async () => { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerConfigsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listGameServerConfigs.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listGameServerConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.gaming.v1beta.IGameServerConfig[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listGameServerConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listGameServerConfigs + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('gameServerCluster', () => { + const fakePath = '/rendered/path/gameServerCluster'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + realm: 'realmValue', + cluster: 'clusterValue', + }; + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.gameServerClusterPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerClusterPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerClusterPath', () => { + const result = client.gameServerClusterPath( + 'projectValue', + 'locationValue', + 'realmValue', + 'clusterValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerClusterName', () => { + const result = client.matchProjectFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerClusterName', () => { + const result = client.matchLocationFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRealmFromGameServerClusterName', () => { + const result = client.matchRealmFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'realmValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchClusterFromGameServerClusterName', () => { + const result = client.matchClusterFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerConfig', () => { + const fakePath = '/rendered/path/gameServerConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + config: 'configValue', + }; + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.gameServerConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerConfigPath', () => { + const result = client.gameServerConfigPath( + 'projectValue', + 'locationValue', + 'deploymentValue', + 'configValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerConfigName', () => { + const result = client.matchProjectFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerConfigName', () => { + const result = client.matchLocationFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerConfigName', () => { + const result = client.matchDeploymentFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConfigFromGameServerConfigName', () => { + const result = client.matchConfigFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'configValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerDeployment', () => { + const fakePath = '/rendered/path/gameServerDeployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.gameServerDeploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerDeploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerDeploymentPath', () => { + const result = client.gameServerDeploymentPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerDeploymentName', () => { + const result = + client.matchProjectFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerDeploymentName', () => { + const result = + client.matchLocationFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerDeploymentName', () => { + const result = + client.matchDeploymentFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerDeploymentRollout', () => { + const fakePath = '/rendered/path/gameServerDeploymentRollout'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.gameServerDeploymentRolloutPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gameServerDeploymentRolloutPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerDeploymentRolloutPath', () => { + const result = client.gameServerDeploymentRolloutPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerDeploymentRolloutName', () => { + const result = + client.matchProjectFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerDeploymentRolloutName', () => { + const result = + client.matchLocationFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerDeploymentRolloutName', () => { + const result = + client.matchDeploymentFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('realm', () => { + const fakePath = '/rendered/path/realm'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + realm: 'realmValue', + }; + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.realmPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.realmPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('realmPath', () => { + const result = client.realmPath( + 'projectValue', + 'locationValue', + 'realmValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.realmPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRealmName', () => { + const result = client.matchProjectFromRealmName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRealmName', () => { + const result = client.matchLocationFromRealmName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRealmFromRealmName', () => { + const result = client.matchRealmFromRealmName(fakePath); + assert.strictEqual(result, 'realmValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-gaming/test/gapic_game_server_deployments_service_v1.ts b/packages/google-cloud-gaming/test/gapic_game_server_deployments_service_v1.ts new file mode 100644 index 00000000000..7a7ca925dff --- /dev/null +++ b/packages/google-cloud-gaming/test/gapic_game_server_deployments_service_v1.ts @@ -0,0 +1,2535 @@ +// 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 gameserverdeploymentsserviceModule 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.GameServerDeploymentsServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient + .port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.gameServerDeploymentsServiceStub, undefined); + await client.initialize(); + assert(client.gameServerDeploymentsServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.gameServerDeploymentsServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.gameServerDeploymentsServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + 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 gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + 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('getGameServerDeployment', () => { + it('invokes getGameServerDeployment without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.GetGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerDeployment() + ); + client.innerApiCalls.getGameServerDeployment = + stubSimpleCall(expectedResponse); + const [response] = await client.getGameServerDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerDeployment without error using callback', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.GetGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerDeployment() + ); + client.innerApiCalls.getGameServerDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGameServerDeployment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1.IGameServerDeployment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerDeployment with error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.GetGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getGameServerDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getGameServerDeployment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerDeployment with closed client', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.GetGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getGameServerDeployment(request), + expectedError + ); + }); + }); + + describe('getGameServerDeploymentRollout', () => { + it('invokes getGameServerDeploymentRollout without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerDeploymentRollout() + ); + client.innerApiCalls.getGameServerDeploymentRollout = + stubSimpleCall(expectedResponse); + const [response] = await client.getGameServerDeploymentRollout(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGameServerDeploymentRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerDeploymentRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerDeploymentRollout without error using callback', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerDeploymentRollout() + ); + client.innerApiCalls.getGameServerDeploymentRollout = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGameServerDeploymentRollout( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1.IGameServerDeploymentRollout | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGameServerDeploymentRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerDeploymentRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerDeploymentRollout with error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getGameServerDeploymentRollout = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getGameServerDeploymentRollout(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getGameServerDeploymentRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerDeploymentRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerDeploymentRollout with closed client', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getGameServerDeploymentRollout(request), + expectedError + ); + }); + }); + + describe('previewGameServerDeploymentRollout', () => { + it('invokes previewGameServerDeploymentRollout without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest() + ); + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse() + ); + client.innerApiCalls.previewGameServerDeploymentRollout = + stubSimpleCall(expectedResponse); + const [response] = await client.previewGameServerDeploymentRollout( + request + ); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewGameServerDeploymentRollout without error using callback', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest() + ); + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse() + ); + client.innerApiCalls.previewGameServerDeploymentRollout = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.previewGameServerDeploymentRollout( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewGameServerDeploymentRollout with error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest() + ); + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.previewGameServerDeploymentRollout = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.previewGameServerDeploymentRollout(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewGameServerDeploymentRollout with closed client', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest() + ); + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.previewGameServerDeploymentRollout(request), + expectedError + ); + }); + }); + + describe('fetchDeploymentState', () => { + it('invokes fetchDeploymentState without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.FetchDeploymentStateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.FetchDeploymentStateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1.FetchDeploymentStateResponse() + ); + client.innerApiCalls.fetchDeploymentState = + stubSimpleCall(expectedResponse); + const [response] = await client.fetchDeploymentState(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchDeploymentState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchDeploymentState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchDeploymentState without error using callback', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.FetchDeploymentStateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.FetchDeploymentStateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1.FetchDeploymentStateResponse() + ); + client.innerApiCalls.fetchDeploymentState = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchDeploymentState( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1.IFetchDeploymentStateResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchDeploymentState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchDeploymentState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchDeploymentState with error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.FetchDeploymentStateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.FetchDeploymentStateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchDeploymentState = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.fetchDeploymentState(request), expectedError); + const actualRequest = ( + client.innerApiCalls.fetchDeploymentState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchDeploymentState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchDeploymentState with closed client', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.FetchDeploymentStateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.FetchDeploymentStateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.fetchDeploymentState(request), expectedError); + }); + }); + + describe('createGameServerDeployment', () => { + it('invokes createGameServerDeployment without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.CreateGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.CreateGameServerDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGameServerDeployment = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createGameServerDeployment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGameServerDeployment without error using callback', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.CreateGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.CreateGameServerDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGameServerDeployment = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createGameServerDeployment( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGameServerDeployment with call error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.CreateGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.CreateGameServerDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerDeployment = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createGameServerDeployment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGameServerDeployment with LRO error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.CreateGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.CreateGameServerDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerDeployment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createGameServerDeployment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateGameServerDeploymentProgress without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + 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.checkCreateGameServerDeploymentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateGameServerDeploymentProgress with error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + 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.checkCreateGameServerDeploymentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteGameServerDeployment', () => { + it('invokes deleteGameServerDeployment without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGameServerDeployment = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteGameServerDeployment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGameServerDeployment without error using callback', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGameServerDeployment = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteGameServerDeployment( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGameServerDeployment with call error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerDeployment = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteGameServerDeployment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGameServerDeployment with LRO error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerDeployment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteGameServerDeployment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteGameServerDeploymentProgress without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + 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.checkDeleteGameServerDeploymentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteGameServerDeploymentProgress with error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + 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.checkDeleteGameServerDeploymentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateGameServerDeployment', () => { + it('invokes updateGameServerDeployment without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.UpdateGameServerDeploymentRequest() + ); + request.gameServerDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.UpdateGameServerDeploymentRequest', + ['gameServerDeployment', 'name'] + ); + request.gameServerDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_deployment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateGameServerDeployment = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateGameServerDeployment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGameServerDeployment without error using callback', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.UpdateGameServerDeploymentRequest() + ); + request.gameServerDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.UpdateGameServerDeploymentRequest', + ['gameServerDeployment', 'name'] + ); + request.gameServerDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_deployment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateGameServerDeployment = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateGameServerDeployment( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGameServerDeployment with call error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.UpdateGameServerDeploymentRequest() + ); + request.gameServerDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.UpdateGameServerDeploymentRequest', + ['gameServerDeployment', 'name'] + ); + request.gameServerDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_deployment.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerDeployment = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateGameServerDeployment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGameServerDeployment with LRO error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.UpdateGameServerDeploymentRequest() + ); + request.gameServerDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.UpdateGameServerDeploymentRequest', + ['gameServerDeployment', 'name'] + ); + request.gameServerDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_deployment.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerDeployment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateGameServerDeployment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateGameServerDeploymentProgress without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + 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.checkUpdateGameServerDeploymentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateGameServerDeploymentProgress with error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + 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.checkUpdateGameServerDeploymentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateGameServerDeploymentRollout', () => { + it('invokes updateGameServerDeploymentRollout without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest() + ); + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateGameServerDeploymentRollout = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateGameServerDeploymentRollout( + request + ); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGameServerDeploymentRollout without error using callback', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest() + ); + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateGameServerDeploymentRollout = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateGameServerDeploymentRollout( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gaming.v1.IGameServerDeployment, + protos.google.cloud.gaming.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGameServerDeploymentRollout with call error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest() + ); + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerDeploymentRollout = + stubLongRunningCall(undefined, expectedError); + await assert.rejects( + client.updateGameServerDeploymentRollout(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGameServerDeploymentRollout with LRO error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest() + ); + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerDeploymentRollout = + stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateGameServerDeploymentRollout( + request + ); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateGameServerDeploymentRolloutProgress without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + 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.checkUpdateGameServerDeploymentRolloutProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateGameServerDeploymentRolloutProgress with error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + 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.checkUpdateGameServerDeploymentRolloutProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listGameServerDeployments', () => { + it('invokes listGameServerDeployments without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListGameServerDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerDeployment() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerDeployment() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerDeployment() + ), + ]; + client.innerApiCalls.listGameServerDeployments = + stubSimpleCall(expectedResponse); + const [response] = await client.listGameServerDeployments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listGameServerDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGameServerDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGameServerDeployments without error using callback', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListGameServerDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerDeployment() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerDeployment() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerDeployment() + ), + ]; + client.innerApiCalls.listGameServerDeployments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listGameServerDeployments( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.gaming.v1.IGameServerDeployment[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listGameServerDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGameServerDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGameServerDeployments with error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListGameServerDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listGameServerDeployments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listGameServerDeployments(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listGameServerDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGameServerDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGameServerDeploymentsStream without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListGameServerDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerDeployment() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerDeployment() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerDeployment() + ), + ]; + client.descriptors.page.listGameServerDeployments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listGameServerDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gaming.v1.GameServerDeployment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.gaming.v1.GameServerDeployment) => { + 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.listGameServerDeployments + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listGameServerDeployments, request) + ); + assert( + ( + client.descriptors.page.listGameServerDeployments + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listGameServerDeploymentsStream with error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListGameServerDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listGameServerDeployments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listGameServerDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gaming.v1.GameServerDeployment[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.gaming.v1.GameServerDeployment) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listGameServerDeployments + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listGameServerDeployments, request) + ); + assert( + ( + client.descriptors.page.listGameServerDeployments + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGameServerDeployments without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListGameServerDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerDeployment() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerDeployment() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1.GameServerDeployment() + ), + ]; + client.descriptors.page.listGameServerDeployments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.gaming.v1.IGameServerDeployment[] = + []; + const iterable = client.listGameServerDeploymentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listGameServerDeployments + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listGameServerDeployments + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGameServerDeployments with error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListGameServerDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listGameServerDeployments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listGameServerDeploymentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.gaming.v1.IGameServerDeployment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listGameServerDeployments + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listGameServerDeployments + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('gameServerCluster', () => { + const fakePath = '/rendered/path/gameServerCluster'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + realm: 'realmValue', + cluster: 'clusterValue', + }; + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.gameServerClusterPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerClusterPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerClusterPath', () => { + const result = client.gameServerClusterPath( + 'projectValue', + 'locationValue', + 'realmValue', + 'clusterValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerClusterName', () => { + const result = client.matchProjectFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerClusterName', () => { + const result = client.matchLocationFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRealmFromGameServerClusterName', () => { + const result = client.matchRealmFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'realmValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchClusterFromGameServerClusterName', () => { + const result = client.matchClusterFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerConfig', () => { + const fakePath = '/rendered/path/gameServerConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + config: 'configValue', + }; + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.gameServerConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerConfigPath', () => { + const result = client.gameServerConfigPath( + 'projectValue', + 'locationValue', + 'deploymentValue', + 'configValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerConfigName', () => { + const result = client.matchProjectFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerConfigName', () => { + const result = client.matchLocationFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerConfigName', () => { + const result = client.matchDeploymentFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConfigFromGameServerConfigName', () => { + const result = client.matchConfigFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'configValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerDeployment', () => { + const fakePath = '/rendered/path/gameServerDeployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.gameServerDeploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerDeploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerDeploymentPath', () => { + const result = client.gameServerDeploymentPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerDeploymentName', () => { + const result = + client.matchProjectFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerDeploymentName', () => { + const result = + client.matchLocationFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerDeploymentName', () => { + const result = + client.matchDeploymentFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerDeploymentRollout', () => { + const fakePath = '/rendered/path/gameServerDeploymentRollout'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.gameServerDeploymentRolloutPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gameServerDeploymentRolloutPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerDeploymentRolloutPath', () => { + const result = client.gameServerDeploymentRolloutPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerDeploymentRolloutName', () => { + const result = + client.matchProjectFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerDeploymentRolloutName', () => { + const result = + client.matchLocationFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerDeploymentRolloutName', () => { + const result = + client.matchDeploymentFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('realm', () => { + const fakePath = '/rendered/path/realm'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + realm: 'realmValue', + }; + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.realmPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.realmPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('realmPath', () => { + const result = client.realmPath( + 'projectValue', + 'locationValue', + 'realmValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.realmPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRealmName', () => { + const result = client.matchProjectFromRealmName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRealmName', () => { + const result = client.matchLocationFromRealmName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRealmFromRealmName', () => { + const result = client.matchRealmFromRealmName(fakePath); + assert.strictEqual(result, 'realmValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-gaming/test/gapic_game_server_deployments_service_v1beta.ts b/packages/google-cloud-gaming/test/gapic_game_server_deployments_service_v1beta.ts new file mode 100644 index 00000000000..c06377604e5 --- /dev/null +++ b/packages/google-cloud-gaming/test/gapic_game_server_deployments_service_v1beta.ts @@ -0,0 +1,2539 @@ +// 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 gameserverdeploymentsserviceModule 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('v1beta.GameServerDeploymentsServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + gameserverdeploymentsserviceModule.v1beta + .GameServerDeploymentsServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + gameserverdeploymentsserviceModule.v1beta + .GameServerDeploymentsServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + gameserverdeploymentsserviceModule.v1beta + .GameServerDeploymentsServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.gameServerDeploymentsServiceStub, undefined); + await client.initialize(); + assert(client.gameServerDeploymentsServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + assert(client.gameServerDeploymentsServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.gameServerDeploymentsServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + 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 gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + 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('getGameServerDeployment', () => { + it('invokes getGameServerDeployment without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerDeployment() + ); + client.innerApiCalls.getGameServerDeployment = + stubSimpleCall(expectedResponse); + const [response] = await client.getGameServerDeployment(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerDeployment without error using callback', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerDeployment() + ); + client.innerApiCalls.getGameServerDeployment = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGameServerDeployment( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1beta.IGameServerDeployment | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerDeployment with error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getGameServerDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getGameServerDeployment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerDeployment with closed client', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getGameServerDeployment(request), + expectedError + ); + }); + }); + + describe('getGameServerDeploymentRollout', () => { + it('invokes getGameServerDeploymentRollout without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerDeploymentRollout() + ); + client.innerApiCalls.getGameServerDeploymentRollout = + stubSimpleCall(expectedResponse); + const [response] = await client.getGameServerDeploymentRollout(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGameServerDeploymentRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerDeploymentRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerDeploymentRollout without error using callback', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerDeploymentRollout() + ); + client.innerApiCalls.getGameServerDeploymentRollout = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getGameServerDeploymentRollout( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1beta.IGameServerDeploymentRollout | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getGameServerDeploymentRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerDeploymentRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerDeploymentRollout with error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getGameServerDeploymentRollout = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getGameServerDeploymentRollout(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getGameServerDeploymentRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getGameServerDeploymentRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getGameServerDeploymentRollout with closed client', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getGameServerDeploymentRollout(request), + expectedError + ); + }); + }); + + describe('previewGameServerDeploymentRollout', () => { + it('invokes previewGameServerDeploymentRollout without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest() + ); + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse() + ); + client.innerApiCalls.previewGameServerDeploymentRollout = + stubSimpleCall(expectedResponse); + const [response] = await client.previewGameServerDeploymentRollout( + request + ); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewGameServerDeploymentRollout without error using callback', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest() + ); + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse() + ); + client.innerApiCalls.previewGameServerDeploymentRollout = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.previewGameServerDeploymentRollout( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewGameServerDeploymentRollout with error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest() + ); + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.previewGameServerDeploymentRollout = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.previewGameServerDeploymentRollout(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewGameServerDeploymentRollout with closed client', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest() + ); + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.previewGameServerDeploymentRollout(request), + expectedError + ); + }); + }); + + describe('fetchDeploymentState', () => { + it('invokes fetchDeploymentState without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.FetchDeploymentStateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.FetchDeploymentStateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.FetchDeploymentStateResponse() + ); + client.innerApiCalls.fetchDeploymentState = + stubSimpleCall(expectedResponse); + const [response] = await client.fetchDeploymentState(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchDeploymentState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchDeploymentState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchDeploymentState without error using callback', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.FetchDeploymentStateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.FetchDeploymentStateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.FetchDeploymentStateResponse() + ); + client.innerApiCalls.fetchDeploymentState = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchDeploymentState( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.fetchDeploymentState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchDeploymentState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchDeploymentState with error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.FetchDeploymentStateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.FetchDeploymentStateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchDeploymentState = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.fetchDeploymentState(request), expectedError); + const actualRequest = ( + client.innerApiCalls.fetchDeploymentState as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.fetchDeploymentState as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchDeploymentState with closed client', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.FetchDeploymentStateRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.FetchDeploymentStateRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.fetchDeploymentState(request), expectedError); + }); + }); + + describe('createGameServerDeployment', () => { + it('invokes createGameServerDeployment without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGameServerDeployment = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createGameServerDeployment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGameServerDeployment without error using callback', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createGameServerDeployment = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createGameServerDeployment( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGameServerDeployment with call error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerDeployment = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createGameServerDeployment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createGameServerDeployment with LRO error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerDeployment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createGameServerDeployment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateGameServerDeploymentProgress without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + 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.checkCreateGameServerDeploymentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateGameServerDeploymentProgress with error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + 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.checkCreateGameServerDeploymentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteGameServerDeployment', () => { + it('invokes deleteGameServerDeployment without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGameServerDeployment = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteGameServerDeployment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGameServerDeployment without error using callback', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteGameServerDeployment = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteGameServerDeployment( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGameServerDeployment with call error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerDeployment = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteGameServerDeployment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteGameServerDeployment with LRO error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerDeployment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteGameServerDeployment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteGameServerDeploymentProgress without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + 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.checkDeleteGameServerDeploymentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteGameServerDeploymentProgress with error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + 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.checkDeleteGameServerDeploymentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateGameServerDeployment', () => { + it('invokes updateGameServerDeployment without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest() + ); + request.gameServerDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest', + ['gameServerDeployment', 'name'] + ); + request.gameServerDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_deployment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateGameServerDeployment = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateGameServerDeployment(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGameServerDeployment without error using callback', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest() + ); + request.gameServerDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest', + ['gameServerDeployment', 'name'] + ); + request.gameServerDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_deployment.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateGameServerDeployment = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateGameServerDeployment( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGameServerDeployment with call error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest() + ); + request.gameServerDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest', + ['gameServerDeployment', 'name'] + ); + request.gameServerDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_deployment.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerDeployment = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateGameServerDeployment(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGameServerDeployment with LRO error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest() + ); + request.gameServerDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest', + ['gameServerDeployment', 'name'] + ); + request.gameServerDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_deployment.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerDeployment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateGameServerDeployment(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateGameServerDeployment as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerDeployment as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateGameServerDeploymentProgress without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + 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.checkUpdateGameServerDeploymentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateGameServerDeploymentProgress with error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + 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.checkUpdateGameServerDeploymentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateGameServerDeploymentRollout', () => { + it('invokes updateGameServerDeploymentRollout without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest() + ); + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateGameServerDeploymentRollout = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateGameServerDeploymentRollout( + request + ); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGameServerDeploymentRollout without error using callback', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest() + ); + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateGameServerDeploymentRollout = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateGameServerDeploymentRollout( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGameServerDeploymentRollout with call error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest() + ); + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerDeploymentRollout = + stubLongRunningCall(undefined, expectedError); + await assert.rejects( + client.updateGameServerDeploymentRollout(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateGameServerDeploymentRollout with LRO error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest() + ); + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerDeploymentRollout = + stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateGameServerDeploymentRollout( + request + ); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateGameServerDeploymentRolloutProgress without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + 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.checkUpdateGameServerDeploymentRolloutProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateGameServerDeploymentRolloutProgress with error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + 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.checkUpdateGameServerDeploymentRolloutProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listGameServerDeployments', () => { + it('invokes listGameServerDeployments without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerDeployment() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerDeployment() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerDeployment() + ), + ]; + client.innerApiCalls.listGameServerDeployments = + stubSimpleCall(expectedResponse); + const [response] = await client.listGameServerDeployments(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listGameServerDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGameServerDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGameServerDeployments without error using callback', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerDeployment() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerDeployment() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerDeployment() + ), + ]; + client.innerApiCalls.listGameServerDeployments = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listGameServerDeployments( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.gaming.v1beta.IGameServerDeployment[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listGameServerDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGameServerDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGameServerDeployments with error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listGameServerDeployments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listGameServerDeployments(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listGameServerDeployments as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listGameServerDeployments as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listGameServerDeploymentsStream without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerDeployment() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerDeployment() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerDeployment() + ), + ]; + client.descriptors.page.listGameServerDeployments.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listGameServerDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gaming.v1beta.GameServerDeployment[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.gaming.v1beta.GameServerDeployment + ) => { + 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.listGameServerDeployments + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listGameServerDeployments, request) + ); + assert( + ( + client.descriptors.page.listGameServerDeployments + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listGameServerDeploymentsStream with error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listGameServerDeployments.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listGameServerDeploymentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gaming.v1beta.GameServerDeployment[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.gaming.v1beta.GameServerDeployment + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listGameServerDeployments + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listGameServerDeployments, request) + ); + assert( + ( + client.descriptors.page.listGameServerDeployments + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGameServerDeployments without error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerDeployment() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerDeployment() + ), + generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GameServerDeployment() + ), + ]; + client.descriptors.page.listGameServerDeployments.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.gaming.v1beta.IGameServerDeployment[] = + []; + const iterable = client.listGameServerDeploymentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listGameServerDeployments + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listGameServerDeployments + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listGameServerDeployments with error', async () => { + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listGameServerDeployments.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listGameServerDeploymentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.gaming.v1beta.IGameServerDeployment[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listGameServerDeployments + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listGameServerDeployments + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('gameServerCluster', () => { + const fakePath = '/rendered/path/gameServerCluster'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + realm: 'realmValue', + cluster: 'clusterValue', + }; + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.gameServerClusterPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerClusterPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerClusterPath', () => { + const result = client.gameServerClusterPath( + 'projectValue', + 'locationValue', + 'realmValue', + 'clusterValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerClusterName', () => { + const result = client.matchProjectFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerClusterName', () => { + const result = client.matchLocationFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRealmFromGameServerClusterName', () => { + const result = client.matchRealmFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'realmValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchClusterFromGameServerClusterName', () => { + const result = client.matchClusterFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerConfig', () => { + const fakePath = '/rendered/path/gameServerConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + config: 'configValue', + }; + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.gameServerConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerConfigPath', () => { + const result = client.gameServerConfigPath( + 'projectValue', + 'locationValue', + 'deploymentValue', + 'configValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerConfigName', () => { + const result = client.matchProjectFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerConfigName', () => { + const result = client.matchLocationFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerConfigName', () => { + const result = client.matchDeploymentFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConfigFromGameServerConfigName', () => { + const result = client.matchConfigFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'configValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerDeployment', () => { + const fakePath = '/rendered/path/gameServerDeployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.gameServerDeploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerDeploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerDeploymentPath', () => { + const result = client.gameServerDeploymentPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerDeploymentName', () => { + const result = + client.matchProjectFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerDeploymentName', () => { + const result = + client.matchLocationFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerDeploymentName', () => { + const result = + client.matchDeploymentFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerDeploymentRollout', () => { + const fakePath = '/rendered/path/gameServerDeploymentRollout'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.gameServerDeploymentRolloutPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gameServerDeploymentRolloutPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerDeploymentRolloutPath', () => { + const result = client.gameServerDeploymentRolloutPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerDeploymentRolloutName', () => { + const result = + client.matchProjectFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerDeploymentRolloutName', () => { + const result = + client.matchLocationFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerDeploymentRolloutName', () => { + const result = + client.matchDeploymentFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('realm', () => { + const fakePath = '/rendered/path/realm'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + realm: 'realmValue', + }; + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.realmPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.realmPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('realmPath', () => { + const result = client.realmPath( + 'projectValue', + 'locationValue', + 'realmValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.realmPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRealmName', () => { + const result = client.matchProjectFromRealmName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRealmName', () => { + const result = client.matchLocationFromRealmName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRealmFromRealmName', () => { + const result = client.matchRealmFromRealmName(fakePath); + assert.strictEqual(result, 'realmValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts b/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts new file mode 100644 index 00000000000..c715b148268 --- /dev/null +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts @@ -0,0 +1,1789 @@ +// 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 realmsserviceModule 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.RealmsServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + realmsserviceModule.v1.RealmsServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + realmsserviceModule.v1.RealmsServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = realmsserviceModule.v1.RealmsServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new realmsserviceModule.v1.RealmsServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.realmsServiceStub, undefined); + await client.initialize(); + assert(client.realmsServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.realmsServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.realmsServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new realmsserviceModule.v1.RealmsServiceClient({ + 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 realmsserviceModule.v1.RealmsServiceClient({ + 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('getRealm', () => { + it('invokes getRealm without error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.GetRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetRealmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1.Realm() + ); + client.innerApiCalls.getRealm = stubSimpleCall(expectedResponse); + const [response] = await client.getRealm(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRealm without error using callback', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.GetRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetRealmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1.Realm() + ); + client.innerApiCalls.getRealm = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRealm( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1.IRealm | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRealm with error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.GetRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetRealmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getRealm = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getRealm(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRealm with closed client', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.GetRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetRealmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getRealm(request), expectedError); + }); + }); + + describe('previewRealmUpdate', () => { + it('invokes previewRealmUpdate without error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewRealmUpdateRequest() + ); + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewRealmUpdateRequest', + ['realm', 'name'] + ); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewRealmUpdateResponse() + ); + client.innerApiCalls.previewRealmUpdate = + stubSimpleCall(expectedResponse); + const [response] = await client.previewRealmUpdate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.previewRealmUpdate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewRealmUpdate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewRealmUpdate without error using callback', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewRealmUpdateRequest() + ); + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewRealmUpdateRequest', + ['realm', 'name'] + ); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewRealmUpdateResponse() + ); + client.innerApiCalls.previewRealmUpdate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.previewRealmUpdate( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1.IPreviewRealmUpdateResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.previewRealmUpdate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewRealmUpdate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewRealmUpdate with error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewRealmUpdateRequest() + ); + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewRealmUpdateRequest', + ['realm', 'name'] + ); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.previewRealmUpdate = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.previewRealmUpdate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.previewRealmUpdate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewRealmUpdate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewRealmUpdate with closed client', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.PreviewRealmUpdateRequest() + ); + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewRealmUpdateRequest', + ['realm', 'name'] + ); + request.realm.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.previewRealmUpdate(request), expectedError); + }); + }); + + describe('createRealm', () => { + it('invokes createRealm without error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.CreateRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.CreateRealmRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createRealm = stubLongRunningCall(expectedResponse); + const [operation] = await client.createRealm(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRealm without error using callback', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.CreateRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.CreateRealmRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createRealm = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createRealm( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.gaming.v1.IRealm, + protos.google.cloud.gaming.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gaming.v1.IRealm, + protos.google.cloud.gaming.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRealm with call error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.CreateRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.CreateRealmRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRealm = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createRealm(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRealm with LRO error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.CreateRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.CreateRealmRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRealm = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createRealm(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateRealmProgress without error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + 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.checkCreateRealmProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateRealmProgress with error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + 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.checkCreateRealmProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteRealm', () => { + it('invokes deleteRealm without error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.DeleteRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.DeleteRealmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteRealm = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteRealm(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRealm without error using callback', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.DeleteRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.DeleteRealmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteRealm = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteRealm( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRealm with call error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.DeleteRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.DeleteRealmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRealm = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteRealm(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRealm with LRO error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.DeleteRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.DeleteRealmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRealm = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteRealm(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteRealmProgress without error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + 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.checkDeleteRealmProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteRealmProgress with error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + 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.checkDeleteRealmProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateRealm', () => { + it('invokes updateRealm without error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.UpdateRealmRequest() + ); + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.UpdateRealmRequest', + ['realm', 'name'] + ); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateRealm = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateRealm(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRealm without error using callback', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.UpdateRealmRequest() + ); + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.UpdateRealmRequest', + ['realm', 'name'] + ); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateRealm = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateRealm( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.gaming.v1.IRealm, + protos.google.cloud.gaming.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gaming.v1.IRealm, + protos.google.cloud.gaming.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRealm with call error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.UpdateRealmRequest() + ); + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.UpdateRealmRequest', + ['realm', 'name'] + ); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRealm = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateRealm(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRealm with LRO error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.UpdateRealmRequest() + ); + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.UpdateRealmRequest', + ['realm', 'name'] + ); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRealm = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateRealm(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateRealmProgress without error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + 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.checkUpdateRealmProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateRealmProgress with error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + 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.checkUpdateRealmProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listRealms', () => { + it('invokes listRealms without error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListRealmsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListRealmsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.gaming.v1.Realm()), + generateSampleMessage(new protos.google.cloud.gaming.v1.Realm()), + generateSampleMessage(new protos.google.cloud.gaming.v1.Realm()), + ]; + client.innerApiCalls.listRealms = stubSimpleCall(expectedResponse); + const [response] = await client.listRealms(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRealms as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRealms as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRealms without error using callback', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListRealmsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListRealmsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.gaming.v1.Realm()), + generateSampleMessage(new protos.google.cloud.gaming.v1.Realm()), + generateSampleMessage(new protos.google.cloud.gaming.v1.Realm()), + ]; + client.innerApiCalls.listRealms = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRealms( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1.IRealm[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRealms as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRealms as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRealms with error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListRealmsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListRealmsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listRealms = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listRealms(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listRealms as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRealms as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRealmsStream without error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListRealmsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListRealmsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.gaming.v1.Realm()), + generateSampleMessage(new protos.google.cloud.gaming.v1.Realm()), + generateSampleMessage(new protos.google.cloud.gaming.v1.Realm()), + ]; + client.descriptors.page.listRealms.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listRealmsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gaming.v1.Realm[] = []; + stream.on('data', (response: protos.google.cloud.gaming.v1.Realm) => { + 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.listRealms.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRealms, request) + ); + assert( + (client.descriptors.page.listRealms.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listRealmsStream with error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListRealmsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListRealmsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRealms.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listRealmsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gaming.v1.Realm[] = []; + stream.on('data', (response: protos.google.cloud.gaming.v1.Realm) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listRealms.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRealms, request) + ); + assert( + (client.descriptors.page.listRealms.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRealms without error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListRealmsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListRealmsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.gaming.v1.Realm()), + generateSampleMessage(new protos.google.cloud.gaming.v1.Realm()), + generateSampleMessage(new protos.google.cloud.gaming.v1.Realm()), + ]; + client.descriptors.page.listRealms.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.gaming.v1.IRealm[] = []; + const iterable = client.listRealmsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listRealms.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listRealms.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRealms with error', async () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1.ListRealmsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListRealmsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRealms.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listRealmsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.gaming.v1.IRealm[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listRealms.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listRealms.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('gameServerCluster', () => { + const fakePath = '/rendered/path/gameServerCluster'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + realm: 'realmValue', + cluster: 'clusterValue', + }; + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.gameServerClusterPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerClusterPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerClusterPath', () => { + const result = client.gameServerClusterPath( + 'projectValue', + 'locationValue', + 'realmValue', + 'clusterValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerClusterName', () => { + const result = client.matchProjectFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerClusterName', () => { + const result = client.matchLocationFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRealmFromGameServerClusterName', () => { + const result = client.matchRealmFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'realmValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchClusterFromGameServerClusterName', () => { + const result = client.matchClusterFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerConfig', () => { + const fakePath = '/rendered/path/gameServerConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + config: 'configValue', + }; + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.gameServerConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerConfigPath', () => { + const result = client.gameServerConfigPath( + 'projectValue', + 'locationValue', + 'deploymentValue', + 'configValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerConfigName', () => { + const result = client.matchProjectFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerConfigName', () => { + const result = client.matchLocationFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerConfigName', () => { + const result = client.matchDeploymentFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConfigFromGameServerConfigName', () => { + const result = client.matchConfigFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'configValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerDeployment', () => { + const fakePath = '/rendered/path/gameServerDeployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.gameServerDeploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerDeploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerDeploymentPath', () => { + const result = client.gameServerDeploymentPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerDeploymentName', () => { + const result = + client.matchProjectFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerDeploymentName', () => { + const result = + client.matchLocationFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerDeploymentName', () => { + const result = + client.matchDeploymentFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerDeploymentRollout', () => { + const fakePath = '/rendered/path/gameServerDeploymentRollout'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.gameServerDeploymentRolloutPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gameServerDeploymentRolloutPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerDeploymentRolloutPath', () => { + const result = client.gameServerDeploymentRolloutPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerDeploymentRolloutName', () => { + const result = + client.matchProjectFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerDeploymentRolloutName', () => { + const result = + client.matchLocationFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerDeploymentRolloutName', () => { + const result = + client.matchDeploymentFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('realm', () => { + const fakePath = '/rendered/path/realm'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + realm: 'realmValue', + }; + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.realmPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.realmPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('realmPath', () => { + const result = client.realmPath( + 'projectValue', + 'locationValue', + 'realmValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.realmPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRealmName', () => { + const result = client.matchProjectFromRealmName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRealmName', () => { + const result = client.matchLocationFromRealmName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRealmFromRealmName', () => { + const result = client.matchRealmFromRealmName(fakePath); + assert.strictEqual(result, 'realmValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts new file mode 100644 index 00000000000..4896cca8eae --- /dev/null +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts @@ -0,0 +1,1795 @@ +// 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 realmsserviceModule 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('v1beta.RealmsServiceClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + realmsserviceModule.v1beta.RealmsServiceClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + realmsserviceModule.v1beta.RealmsServiceClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = realmsserviceModule.v1beta.RealmsServiceClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.realmsServiceStub, undefined); + await client.initialize(); + assert(client.realmsServiceStub); + }); + + it('has close method for the initialized client', done => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.realmsServiceStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.realmsServiceStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + 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 realmsserviceModule.v1beta.RealmsServiceClient({ + 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('getRealm', () => { + it('invokes getRealm without error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GetRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetRealmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.Realm() + ); + client.innerApiCalls.getRealm = stubSimpleCall(expectedResponse); + const [response] = await client.getRealm(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRealm without error using callback', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GetRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetRealmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.Realm() + ); + client.innerApiCalls.getRealm = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getRealm( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1beta.IRealm | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRealm with error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GetRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetRealmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getRealm = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getRealm(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getRealm with closed client', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.GetRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetRealmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getRealm(request), expectedError); + }); + }); + + describe('previewRealmUpdate', () => { + it('invokes previewRealmUpdate without error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest() + ); + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest', + ['realm', 'name'] + ); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewRealmUpdateResponse() + ); + client.innerApiCalls.previewRealmUpdate = + stubSimpleCall(expectedResponse); + const [response] = await client.previewRealmUpdate(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.previewRealmUpdate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewRealmUpdate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewRealmUpdate without error using callback', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest() + ); + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest', + ['realm', 'name'] + ); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewRealmUpdateResponse() + ); + client.innerApiCalls.previewRealmUpdate = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.previewRealmUpdate( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.previewRealmUpdate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewRealmUpdate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewRealmUpdate with error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest() + ); + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest', + ['realm', 'name'] + ); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.previewRealmUpdate = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.previewRealmUpdate(request), expectedError); + const actualRequest = ( + client.innerApiCalls.previewRealmUpdate as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.previewRealmUpdate as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes previewRealmUpdate with closed client', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest() + ); + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest', + ['realm', 'name'] + ); + request.realm.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.previewRealmUpdate(request), expectedError); + }); + }); + + describe('createRealm', () => { + it('invokes createRealm without error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.CreateRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.CreateRealmRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createRealm = stubLongRunningCall(expectedResponse); + const [operation] = await client.createRealm(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRealm without error using callback', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.CreateRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.CreateRealmRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createRealm = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createRealm( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRealm with call error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.CreateRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.CreateRealmRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRealm = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createRealm(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createRealm with LRO error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.CreateRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.CreateRealmRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createRealm = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createRealm(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateRealmProgress without error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + 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.checkCreateRealmProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateRealmProgress with error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + 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.checkCreateRealmProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteRealm', () => { + it('invokes deleteRealm without error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.DeleteRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.DeleteRealmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteRealm = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteRealm(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRealm without error using callback', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.DeleteRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.DeleteRealmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteRealm = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteRealm( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRealm with call error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.DeleteRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.DeleteRealmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRealm = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteRealm(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteRealm with LRO error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.DeleteRealmRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.DeleteRealmRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRealm = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteRealm(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteRealmProgress without error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + 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.checkDeleteRealmProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteRealmProgress with error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + 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.checkDeleteRealmProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateRealm', () => { + it('invokes updateRealm without error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.UpdateRealmRequest() + ); + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.UpdateRealmRequest', + ['realm', 'name'] + ); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateRealm = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateRealm(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRealm without error using callback', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.UpdateRealmRequest() + ); + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.UpdateRealmRequest', + ['realm', 'name'] + ); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateRealm = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateRealm( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRealm with call error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.UpdateRealmRequest() + ); + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.UpdateRealmRequest', + ['realm', 'name'] + ); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRealm = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateRealm(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateRealm with LRO error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.UpdateRealmRequest() + ); + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.UpdateRealmRequest', + ['realm', 'name'] + ); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRealm = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateRealm(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateRealm as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateRealm as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateRealmProgress without error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + 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.checkUpdateRealmProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateRealmProgress with error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + 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.checkUpdateRealmProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listRealms', () => { + it('invokes listRealms without error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListRealmsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListRealmsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.gaming.v1beta.Realm()), + generateSampleMessage(new protos.google.cloud.gaming.v1beta.Realm()), + generateSampleMessage(new protos.google.cloud.gaming.v1beta.Realm()), + ]; + client.innerApiCalls.listRealms = stubSimpleCall(expectedResponse); + const [response] = await client.listRealms(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRealms as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRealms as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRealms without error using callback', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListRealmsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListRealmsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.gaming.v1beta.Realm()), + generateSampleMessage(new protos.google.cloud.gaming.v1beta.Realm()), + generateSampleMessage(new protos.google.cloud.gaming.v1beta.Realm()), + ]; + client.innerApiCalls.listRealms = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listRealms( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1beta.IRealm[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRealms as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRealms as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRealms with error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListRealmsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListRealmsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listRealms = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listRealms(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listRealms as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRealms as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRealmsStream without error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListRealmsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListRealmsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.gaming.v1beta.Realm()), + generateSampleMessage(new protos.google.cloud.gaming.v1beta.Realm()), + generateSampleMessage(new protos.google.cloud.gaming.v1beta.Realm()), + ]; + client.descriptors.page.listRealms.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listRealmsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gaming.v1beta.Realm[] = []; + stream.on( + 'data', + (response: protos.google.cloud.gaming.v1beta.Realm) => { + 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.listRealms.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRealms, request) + ); + assert( + (client.descriptors.page.listRealms.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listRealmsStream with error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListRealmsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListRealmsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRealms.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listRealmsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.gaming.v1beta.Realm[] = []; + stream.on( + 'data', + (response: protos.google.cloud.gaming.v1beta.Realm) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listRealms.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRealms, request) + ); + assert( + (client.descriptors.page.listRealms.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRealms without error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListRealmsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListRealmsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.gaming.v1beta.Realm()), + generateSampleMessage(new protos.google.cloud.gaming.v1beta.Realm()), + generateSampleMessage(new protos.google.cloud.gaming.v1beta.Realm()), + ]; + client.descriptors.page.listRealms.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.gaming.v1beta.IRealm[] = []; + const iterable = client.listRealmsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listRealms.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listRealms.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listRealms with error', async () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListRealmsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListRealmsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listRealms.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listRealmsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.gaming.v1beta.IRealm[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listRealms.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listRealms.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + describe('gameServerCluster', () => { + const fakePath = '/rendered/path/gameServerCluster'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + realm: 'realmValue', + cluster: 'clusterValue', + }; + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.gameServerClusterPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerClusterPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerClusterPath', () => { + const result = client.gameServerClusterPath( + 'projectValue', + 'locationValue', + 'realmValue', + 'clusterValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerClusterName', () => { + const result = client.matchProjectFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerClusterName', () => { + const result = client.matchLocationFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRealmFromGameServerClusterName', () => { + const result = client.matchRealmFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'realmValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchClusterFromGameServerClusterName', () => { + const result = client.matchClusterFromGameServerClusterName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerConfig', () => { + const fakePath = '/rendered/path/gameServerConfig'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + config: 'configValue', + }; + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.gameServerConfigPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerConfigPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerConfigPath', () => { + const result = client.gameServerConfigPath( + 'projectValue', + 'locationValue', + 'deploymentValue', + 'configValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerConfigPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerConfigName', () => { + const result = client.matchProjectFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerConfigName', () => { + const result = client.matchLocationFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerConfigName', () => { + const result = client.matchDeploymentFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConfigFromGameServerConfigName', () => { + const result = client.matchConfigFromGameServerConfigName(fakePath); + assert.strictEqual(result, 'configValue'); + assert( + (client.pathTemplates.gameServerConfigPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerDeployment', () => { + const fakePath = '/rendered/path/gameServerDeployment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.gameServerDeploymentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.gameServerDeploymentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerDeploymentPath', () => { + const result = client.gameServerDeploymentPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerDeploymentName', () => { + const result = + client.matchProjectFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerDeploymentName', () => { + const result = + client.matchLocationFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerDeploymentName', () => { + const result = + client.matchDeploymentFromGameServerDeploymentName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('gameServerDeploymentRollout', () => { + const fakePath = '/rendered/path/gameServerDeploymentRollout'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + deployment: 'deploymentValue', + }; + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.gameServerDeploymentRolloutPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.gameServerDeploymentRolloutPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('gameServerDeploymentRolloutPath', () => { + const result = client.gameServerDeploymentRolloutPath( + 'projectValue', + 'locationValue', + 'deploymentValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGameServerDeploymentRolloutName', () => { + const result = + client.matchProjectFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromGameServerDeploymentRolloutName', () => { + const result = + client.matchLocationFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDeploymentFromGameServerDeploymentRolloutName', () => { + const result = + client.matchDeploymentFromGameServerDeploymentRolloutName(fakePath); + assert.strictEqual(result, 'deploymentValue'); + assert( + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('realm', () => { + const fakePath = '/rendered/path/realm'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + realm: 'realmValue', + }; + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.realmPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.realmPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('realmPath', () => { + const result = client.realmPath( + 'projectValue', + 'locationValue', + 'realmValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.realmPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRealmName', () => { + const result = client.matchProjectFromRealmName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromRealmName', () => { + const result = client.matchLocationFromRealmName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRealmFromRealmName', () => { + const result = client.matchRealmFromRealmName(fakePath); + assert.strictEqual(result, 'realmValue'); + assert( + (client.pathTemplates.realmPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-gaming/tsconfig.json b/packages/google-cloud-gaming/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-gaming/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-gaming/webpack.config.js b/packages/google-cloud-gaming/webpack.config.js new file mode 100644 index 00000000000..3b4f5f16d8c --- /dev/null +++ b/packages/google-cloud-gaming/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: 'GameServerClustersService', + filename: './game-server-clusters-service.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 9ce7fe30aad..f3fe1cad6ba 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -25,6 +25,7 @@ "packages/google-cloud-deploy": {}, "packages/google-cloud-dialogflow": {}, "packages/google-cloud-discoveryengine": {}, + "packages/google-cloud-gaming": {}, "packages/google-cloud-functions": {}, "packages/google-cloud-documentai": {}, "packages/google-cloud-gkeconnect-gateway": {},