From 4bb05f46b83e4c3184a9feee5267b86d000af528 Mon Sep 17 00:00:00 2001 From: Eric Schmidt Date: Mon, 10 Feb 2020 13:56:48 -0800 Subject: [PATCH 001/180] Initial client library creation --- packages/google-cloud-gaming/.eslintignore | 5 + packages/google-cloud-gaming/.eslintrc.yml | 15 + packages/google-cloud-gaming/.gitignore | 14 + packages/google-cloud-gaming/.jsdoc.js | 48 + packages/google-cloud-gaming/.mocharc.json | 5 + packages/google-cloud-gaming/.nycrc | 24 + packages/google-cloud-gaming/.prettierignore | 3 + packages/google-cloud-gaming/.prettierrc | 8 + .../google-cloud-gaming/.repo-metadata.json | 13 + .../google-cloud-gaming/CODE_OF_CONDUCT.md | 43 + packages/google-cloud-gaming/CONTRIBUTING.md | 65 + packages/google-cloud-gaming/LICENSE | 202 + packages/google-cloud-gaming/README.md | 95 + packages/google-cloud-gaming/codecov.yaml | 4 + .../linkinator.config.json | 8 + packages/google-cloud-gaming/package.json | 55 + .../google/cloud/gaming/v1beta/common.proto | 242 + .../gaming/v1beta/game_server_clusters.proto | 265 + .../v1beta/game_server_clusters_service.proto | 112 + .../gaming/v1beta/game_server_configs.proto | 180 + .../v1beta/game_server_configs_service.proto | 78 + .../v1beta/game_server_deployments.proto | 305 + .../game_server_deployments_service.proto | 128 + .../google/cloud/gaming/v1beta/realms.proto | 189 + .../cloud/gaming/v1beta/realms_service.proto | 96 + .../google-cloud-gaming/protos/protos.d.ts | 12285 +++++++ packages/google-cloud-gaming/protos/protos.js | 29961 ++++++++++++++++ .../google-cloud-gaming/protos/protos.json | 2976 ++ .../google-cloud-gaming/samples/package.json | 23 + .../google-cloud-gaming/samples/quickstart.js | 29 + .../samples/test/quickstart.js | 34 + packages/google-cloud-gaming/src/index.ts | 40 + .../game_server_clusters_service_client.ts | 1360 + ...server_clusters_service_client_config.json | 58 + ...me_server_clusters_service_proto_list.json | 11 + .../game_server_configs_service_client.ts | 1009 + ..._server_configs_service_client_config.json | 42 + ...ame_server_configs_service_proto_list.json | 11 + .../game_server_deployments_service_client.ts | 1467 + ...ver_deployments_service_client_config.json | 62 + ...server_deployments_service_proto_list.json | 11 + .../google-cloud-gaming/src/v1beta/index.ts | 22 + .../src/v1beta/realms_service_client.ts | 1141 + .../v1beta/realms_service_client_config.json | 50 + .../src/v1beta/realms_service_proto_list.json | 11 + packages/google-cloud-gaming/synth.metadata | 31 + packages/google-cloud-gaming/synth.py | 40 + .../system-test/fixtures/sample/src/index.js | 30 + .../system-test/fixtures/sample/src/index.ts | 28 + .../system-test/install.ts | 51 + ...pic-game_server_clusters_service-v1beta.ts | 596 + ...apic-game_server_configs_service-v1beta.ts | 350 + ...-game_server_deployments_service-v1beta.ts | 665 + .../test/gapic-realms_service-v1beta.ts | 444 + packages/google-cloud-gaming/tsconfig.json | 19 + packages/google-cloud-gaming/tslint.json | 3 + .../google-cloud-gaming/webpack.config.js | 64 + 57 files changed, 55126 insertions(+) create mode 100644 packages/google-cloud-gaming/.eslintignore create mode 100644 packages/google-cloud-gaming/.eslintrc.yml create mode 100644 packages/google-cloud-gaming/.gitignore create mode 100644 packages/google-cloud-gaming/.jsdoc.js create mode 100644 packages/google-cloud-gaming/.mocharc.json create mode 100644 packages/google-cloud-gaming/.nycrc create mode 100644 packages/google-cloud-gaming/.prettierignore create mode 100644 packages/google-cloud-gaming/.prettierrc create mode 100644 packages/google-cloud-gaming/.repo-metadata.json create mode 100644 packages/google-cloud-gaming/CODE_OF_CONDUCT.md create mode 100644 packages/google-cloud-gaming/CONTRIBUTING.md create mode 100644 packages/google-cloud-gaming/LICENSE create mode 100644 packages/google-cloud-gaming/README.md create mode 100644 packages/google-cloud-gaming/codecov.yaml create mode 100644 packages/google-cloud-gaming/linkinator.config.json create mode 100644 packages/google-cloud-gaming/package.json create mode 100644 packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto create mode 100644 packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_clusters.proto create mode 100644 packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_clusters_service.proto create mode 100644 packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_configs.proto create mode 100644 packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_configs_service.proto create mode 100644 packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_deployments.proto create mode 100644 packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_deployments_service.proto create mode 100644 packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto create mode 100644 packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms_service.proto create mode 100644 packages/google-cloud-gaming/protos/protos.d.ts create mode 100644 packages/google-cloud-gaming/protos/protos.js create mode 100644 packages/google-cloud-gaming/protos/protos.json create mode 100644 packages/google-cloud-gaming/samples/package.json create mode 100644 packages/google-cloud-gaming/samples/quickstart.js create mode 100644 packages/google-cloud-gaming/samples/test/quickstart.js create mode 100644 packages/google-cloud-gaming/src/index.ts create mode 100644 packages/google-cloud-gaming/src/v1beta/game_server_clusters_service_client.ts create mode 100644 packages/google-cloud-gaming/src/v1beta/game_server_clusters_service_client_config.json create mode 100644 packages/google-cloud-gaming/src/v1beta/game_server_clusters_service_proto_list.json create mode 100644 packages/google-cloud-gaming/src/v1beta/game_server_configs_service_client.ts create mode 100644 packages/google-cloud-gaming/src/v1beta/game_server_configs_service_client_config.json create mode 100644 packages/google-cloud-gaming/src/v1beta/game_server_configs_service_proto_list.json create mode 100644 packages/google-cloud-gaming/src/v1beta/game_server_deployments_service_client.ts create mode 100644 packages/google-cloud-gaming/src/v1beta/game_server_deployments_service_client_config.json create mode 100644 packages/google-cloud-gaming/src/v1beta/game_server_deployments_service_proto_list.json create mode 100644 packages/google-cloud-gaming/src/v1beta/index.ts create mode 100644 packages/google-cloud-gaming/src/v1beta/realms_service_client.ts create mode 100644 packages/google-cloud-gaming/src/v1beta/realms_service_client_config.json create mode 100644 packages/google-cloud-gaming/src/v1beta/realms_service_proto_list.json create mode 100644 packages/google-cloud-gaming/synth.metadata create mode 100644 packages/google-cloud-gaming/synth.py create mode 100644 packages/google-cloud-gaming/system-test/fixtures/sample/src/index.js create mode 100644 packages/google-cloud-gaming/system-test/fixtures/sample/src/index.ts create mode 100644 packages/google-cloud-gaming/system-test/install.ts create mode 100644 packages/google-cloud-gaming/test/gapic-game_server_clusters_service-v1beta.ts create mode 100644 packages/google-cloud-gaming/test/gapic-game_server_configs_service-v1beta.ts create mode 100644 packages/google-cloud-gaming/test/gapic-game_server_deployments_service-v1beta.ts create mode 100644 packages/google-cloud-gaming/test/gapic-realms_service-v1beta.ts create mode 100644 packages/google-cloud-gaming/tsconfig.json create mode 100644 packages/google-cloud-gaming/tslint.json create mode 100644 packages/google-cloud-gaming/webpack.config.js diff --git a/packages/google-cloud-gaming/.eslintignore b/packages/google-cloud-gaming/.eslintignore new file mode 100644 index 00000000000..09b31fe735a --- /dev/null +++ b/packages/google-cloud-gaming/.eslintignore @@ -0,0 +1,5 @@ +**/node_modules +src/**/doc/* +build/ +docs/ +protos/ diff --git a/packages/google-cloud-gaming/.eslintrc.yml b/packages/google-cloud-gaming/.eslintrc.yml new file mode 100644 index 00000000000..73eeec27612 --- /dev/null +++ b/packages/google-cloud-gaming/.eslintrc.yml @@ -0,0 +1,15 @@ +--- +extends: + - 'eslint:recommended' + - 'plugin:node/recommended' + - prettier +plugins: + - node + - prettier +rules: + prettier/prettier: error + block-scoped-var: error + eqeqeq: error + no-warning-comments: warn + no-var: error + prefer-const: error 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..8dc1e9dca09 --- /dev/null +++ b/packages/google-cloud-gaming/.jsdoc.js @@ -0,0 +1,48 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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'; + +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' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2018 Google, LLC.', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/game-servers', + theme: 'lumen' + }, + markdown: { + idInHeadings: true + } +}; 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..f6fac98b0a8 --- /dev/null +++ b/packages/google-cloud-gaming/.prettierignore @@ -0,0 +1,3 @@ +node_modules/* +samples/node_modules/* +src/**/doc/* diff --git a/packages/google-cloud-gaming/.prettierrc b/packages/google-cloud-gaming/.prettierrc new file mode 100644 index 00000000000..df6eac07446 --- /dev/null +++ b/packages/google-cloud-gaming/.prettierrc @@ -0,0 +1,8 @@ +--- +bracketSpacing: false +printWidth: 80 +semi: true +singleQuote: true +tabWidth: 2 +trailingComma: es5 +useTabs: false diff --git a/packages/google-cloud-gaming/.repo-metadata.json b/packages/google-cloud-gaming/.repo-metadata.json new file mode 100644 index 00000000000..80fe4cea01b --- /dev/null +++ b/packages/google-cloud-gaming/.repo-metadata.json @@ -0,0 +1,13 @@ +{ + "name": "game-servers", + "name_pretty": "Google Cloud Game Servers", + "product_documentation": "https://cloud.google.com/game-servers/", + "client_documentation": "https://googleapis.dev/nodejs/game-services/latest", + "issue_tracker": "", + "release_level": "beta", + "language": "nodejs", + "repo": "googleapis/nodejs-game-servers", + "distribution_name": "@google-cloud/game-servers", + "api_id": "gameservices.googleapis.com", + "requires_billing": true +} 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..46b2a08ea6d --- /dev/null +++ b/packages/google-cloud-gaming/CODE_OF_CONDUCT.md @@ -0,0 +1,43 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, +and in the interest of fostering an open and welcoming community, +we pledge to respect all people who contribute through reporting issues, +posting feature requests, updating documentation, +submitting pull requests or patches, and other activities. + +We are committed to making participation in this project +a harassment-free experience for everyone, +regardless of level of experience, gender, gender identity and expression, +sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, +such as physical or electronic +addresses, without explicit permission +* Other unethical or unprofessional conduct. + +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. +By adopting this Code of Conduct, +project maintainers commit themselves to fairly and consistently +applying these principles to every aspect of managing this project. +Project maintainers who do not follow or enforce the Code of Conduct +may be permanently removed from the project team. + +This code of conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior +may be reported by opening an issue +or contacting one or more of the project maintainers. + +This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, +available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) diff --git a/packages/google-cloud-gaming/CONTRIBUTING.md b/packages/google-cloud-gaming/CONTRIBUTING.md new file mode 100644 index 00000000000..f6c4cf010e3 --- /dev/null +++ b/packages/google-cloud-gaming/CONTRIBUTING.md @@ -0,0 +1,65 @@ +# 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. + +## 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. + gcloud auth application-default login + npm run samples-test + + # Run all system tests. + gcloud auth application-default login + npm run system-test + +1. Lint (and maybe fix) any changes: + + npm run fix + +[setup]: https://cloud.google.com/nodejs/docs/setup 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..7d1a53afd2f --- /dev/null +++ b/packages/google-cloud-gaming/README.md @@ -0,0 +1,95 @@ +[//]: # "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/nodejs-game-servers) + +[![release level](https://img.shields.io/badge/release%20level-beta-yellow.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) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-game-servers/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-game-servers) + + + + +Gaming client for Node.js + + +* [Google Cloud Game Servers Node.js Client API Reference][client-docs] +* [Google Cloud Game Servers Documentation][product-docs] +* [github.com/googleapis/nodejs-game-servers](https://github.com/googleapis/nodejs-game-servers) + +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) + + +* [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 +``` + + + + + +The [Google Cloud Game Servers Node.js Client API Reference][client-docs] documentation +also contains samples. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + +This library is considered to be in **beta**. This means it is expected to be +mostly stable while we work toward a general availability release; however, +complete stability is not guaranteed. We will address issues and requests +against beta libraries with a high priority. + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-game-servers/blob/master/CONTRIBUTING.md). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-game-servers/blob/master/LICENSE) + +[client-docs]: https://googleapis.dev/nodejs/game-services/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/codecov.yaml b/packages/google-cloud-gaming/codecov.yaml new file mode 100644 index 00000000000..5724ea9478d --- /dev/null +++ b/packages/google-cloud-gaming/codecov.yaml @@ -0,0 +1,4 @@ +--- +codecov: + ci: + - source.cloud.google.com diff --git a/packages/google-cloud-gaming/linkinator.config.json b/packages/google-cloud-gaming/linkinator.config.json new file mode 100644 index 00000000000..b555215ca02 --- /dev/null +++ b/packages/google-cloud-gaming/linkinator.config.json @@ -0,0 +1,8 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io" + ] +} diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json new file mode 100644 index 00000000000..b9880545d24 --- /dev/null +++ b/packages/google-cloud-gaming/package.json @@ -0,0 +1,55 @@ +{ + "name": "@google-cloud/game-servers", + "version": "0.1.0", + "description": "Gaming client for Node.js", + "repository": "googleapis/nodejs-gaming", + "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 && eslint samples --fix", + "lint": "gts check && eslint samples", + "predocs-test": "npm run docs", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^1.12.0" + }, + "devDependencies": { + "@types/mocha": "^5.2.5", + "@types/node": "^12.0.0", + "c8": "^6.0.0", + "eslint": "^6.8.0", + "eslint-config-prettier": "^6.10.0", + "eslint-plugin-node": "^11.0.0", + "eslint-plugin-prettier": "^3.1.2", + "gts": "^1.0.0", + "jsdoc": "^3.5.5", + "jsdoc-fresh": "^1.0.1", + "jsdoc-region-tag": "^1.0.2", + "linkinator": "^1.5.0", + "mocha": "^6.0.0", + "null-loader": "^3.0.0", + "pack-n-play": "^1.0.0-2", + "prettier": "^1.19.1", + "ts-loader": "^6.2.1", + "typescript": "~3.6.4", + "webpack": "^4.41.2", + "webpack-cli": "^3.3.10" + }, + "engines": { + "node": ">=8.13.0" + } +} 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..1db6b77cfa4 --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto @@ -0,0 +1,242 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.gaming.v1beta; + +import "google/api/field_behavior.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.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 gameservices 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..62ce7ef9cba --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_clusters.proto @@ -0,0 +1,265 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.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"; +import "google/api/annotations.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"; + +// 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) = { + type: "gameservices.googleapis.com/GameServerCluster" + } + ]; + + // 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.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) = { + 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]; + + // 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]; + + // 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; + + // 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..462e42dde47 --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_clusters_service.proto @@ -0,0 +1,112 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.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"; + +// 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: "GameServerCluster" + 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..ac57c5c3a19 --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_configs.proto @@ -0,0 +1,180 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.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"; +import "google/api/annotations.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"; + +// 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) = { + 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) = { + 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..89dd582307a --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_configs_service.proto @@ -0,0 +1,78 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.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"; + +// 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: "GameServerConfig" + 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..d0682520900 --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_deployments.proto @@ -0,0 +1,305 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.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"; +import "google/api/annotations.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"; + +// 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) = { + type: "gameservices.googleapis.com/GameServerDeployment" + } + ]; + + // 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.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 Delpoyments. + 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 Deployment 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 Deployment 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) = { + type: "gameservices.googleapis.com/GameServerDeployment" + } + ]; + + // Required. The ID of the Game Server Deployment resource to be created. + string deployment_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The Game Server Deployment 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 Deployment 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 Deployment 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 Deployment 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 Deployment. 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 Deployment. + 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..ccb0c5055f4 --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/game_server_deployments_service.proto @@ -0,0 +1,128 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.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"; + +// 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: "GameServerDeployment" + 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. + 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 + // Ddeployment. 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..38281aa6789 --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto @@ -0,0 +1,189 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.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"; +import "google/api/annotations.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"; + +// 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) = { + 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) = { + 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..b7dfaa07cc3 --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms_service.proto @@ -0,0 +1,96 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.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"; + +// 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: "Realm" + 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..901cccd8fef --- /dev/null +++ b/packages/google-cloud-gaming/protos/protos.d.ts @@ -0,0 +1,12285 @@ +// 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. + +import * as Long from "long"; +import * as $protobuf from "protobufjs"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace gaming. */ + namespace gaming { + + /** 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 }; + } + + /** 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 }; + } + + 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + 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 }; + } + + 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 }; + } + + /** 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 }; + } + } + } + + /** 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 }; + } + + /** 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 }; + } + + 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 }; + } + + 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 }; + } + } + + /** 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 }; + } + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + 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 }; + } + } + + /** 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 }; + } + + /** 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; + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 + } + + /** 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 }; + } + + /** 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; + + /** HttpRule put. */ + public put: string; + + /** HttpRule post. */ + public post: string; + + /** HttpRule delete. */ + public delete: string; + + /** HttpRule patch. */ + public patch: string; + + /** 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 }; + } + + /** 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 }; + } + + /** 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); + } + + /** 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; + + /** + * 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 }; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + } + + /** 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 }; + } + } + + /** 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 }; + } + + /** 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); + } + + /** 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; + + /** + * 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 }; + } + + /** 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 }; + } + + 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 }; + } + + /** 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 }; + } + } + + /** 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 }; + } + + /** 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); + } + + /** 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); + + /** + * 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 }; + } + + 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 }; + } + + /** 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 }; + } + + 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 }; + } + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + 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 }; + } + + /** 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 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 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 }; + } + + 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + 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 }; + } + + 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 }; + } + } + + /** 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 }; + } + + 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 }; + } + } + + /** 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 }; + } + + 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); + } + + /** 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; + + /** + * 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 }; + } + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + } + + /** 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 }; + } + } +} diff --git a/packages/google-cloud-gaming/protos/protos.js b/packages/google-cloud-gaming/protos/protos.js new file mode 100644 index 00000000000..3f1f832821c --- /dev/null +++ b/packages/google-cloud-gaming/protos/protos.js @@ -0,0 +1,29961 @@ +// 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. + +/*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("protobufjs/minimal")); + +})(this, function($protobuf) { + "use strict"; + + // Common aliases + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + + // Exported root namespace + var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + + $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.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 && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && message.hasOwnProperty("target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && message.hasOwnProperty("verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && message.hasOwnProperty("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 && message.hasOwnProperty("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; + 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: + reader.skip().pos++; + if (message.operationStatus === $util.emptyObject) + message.operationStatus = {}; + key = reader.string(); + reader.pos++; + message.operationStatus[key] = $root.google.cloud.gaming.v1beta.OperationStatus.decode(reader, reader.uint32()); + 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); + }; + + 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 && message.hasOwnProperty("done")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.done); + if (message.errorCode != null && message.hasOwnProperty("errorCode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.errorCode); + if (message.errorMessage != null && message.hasOwnProperty("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) { + 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] : 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); + }; + + /** + * ErrorCode enum. + * @name google.cloud.gaming.v1beta.OperationStatus.ErrorCode + * @enum {string} + * @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 && message.hasOwnProperty("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; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); + 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); + }; + + 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); + }; + + 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 && message.hasOwnProperty("startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && message.hasOwnProperty("endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.cronJobDuration != null && message.hasOwnProperty("cronJobDuration")) + $root.google.protobuf.Duration.encode(message.cronJobDuration, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cronSpec != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("gameServerConfigName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gameServerConfigName); + if (message.name != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("gameServerClusterName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gameServerClusterName); + if (message.gameServerDeploymentName != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.specSource != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.specSource != null && message.hasOwnProperty("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); + }; + + 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); + }; + + 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 && message.hasOwnProperty("deployedFleet")) + $root.google.cloud.gaming.v1beta.DeployedFleetDetails.DeployedFleet.encode(message.deployedFleet, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deployedAutoscaler != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("fleet")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fleet); + if (message.fleetSpec != null && message.hasOwnProperty("fleetSpec")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fleetSpec); + if (message.specSource != null && message.hasOwnProperty("specSource")) + $root.google.cloud.gaming.v1beta.SpecSource.encode(message.specSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.status != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("readyReplicas")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.readyReplicas); + if (message.allocatedReplicas != null && message.hasOwnProperty("allocatedReplicas")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.allocatedReplicas); + if (message.reservedReplicas != null && message.hasOwnProperty("reservedReplicas")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.reservedReplicas); + if (message.replicas != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("autoscaler")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.autoscaler); + if (message.fleetAutoscalerSpec != null && message.hasOwnProperty("fleetAutoscalerSpec")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.fleetAutoscalerSpec); + if (message.specSource != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.gameServerClusterId != null && message.hasOwnProperty("gameServerClusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gameServerClusterId); + if (message.gameServerCluster != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.gameServerClusterId != null && message.hasOwnProperty("gameServerClusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gameServerClusterId); + if (message.gameServerCluster != null && message.hasOwnProperty("gameServerCluster")) + $root.google.cloud.gaming.v1beta.GameServerCluster.encode(message.gameServerCluster, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.previewTime != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.targetState != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.previewTime != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.targetState != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("gameServerCluster")) + $root.google.cloud.gaming.v1beta.GameServerCluster.encode(message.gameServerCluster, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("gameServerCluster")) + $root.google.cloud.gaming.v1beta.GameServerCluster.encode(message.gameServerCluster, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.previewTime != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.targetState != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("namespace")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.namespace); + if (message.gkeClusterReference != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && message.hasOwnProperty("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 && message.hasOwnProperty("connectionInfo")) + $root.google.cloud.gaming.v1beta.GameServerClusterConnectionInfo.encode(message.connectionInfo, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.etag != null && message.hasOwnProperty("etag")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); + if (message.description != null && message.hasOwnProperty("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; + 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: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); + 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); + }; + + 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 && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.configId != null && message.hasOwnProperty("configId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.configId); + if (message.gameServerConfig != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.fleetAutoscalerSpec != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("fleetSpec")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fleetSpec); + if (message.name != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && message.hasOwnProperty("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 && message.hasOwnProperty("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; + 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: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); + 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); + }; + + 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 && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.deploymentId != null && message.hasOwnProperty("deploymentId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deploymentId); + if (message.gameServerDeployment != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("gameServerDeployment")) + $root.google.cloud.gaming.v1beta.GameServerDeployment.encode(message.gameServerDeployment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("rollout")) + $root.google.cloud.gaming.v1beta.GameServerDeploymentRollout.encode(message.rollout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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); + }; + + 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); + }; + + 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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && message.hasOwnProperty("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 && message.hasOwnProperty("etag")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); + if (message.description != null && message.hasOwnProperty("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; + 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: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = 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 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); + }; + + 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} configVersion + * @memberof google.cloud.gaming.v1beta.GameServerConfigOverride + * @instance + */ + GameServerConfigOverride.prototype.configVersion = ""; + + // 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 && message.hasOwnProperty("realmsSelector")) + $root.google.cloud.gaming.v1beta.RealmSelector.encode(message.realmsSelector, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.configVersion != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.defaultGameServerConfig != null && message.hasOwnProperty("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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("rollout")) + $root.google.cloud.gaming.v1beta.GameServerDeploymentRollout.encode(message.rollout, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.previewTime != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + if (message.targetState != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && message.hasOwnProperty("filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.realmId != null && message.hasOwnProperty("realmId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.realmId); + if (message.realm != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("realm")) + $root.google.cloud.gaming.v1beta.Realm.encode(message.realm, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("realm")) + $root.google.cloud.gaming.v1beta.Realm.encode(message.realm, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.previewTime != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("etag")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); + if (message.targetState != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && message.hasOwnProperty("createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && message.hasOwnProperty("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 && message.hasOwnProperty("timeZone")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.timeZone); + if (message.etag != null && message.hasOwnProperty("etag")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); + if (message.description != null && message.hasOwnProperty("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; + 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: + reader.skip().pos++; + if (message.labels === $util.emptyObject) + message.labels = {}; + key = reader.string(); + reader.pos++; + message.labels[key] = reader.string(); + 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); + }; + + 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 {string} + * @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 + */ + 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; + return values; + })(); + + api.Http = (function() { + + /** + * Properties of a Http. + * @memberof google.api + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + */ + + /** + * Constructs a new Http. + * @memberof google.api + * @classdesc Represents a Http. + * @implements IHttp + * @constructor + * @param {google.api.IHttp=} [properties] Properties to set + */ + function Http(properties) { + this.rules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http + * @instance + */ + Http.prototype.rules = $util.emptyArray; + + /** + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http + * @instance + */ + Http.prototype.fullyDecodeReservedExpansion = false; + + /** + * Creates a new Http instance using the specified properties. + * @function create + * @memberof google.api.Http + * @static + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance + */ + Http.create = function create(properties) { + return new Http(properties); + }; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @function encode + * @memberof google.api.Http + * @static + * @param {google.api.IHttp} message Http message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Http.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rules != null && message.rules.length) + for (var i = 0; i < message.rules.length; ++i) + $root.google.api.HttpRule.encode(message.rules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("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); + }; + + 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} get + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.get = ""; + + /** + * HttpRule put. + * @member {string} put + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.put = ""; + + /** + * HttpRule post. + * @member {string} post + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.post = ""; + + /** + * HttpRule delete. + * @member {string} delete + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype["delete"] = ""; + + /** + * HttpRule patch. + * @member {string} patch + * @memberof google.api.HttpRule + * @instance + */ + HttpRule.prototype.patch = ""; + + /** + * 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 && message.hasOwnProperty("selector")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); + if (message.get != null && message.hasOwnProperty("get")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); + if (message.put != null && message.hasOwnProperty("put")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); + if (message.post != null && message.hasOwnProperty("post")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); + if (message["delete"] != null && message.hasOwnProperty("delete")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); + if (message.patch != null && message.hasOwnProperty("patch")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); + if (message.body != null && message.hasOwnProperty("body")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); + if (message.custom != null && message.hasOwnProperty("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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("kind")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); + if (message.path != null && message.hasOwnProperty("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); + }; + + return CustomHttpPattern; + })(); + + 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 + */ + + /** + * 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 = []; + if (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 = ""; + + /** + * 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 && message.hasOwnProperty("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 && message.hasOwnProperty("nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && message.hasOwnProperty("history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && message.hasOwnProperty("plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && message.hasOwnProperty("singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + 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; + 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"; + 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) { + 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); + 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 = []; + 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] : message.history; + if (message.plural != null && message.hasOwnProperty("plural")) + object.plural = message.plural; + if (message.singular != null && message.hasOwnProperty("singular")) + object.singular = message.singular; + 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); + }; + + /** + * History enum. + * @name google.api.ResourceDescriptor.History + * @enum {string} + * @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; + })(); + + 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 && message.hasOwnProperty("type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.childType != null && message.hasOwnProperty("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); + }; + + return ResourceReference; + })(); + + 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); + }; + + 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 + */ + + /** + * 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 = ""; + + /** + * 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && message.hasOwnProperty("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 && message.hasOwnProperty("options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && message.hasOwnProperty("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 && message.hasOwnProperty("syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + 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; + 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"; + 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); + 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 = ""; + } + 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; + 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); + }; + + 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 && message.hasOwnProperty("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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("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); + }; + + 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); + }; + + 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 + */ + + /** + * 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; + + /** + * 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && message.hasOwnProperty("extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && message.hasOwnProperty("number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && message.hasOwnProperty("label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && message.hasOwnProperty("type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && message.hasOwnProperty("typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + 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; + 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; + } + 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) { + 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) { + 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); + } + 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 = ""; + } + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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; + 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); + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {string} + * @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 {string} + * @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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && message.hasOwnProperty("number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && message.hasOwnProperty("inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && message.hasOwnProperty("outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && message.hasOwnProperty("options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && message.hasOwnProperty("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); + }; + + 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 = false; + + /** + * 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 && message.hasOwnProperty("javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && message.hasOwnProperty("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) { + 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 = false; + 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] : 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); + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {string} + * @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 && message.hasOwnProperty("messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && message.hasOwnProperty("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 && message.hasOwnProperty(".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); + }; + + 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} [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 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 && message.hasOwnProperty("ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && message.hasOwnProperty("packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && message.hasOwnProperty("lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && message.hasOwnProperty("jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && message.hasOwnProperty("weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + 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 && message.hasOwnProperty(".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 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.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: + 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) { + 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) { + 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.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: + 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; + } + } + 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[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $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] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + 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]] : 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); + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {string} + * @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 {string} + * @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); + }; + + 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 && message.hasOwnProperty("allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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 && message.hasOwnProperty(".google.api.defaultHost")) + writer.uint32(/* id 1049, wireType 2 =*/8394).string(message[".google.api.defaultHost"]); + if (message[".google.api.oauthScopes"] != null && message.hasOwnProperty(".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); + }; + + 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 && message.hasOwnProperty("deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && message.hasOwnProperty("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 && message.hasOwnProperty(".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 && message.hasOwnProperty(".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) { + 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] : 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); + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {string} + * @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 && message.hasOwnProperty("identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && message.hasOwnProperty("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) + 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); + }; + + 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); + }; + + 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); + }; + + 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 && message.hasOwnProperty("leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && message.hasOwnProperty("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); + }; + + 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); + }; + + 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 + */ + + /** + * 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; + + /** + * 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 && message.hasOwnProperty("sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && message.hasOwnProperty("begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && message.hasOwnProperty("end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + 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; + 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"; + 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; + 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; + } + 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; + 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); + }; + + 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 && message.hasOwnProperty("seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && message.hasOwnProperty("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); + }; + + 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); + }; + + 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 && message.hasOwnProperty("type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && message.hasOwnProperty("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) + 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); + }; + + 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); + }; + + 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.metadata != null && message.hasOwnProperty("metadata")) + $root.google.protobuf.Any.encode(message.metadata, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.done != null && message.hasOwnProperty("done")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); + if (message.error != null && message.hasOwnProperty("error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.response != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("filter")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.timeout != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("responseType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); + if (message.metadataType != null && message.hasOwnProperty("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); + }; + + 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 && message.hasOwnProperty("code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && message.hasOwnProperty("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); + }; + + 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..5a0173d1665 --- /dev/null +++ b/packages/google-cloud-gaming/protos/protos.json @@ -0,0 +1,2976 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "gaming": { + "nested": { + "v1beta": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming", + "java_multiple_files": true, + "java_package": "com.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).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).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" + } + }, + "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" + } + }, + "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" + } + }, + "GetGameServerCluster": { + "requestType": "GetGameServerClusterRequest", + "responseType": "GameServerCluster", + "options": { + "(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" + } + }, + "PreviewCreateGameServerCluster": { + "requestType": "PreviewCreateGameServerClusterRequest", + "responseType": "PreviewCreateGameServerClusterResponse", + "options": { + "(google.api.http).post": "/v1beta/{parent=projects/*/locations/*/realms/*}/gameServerClusters:previewCreate", + "(google.api.http).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": "GameServerCluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + } + }, + "PreviewDeleteGameServerCluster": { + "requestType": "PreviewDeleteGameServerClusterRequest", + "responseType": "PreviewDeleteGameServerClusterResponse", + "options": { + "(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" + } + }, + "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" + } + } + } + }, + "ListGameServerConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).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).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" + } + }, + "GetGameServerConfig": { + "requestType": "GetGameServerConfigRequest", + "responseType": "GameServerConfig", + "options": { + "(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" + } + }, + "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": "GameServerConfig", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + } + } + } + }, + "ListGameServerDeploymentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).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).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" + } + }, + "GetGameServerDeployment": { + "requestType": "GetGameServerDeploymentRequest", + "responseType": "GameServerDeployment", + "options": { + "(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" + } + }, + "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": "GameServerDeployment", + "(google.longrunning.operation_info).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" + } + }, + "GetGameServerDeploymentRollout": { + "requestType": "GetGameServerDeploymentRolloutRequest", + "responseType": "GameServerDeploymentRollout", + "options": { + "(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" + } + }, + "PreviewGameServerDeploymentRollout": { + "requestType": "PreviewGameServerDeploymentRolloutRequest", + "responseType": "PreviewGameServerDeploymentRolloutResponse", + "options": { + "(google.api.http).patch": "/v1beta/{rollout.name=projects/*/locations/*/gameServerDeployments/*}/rollout:preview", + "(google.api.http).body": "rollout" + } + }, + "FetchDeploymentState": { + "requestType": "FetchDeploymentStateRequest", + "responseType": "FetchDeploymentStateResponse", + "options": { + "(google.api.http).post": "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*}:fetchDeploymentState", + "(google.api.http).body": "*" + } + } + } + }, + "ListRealmsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).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).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" + } + }, + "GetRealm": { + "requestType": "GetRealmRequest", + "responseType": "Realm", + "options": { + "(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" + } + }, + "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": "Realm", + "(google.longrunning.operation_info).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" + } + }, + "PreviewRealmUpdate": { + "requestType": "PreviewRealmUpdateRequest", + "responseType": "PreviewRealmUpdateResponse", + "options": { + "(google.api.http).patch": "/v1beta/{realm.name=projects/*/locations/*/realms/*}:previewUpdate", + "(google.api.http).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 + } + }, + "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 + } + } + }, + "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 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + } + } + }, + "protobuf": { + "options": { + "go_package": "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor", + "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 + } + } + }, + "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 + } + }, + "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": false + } + }, + "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": [ + [ + 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 + } + }, + "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 + } + } + } + } + }, + "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": { + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}" + } + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}" + } + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}" + } + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*" + } + }, + "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": { + "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/package.json b/packages/google-cloud-gaming/samples/package.json new file mode 100644 index 00000000000..1202f25b5d3 --- /dev/null +++ b/packages/google-cloud-gaming/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-game-server-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=8" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/game-servers": "^1.0.1" + }, + "devDependencies": { + "c8": "^5.0.1", + "chai": "^4.2.0", + "mocha": "^6.1.4" + } +} diff --git a/packages/google-cloud-gaming/samples/quickstart.js b/packages/google-cloud-gaming/samples/quickstart.js new file mode 100644 index 00000000000..4b8eca19b83 --- /dev/null +++ b/packages/google-cloud-gaming/samples/quickstart.js @@ -0,0 +1,29 @@ +// Copyright 2020, Google LLC. +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +/** +* DESCRIBE WHAT THIS SAMPLE DOES. +* @param {string} LIST EXPECTED ARGUMENTS. +*/ +async function main() { +// [START LIBRARY_NAME_quickstart] + +// [END LIBRARY_NAME_quickstart] +} + +main(...process.argv.slice(2)).catch(err => { + console.error(err); + process.exitCode = 1; +}); diff --git a/packages/google-cloud-gaming/samples/test/quickstart.js b/packages/google-cloud-gaming/samples/test/quickstart.js new file mode 100644 index 00000000000..5a021415dcd --- /dev/null +++ b/packages/google-cloud-gaming/samples/test/quickstart.js @@ -0,0 +1,34 @@ +// 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 path = require("path"); +const { assert } = require("chai"); +const cp = require("child_process"); +const { describe, it } = require("mocha"); + +const execSync = cmd => cp.execSync(cmd, { encoding: "utf-8" }); + +const cwd = path.join(__dirname, ".."); + +describe("Quickstart", () => { + it("should run quickstart", async () => { + const stdout = execSync(`node ./samples/quickstart.js`, { cwd }); + }); +}); diff --git a/packages/google-cloud-gaming/src/index.ts b/packages/google-cloud-gaming/src/index.ts new file mode 100644 index 00000000000..a6996245a82 --- /dev/null +++ b/packages/google-cloud-gaming/src/index.ts @@ -0,0 +1,40 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 v1beta from './v1beta'; +const GameServerClustersServiceClient = v1beta.GameServerClustersServiceClient; +const GameServerConfigsServiceClient = v1beta.GameServerConfigsServiceClient; +const GameServerDeploymentsServiceClient = + v1beta.GameServerDeploymentsServiceClient; +const RealmsServiceClient = v1beta.RealmsServiceClient; +export { + v1beta, + GameServerClustersServiceClient, + GameServerConfigsServiceClient, + GameServerDeploymentsServiceClient, + RealmsServiceClient, +}; +// For compatibility with JavaScript libraries we need to provide this default export: +// tslint:disable-next-line no-default-export +export default { + v1beta, + GameServerClustersServiceClient, + GameServerConfigsServiceClient, + GameServerDeploymentsServiceClient, + RealmsServiceClient, +}; 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..3370becad2d --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/game_server_clusters_service_client.ts @@ -0,0 +1,1360 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, +} from 'google-gax'; +import * as path from 'path'; + +import * as protosTypes from '../../protos/protos'; +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 _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + operationsClient: gax.OperationsClient; + gameServerClustersServiceStub: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of GameServerClustersServiceClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @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 {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this + .constructor as typeof GameServerClustersServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this + .constructor as typeof GameServerClustersServiceClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // 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 gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}' + ), + gameServerConfigPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}' + ), + gameServerDeploymentPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}' + ), + gameServerDeploymentRolloutPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout' + ), + realmPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}' + ), + }; + + // 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 protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + + this.operationsClient = gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + }) + .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.cloud.gaming.v1beta.GameServerCluster' + ) 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 gaxModule.LongrunningDescriptor( + this.operationsClient, + createGameServerClusterResponse.decode.bind( + createGameServerClusterResponse + ), + createGameServerClusterMetadata.decode.bind( + createGameServerClusterMetadata + ) + ), + deleteGameServerCluster: new gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteGameServerClusterResponse.decode.bind( + deleteGameServerClusterResponse + ), + deleteGameServerClusterMetadata.decode.bind( + deleteGameServerClusterMetadata + ) + ), + updateGameServerCluster: new gaxModule.LongrunningDescriptor( + this.operationsClient, + updateGameServerClusterResponse.decode.bind( + updateGameServerClusterResponse + ), + updateGameServerClusterMetadata.decode.bind( + updateGameServerClusterMetadata + ) + ), + }; + + // Put together the default options sent with requests. + const defaults = 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 = {}; + + // Put together the "service stub" for + // google.cloud.gaming.v1beta.GameServerClustersService. + this.gameServerClustersServiceStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.cloud.gaming.v1beta.GameServerClustersService' + ) + : // tslint:disable-next-line no-any + (protos as any).google.cloud.gaming.v1beta.GameServerClustersService, + opts + ) 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 innerCallPromise = this.gameServerClustersServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'gameservices.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'gameservices.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + 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. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + listGameServerClusters( + request: protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersResponse, + ( + | protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersRequest + | undefined + ), + {} | undefined + ] + >; + listGameServerClusters( + request: protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersResponse, + | protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersRequest + | undefined, + {} | undefined + > + ): void; + /** + * Lists Game Server Clusters in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ListGameServerClustersResponse]{@link google.cloud.gaming.v1beta.ListGameServerClustersResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listGameServerClusters( + request: protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersResponse, + | protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersResponse, + | protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersResponse, + ( + | protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listGameServerClusters( + request, + options, + callback + ); + } + getGameServerCluster( + request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, + ( + | protosTypes.google.cloud.gaming.v1beta.IGetGameServerClusterRequest + | undefined + ), + {} | undefined + ] + >; + getGameServerCluster( + request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, + | protosTypes.google.cloud.gaming.v1beta.IGetGameServerClusterRequest + | undefined, + {} | undefined + > + ): void; + /** + * Gets details of a single game server cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getGameServerCluster( + request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, + | protosTypes.google.cloud.gaming.v1beta.IGetGameServerClusterRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, + | protosTypes.google.cloud.gaming.v1beta.IGetGameServerClusterRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, + ( + | protosTypes.google.cloud.gaming.v1beta.IGetGameServerClusterRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getGameServerCluster(request, options, callback); + } + previewCreateGameServerCluster( + request: protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, + ( + | protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest + | undefined + ), + {} | undefined + ] + >; + previewCreateGameServerCluster( + request: protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, + | protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest + | undefined, + {} | undefined + > + ): void; + /** + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + previewCreateGameServerCluster( + request: protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, + | protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, + | protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, + ( + | protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.previewCreateGameServerCluster( + request, + options, + callback + ); + } + previewDeleteGameServerCluster( + request: protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, + ( + | protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest + | undefined + ), + {} | undefined + ] + >; + previewDeleteGameServerCluster( + request: protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, + | protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest + | undefined, + {} | undefined + > + ): void; + /** + * Previews deletion of a single game server cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + previewDeleteGameServerCluster( + request: protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, + | protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, + | protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, + ( + | protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.previewDeleteGameServerCluster( + request, + options, + callback + ); + } + previewUpdateGameServerCluster( + request: protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, + ( + | protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest + | undefined + ), + {} | undefined + ] + >; + previewUpdateGameServerCluster( + request: protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, + | protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest + | undefined, + {} | undefined + > + ): void; + /** + * Previews updating a GameServerCluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + previewUpdateGameServerCluster( + request: protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, + | protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, + | protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, + ( + | protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'game_server_cluster.name': request.gameServerCluster!.name || '', + }); + return this._innerApiCalls.previewUpdateGameServerCluster( + request, + options, + callback + ); + } + + createGameServerCluster( + request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createGameServerCluster( + request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Creates a new game server cluster in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createGameServerCluster( + request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.createGameServerCluster( + request, + options, + callback + ); + } + deleteGameServerCluster( + request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteGameServerCluster( + request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Deletes a single game server cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteGameServerCluster( + request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.deleteGameServerCluster( + request, + options, + callback + ); + } + updateGameServerCluster( + request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateGameServerCluster( + request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Patches a single game server cluster. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateGameServerCluster( + request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'game_server_cluster.name': request.gameServerCluster!.name || '', + }); + return this._innerApiCalls.updateGameServerCluster( + request, + options, + callback + ); + } + // -------------------- + // -- 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, + location, + realm, + 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, + location, + deployment, + 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, + location, + 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, + location, + 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, + location, + 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. + */ + close(): Promise { + if (!this._terminated) { + return this.gameServerClustersServiceStub.then(stub => { + this._terminated = true; + stub.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..f13eed1bc43 --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/game_server_clusters_service_client_config.json @@ -0,0 +1,58 @@ +{ + "interfaces": { + "google.cloud.gaming.v1beta.GameServerClustersService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListGameServerClusters": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetGameServerCluster": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateGameServerCluster": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PreviewCreateGameServerCluster": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteGameServerCluster": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PreviewDeleteGameServerCluster": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateGameServerCluster": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PreviewUpdateGameServerCluster": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} 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..2d4844d0abe --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/game_server_configs_service_client.ts @@ -0,0 +1,1009 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, +} from 'google-gax'; +import * as path from 'path'; + +import * as protosTypes from '../../protos/protos'; +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 _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + operationsClient: gax.OperationsClient; + gameServerConfigsServiceStub: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of GameServerConfigsServiceClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @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 {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this + .constructor as typeof GameServerConfigsServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this + .constructor as typeof GameServerConfigsServiceClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // 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 gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}' + ), + gameServerConfigPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}' + ), + gameServerDeploymentPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}' + ), + gameServerDeploymentRolloutPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout' + ), + realmPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}' + ), + }; + + // 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 protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + + this.operationsClient = gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + }) + .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.cloud.gaming.v1beta.GameServerConfig' + ) as gax.protobuf.Type; + const deleteGameServerConfigMetadata = protoFilesRoot.lookup( + '.google.cloud.gaming.v1beta.OperationMetadata' + ) as gax.protobuf.Type; + + this._descriptors.longrunning = { + createGameServerConfig: new gaxModule.LongrunningDescriptor( + this.operationsClient, + createGameServerConfigResponse.decode.bind( + createGameServerConfigResponse + ), + createGameServerConfigMetadata.decode.bind( + createGameServerConfigMetadata + ) + ), + deleteGameServerConfig: new gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteGameServerConfigResponse.decode.bind( + deleteGameServerConfigResponse + ), + deleteGameServerConfigMetadata.decode.bind( + deleteGameServerConfigMetadata + ) + ), + }; + + // Put together the default options sent with requests. + const defaults = 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 = {}; + + // Put together the "service stub" for + // google.cloud.gaming.v1beta.GameServerConfigsService. + this.gameServerConfigsServiceStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.cloud.gaming.v1beta.GameServerConfigsService' + ) + : // tslint:disable-next-line no-any + (protos as any).google.cloud.gaming.v1beta.GameServerConfigsService, + opts + ) 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 innerCallPromise = this.gameServerConfigsServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'gameservices.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'gameservices.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + 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. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + listGameServerConfigs( + request: protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsResponse, + ( + | protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsRequest + | undefined + ), + {} | undefined + ] + >; + listGameServerConfigs( + request: protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsResponse, + | protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsRequest + | undefined, + {} | undefined + > + ): void; + /** + * Lists Game Server Configs in a given project, Location, and Game Server + * Deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ListGameServerConfigsResponse]{@link google.cloud.gaming.v1beta.ListGameServerConfigsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listGameServerConfigs( + request: protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsResponse, + | protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsResponse, + | protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsResponse, + ( + | protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listGameServerConfigs( + request, + options, + callback + ); + } + getGameServerConfig( + request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, + ( + | protosTypes.google.cloud.gaming.v1beta.IGetGameServerConfigRequest + | undefined + ), + {} | undefined + ] + >; + getGameServerConfig( + request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, + | protosTypes.google.cloud.gaming.v1beta.IGetGameServerConfigRequest + | undefined, + {} | undefined + > + ): void; + /** + * Gets details of a single Game Server Config. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getGameServerConfig( + request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, + | protosTypes.google.cloud.gaming.v1beta.IGetGameServerConfigRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, + | protosTypes.google.cloud.gaming.v1beta.IGetGameServerConfigRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, + ( + | protosTypes.google.cloud.gaming.v1beta.IGetGameServerConfigRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getGameServerConfig(request, options, callback); + } + + createGameServerConfig( + request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createGameServerConfig( + request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createGameServerConfig( + request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.createGameServerConfig( + request, + options, + callback + ); + } + deleteGameServerConfig( + request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteGameServerConfig( + request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteGameServerConfig( + request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.deleteGameServerConfig( + request, + options, + callback + ); + } + // -------------------- + // -- 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, + location, + realm, + 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, + location, + deployment, + 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, + location, + 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, + location, + 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, + location, + 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. + */ + close(): Promise { + if (!this._terminated) { + return this.gameServerConfigsServiceStub.then(stub => { + this._terminated = true; + stub.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..78ebd2fa491 --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/game_server_configs_service_client_config.json @@ -0,0 +1,42 @@ +{ + "interfaces": { + "google.cloud.gaming.v1beta.GameServerConfigsService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListGameServerConfigs": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetGameServerConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateGameServerConfig": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteGameServerConfig": { + "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..f61edcd6bd5 --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/game_server_deployments_service_client.ts @@ -0,0 +1,1467 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, +} from 'google-gax'; +import * as path from 'path'; + +import * as protosTypes from '../../protos/protos'; +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 _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + operationsClient: gax.OperationsClient; + gameServerDeploymentsServiceStub: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of GameServerDeploymentsServiceClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @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 {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this + .constructor as typeof GameServerDeploymentsServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this + .constructor as typeof GameServerDeploymentsServiceClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // 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 gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}' + ), + gameServerConfigPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}' + ), + gameServerDeploymentPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}' + ), + gameServerDeploymentRolloutPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout' + ), + realmPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}' + ), + }; + + // 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 protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + + this.operationsClient = gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + }) + .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.cloud.gaming.v1beta.GameServerDeployment' + ) 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 gaxModule.LongrunningDescriptor( + this.operationsClient, + createGameServerDeploymentResponse.decode.bind( + createGameServerDeploymentResponse + ), + createGameServerDeploymentMetadata.decode.bind( + createGameServerDeploymentMetadata + ) + ), + deleteGameServerDeployment: new gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteGameServerDeploymentResponse.decode.bind( + deleteGameServerDeploymentResponse + ), + deleteGameServerDeploymentMetadata.decode.bind( + deleteGameServerDeploymentMetadata + ) + ), + updateGameServerDeployment: new gaxModule.LongrunningDescriptor( + this.operationsClient, + updateGameServerDeploymentResponse.decode.bind( + updateGameServerDeploymentResponse + ), + updateGameServerDeploymentMetadata.decode.bind( + updateGameServerDeploymentMetadata + ) + ), + updateGameServerDeploymentRollout: new gaxModule.LongrunningDescriptor( + this.operationsClient, + updateGameServerDeploymentRolloutResponse.decode.bind( + updateGameServerDeploymentRolloutResponse + ), + updateGameServerDeploymentRolloutMetadata.decode.bind( + updateGameServerDeploymentRolloutMetadata + ) + ), + }; + + // Put together the default options sent with requests. + const defaults = 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 = {}; + + // Put together the "service stub" for + // google.cloud.gaming.v1beta.GameServerDeploymentsService. + this.gameServerDeploymentsServiceStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.cloud.gaming.v1beta.GameServerDeploymentsService' + ) + : // tslint:disable-next-line no-any + (protos as any).google.cloud.gaming.v1beta + .GameServerDeploymentsService, + opts + ) 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 innerCallPromise = this.gameServerDeploymentsServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'gameservices.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'gameservices.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + 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. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + listGameServerDeployments( + request: protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, + ( + | protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest + | undefined + ), + {} | undefined + ] + >; + listGameServerDeployments( + request: protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, + | protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest + | undefined, + {} | undefined + > + ): void; + /** + * Lists Game Server Deployments in a given project and Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ListGameServerDeploymentsResponse]{@link google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listGameServerDeployments( + request: protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, + | protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, + | protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, + ( + | protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listGameServerDeployments( + request, + options, + callback + ); + } + getGameServerDeployment( + request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + ( + | protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest + | undefined + ), + {} | undefined + ] + >; + getGameServerDeployment( + request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + | protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest + | undefined, + {} | undefined + > + ): void; + /** + * Gets details of a single Game Server Deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getGameServerDeployment( + request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + | protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + | protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + ( + | protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getGameServerDeployment( + request, + options, + callback + ); + } + getGameServerDeploymentRollout( + request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, + ( + | protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest + | undefined + ), + {} | undefined + ] + >; + getGameServerDeploymentRollout( + request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, + | protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest + | undefined, + {} | undefined + > + ): void; + /** + * Gets details a single Game Server Deployment Rollout. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getGameServerDeploymentRollout( + request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, + | protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, + | protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, + ( + | protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getGameServerDeploymentRollout( + request, + options, + callback + ); + } + previewGameServerDeploymentRollout( + request: protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, + ( + | protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest + | undefined + ), + {} | undefined + ] + >; + previewGameServerDeploymentRollout( + request: protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, + | protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest + | undefined, + {} | undefined + > + ): void; + /** + * 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + previewGameServerDeploymentRollout( + request: protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, + | protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, + | protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, + ( + | protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'rollout.name': request.rollout!.name || '', + }); + return this._innerApiCalls.previewGameServerDeploymentRollout( + request, + options, + callback + ); + } + fetchDeploymentState( + request: protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, + ( + | protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest + | undefined + ), + {} | undefined + ] + >; + fetchDeploymentState( + request: protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, + | protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest + | undefined, + {} | undefined + > + ): void; + /** + * Retrieves information about the current state of the Game Server + * Ddeployment. 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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + fetchDeploymentState( + request: protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, + | protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, + | protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, + ( + | protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.fetchDeploymentState(request, options, callback); + } + + createGameServerDeployment( + request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createGameServerDeployment( + request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Creates a new Game Server Deployment in a given project and Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createGameServerDeployment( + request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.createGameServerDeployment( + request, + options, + callback + ); + } + deleteGameServerDeployment( + request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteGameServerDeployment( + request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Deletes a single Game Server Deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteGameServerDeployment( + request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.deleteGameServerDeployment( + request, + options, + callback + ); + } + updateGameServerDeployment( + request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateGameServerDeployment( + request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Patches a Game Server Deployment. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateGameServerDeployment( + request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'game_server_deployment.name': request.gameServerDeployment!.name || '', + }); + return this._innerApiCalls.updateGameServerDeployment( + request, + options, + callback + ); + } + updateGameServerDeploymentRollout( + request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateGameServerDeploymentRollout( + request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Patches a single Game Server Deployment Rollout. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateGameServerDeploymentRollout( + request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'rollout.name': request.rollout!.name || '', + }); + return this._innerApiCalls.updateGameServerDeploymentRollout( + request, + options, + callback + ); + } + // -------------------- + // -- 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, + location, + realm, + 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, + location, + deployment, + 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, + location, + 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, + location, + 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, + location, + 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. + */ + close(): Promise { + if (!this._terminated) { + return this.gameServerDeploymentsServiceStub.then(stub => { + this._terminated = true; + stub.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..ace93ff10cc --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/game_server_deployments_service_client_config.json @@ -0,0 +1,62 @@ +{ + "interfaces": { + "google.cloud.gaming.v1beta.GameServerDeploymentsService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListGameServerDeployments": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetGameServerDeployment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateGameServerDeployment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteGameServerDeployment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateGameServerDeployment": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetGameServerDeploymentRollout": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateGameServerDeploymentRollout": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PreviewGameServerDeploymentRollout": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FetchDeploymentState": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} 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/index.ts b/packages/google-cloud-gaming/src/v1beta/index.ts new file mode 100644 index 00000000000..80e7089516e --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/index.ts @@ -0,0 +1,22 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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..3a2ecfe4722 --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -0,0 +1,1141 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 gax from 'google-gax'; +import { + APICallback, + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, +} from 'google-gax'; +import * as path from 'path'; + +import * as protosTypes from '../../protos/protos'; +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 _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _innerApiCalls: {[name: string]: Function}; + private _pathTemplates: {[name: string]: gax.PathTemplate}; + private _terminated = false; + auth: gax.GoogleAuth; + operationsClient: gax.OperationsClient; + realmsServiceStub: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of RealmsServiceClient. + * + * @param {object} [options] - The configuration object. See the subsequent + * parameters for more details. + * @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 {function} [options.promise] - Custom promise module to use instead + * of native Promises. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof RealmsServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + opts.clientConfig = opts.clientConfig || {}; + + const isBrowser = typeof window !== 'undefined'; + if (isBrowser) { + opts.fallback = true; + } + // If we are in browser, we are already using fallback because of the + // "browser" field in package.json. + // But if we were explicitly requested to use fallback, let's do it now. + const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof RealmsServiceClient).scopes; + const gaxGrpc = new gaxModule.GrpcClient(opts); + + // Save the auth object to the client, for use by other methods. + this.auth = gaxGrpc.auth as gax.GoogleAuth; + + // Determine the client header string. + const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + const protos = gaxGrpc.loadProto( + opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + ); + + // 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 gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}' + ), + gameServerConfigPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}' + ), + gameServerDeploymentPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}' + ), + gameServerDeploymentRolloutPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout' + ), + realmPathTemplate: new gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/realms/{realm}' + ), + }; + + // 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 protoFilesRoot = opts.fallback + ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) + : gaxModule.protobuf.loadSync(nodejsProtoPath); + + this.operationsClient = gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + }) + .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.cloud.gaming.v1beta.Realm' + ) 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 gaxModule.LongrunningDescriptor( + this.operationsClient, + createRealmResponse.decode.bind(createRealmResponse), + createRealmMetadata.decode.bind(createRealmMetadata) + ), + deleteRealm: new gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteRealmResponse.decode.bind(deleteRealmResponse), + deleteRealmMetadata.decode.bind(deleteRealmMetadata) + ), + updateRealm: new gaxModule.LongrunningDescriptor( + this.operationsClient, + updateRealmResponse.decode.bind(updateRealmResponse), + updateRealmMetadata.decode.bind(updateRealmMetadata) + ), + }; + + // Put together the default options sent with requests. + const defaults = 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 = {}; + + // Put together the "service stub" for + // google.cloud.gaming.v1beta.RealmsService. + this.realmsServiceStub = gaxGrpc.createStub( + opts.fallback + ? (protos as protobuf.Root).lookupService( + 'google.cloud.gaming.v1beta.RealmsService' + ) + : // tslint:disable-next-line no-any + (protos as any).google.cloud.gaming.v1beta.RealmsService, + opts + ) 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 innerCallPromise = this.realmsServiceStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + return stub[methodName].apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const apiCall = gaxModule.createApiCall( + innerCallPromise, + defaults[methodName], + this._descriptors.page[methodName] || + this._descriptors.stream[methodName] || + this._descriptors.longrunning[methodName] + ); + + this._innerApiCalls[methodName] = ( + argument: {}, + callOptions?: CallOptions, + callback?: APICallback + ) => { + return apiCall(argument, callOptions, callback); + }; + } + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'gameservices.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'gameservices.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + 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. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + listRealms( + request: protosTypes.google.cloud.gaming.v1beta.IListRealmsRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IListRealmsResponse, + protosTypes.google.cloud.gaming.v1beta.IListRealmsRequest | undefined, + {} | undefined + ] + >; + listRealms( + request: protosTypes.google.cloud.gaming.v1beta.IListRealmsRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.gaming.v1beta.IListRealmsResponse, + protosTypes.google.cloud.gaming.v1beta.IListRealmsRequest | undefined, + {} | undefined + > + ): void; + /** + * Lists Realms in a given project and Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ListRealmsResponse]{@link google.cloud.gaming.v1beta.ListRealmsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listRealms( + request: protosTypes.google.cloud.gaming.v1beta.IListRealmsRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.gaming.v1beta.IListRealmsResponse, + protosTypes.google.cloud.gaming.v1beta.IListRealmsRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.gaming.v1beta.IListRealmsResponse, + protosTypes.google.cloud.gaming.v1beta.IListRealmsRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IListRealmsResponse, + protosTypes.google.cloud.gaming.v1beta.IListRealmsRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.listRealms(request, options, callback); + } + getRealm( + request: protosTypes.google.cloud.gaming.v1beta.IGetRealmRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IRealm, + protosTypes.google.cloud.gaming.v1beta.IGetRealmRequest | undefined, + {} | undefined + ] + >; + getRealm( + request: protosTypes.google.cloud.gaming.v1beta.IGetRealmRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.gaming.v1beta.IRealm, + protosTypes.google.cloud.gaming.v1beta.IGetRealmRequest | undefined, + {} | undefined + > + ): void; + /** + * Gets details of a single Realm. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getRealm( + request: protosTypes.google.cloud.gaming.v1beta.IGetRealmRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.gaming.v1beta.IRealm, + protosTypes.google.cloud.gaming.v1beta.IGetRealmRequest | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.gaming.v1beta.IRealm, + protosTypes.google.cloud.gaming.v1beta.IGetRealmRequest | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IRealm, + protosTypes.google.cloud.gaming.v1beta.IGetRealmRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.getRealm(request, options, callback); + } + previewRealmUpdate( + request: protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, + options?: gax.CallOptions + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, + ( + | protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest + | undefined + ), + {} | undefined + ] + >; + previewRealmUpdate( + request: protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, + options: gax.CallOptions, + callback: Callback< + protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, + | protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest + | undefined, + {} | undefined + > + ): void; + /** + * Previews patches to a single Realm. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + previewRealmUpdate( + request: protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, + | protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest + | undefined, + {} | undefined + >, + callback?: Callback< + protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, + | protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest + | undefined, + {} | undefined + > + ): Promise< + [ + protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, + ( + | protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'realm.name': request.realm!.name || '', + }); + return this._innerApiCalls.previewRealmUpdate(request, options, callback); + } + + createRealm( + request: protosTypes.google.cloud.gaming.v1beta.ICreateRealmRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IRealm, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createRealm( + request: protosTypes.google.cloud.gaming.v1beta.ICreateRealmRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IRealm, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Creates a new Realm in a given project and Location. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createRealm( + request: protosTypes.google.cloud.gaming.v1beta.ICreateRealmRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IRealm, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IRealm, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IRealm, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + return this._innerApiCalls.createRealm(request, options, callback); + } + deleteRealm( + request: protosTypes.google.cloud.gaming.v1beta.IDeleteRealmRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IRealm, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteRealm( + request: protosTypes.google.cloud.gaming.v1beta.IDeleteRealmRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IRealm, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Deletes a single Realm. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteRealm( + request: protosTypes.google.cloud.gaming.v1beta.IDeleteRealmRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IRealm, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IRealm, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IRealm, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + return this._innerApiCalls.deleteRealm(request, options, callback); + } + updateRealm( + request: protosTypes.google.cloud.gaming.v1beta.IUpdateRealmRequest, + options?: gax.CallOptions + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IRealm, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateRealm( + request: protosTypes.google.cloud.gaming.v1beta.IUpdateRealmRequest, + options: gax.CallOptions, + callback: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IRealm, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): void; + /** + * Patches a single Realm. + * + * @param {Object} request + * The request object that will be sent. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateRealm( + request: protosTypes.google.cloud.gaming.v1beta.IUpdateRealmRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IRealm, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + >, + callback?: Callback< + LROperation< + protosTypes.google.cloud.gaming.v1beta.IRealm, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + > + ): Promise< + [ + LROperation< + protosTypes.google.cloud.gaming.v1beta.IRealm, + protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + >, + protosTypes.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'realm.name': request.realm!.name || '', + }); + return this._innerApiCalls.updateRealm(request, options, callback); + } + // -------------------- + // -- 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, + location, + realm, + 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, + location, + deployment, + 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, + location, + 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, + location, + 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, + location, + 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. + */ + close(): Promise { + if (!this._terminated) { + return this.realmsServiceStub.then(stub => { + this._terminated = true; + stub.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..9d42f97a616 --- /dev/null +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client_config.json @@ -0,0 +1,50 @@ +{ + "interfaces": { + "google.cloud.gaming.v1beta.RealmsService": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListRealms": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetRealm": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateRealm": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteRealm": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateRealm": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "PreviewRealmUpdate": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} 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/synth.metadata b/packages/google-cloud-gaming/synth.metadata new file mode 100644 index 00000000000..8585f8cae75 --- /dev/null +++ b/packages/google-cloud-gaming/synth.metadata @@ -0,0 +1,31 @@ +{ + "updateTime": "2020-02-10T21:21:11.414668Z", + "sources": [ + { + "git": { + "name": "googleapis-private", + "remote": "https://github.com/googleapis/googleapis-private.git", + "sha": "a1f5059959398f6278a600b81bbf2828141e1a69", + "internalRef": "293086097" + } + }, + { + "template": { + "name": "node_library", + "origin": "synthtool.gcp", + "version": "2019.10.17" + } + } + ], + "destinations": [ + { + "client": { + "source": "googleapis-private", + "apiName": "gameservices", + "apiVersion": "v1beta1", + "language": "typescript", + "generator": "gapic-generator-typescript" + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-gaming/synth.py b/packages/google-cloud-gaming/synth.py new file mode 100644 index 00000000000..50f327b5bd9 --- /dev/null +++ b/packages/google-cloud-gaming/synth.py @@ -0,0 +1,40 @@ +# 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 as s +import synthtool.gcp as gcp +import subprocess +import logging +logging.basicConfig(level=logging.DEBUG) +# run the gapic generator +gapic = gcp.GAPICMicrogenerator() +versions = ['v1beta1'] +for version in versions: + library = gapic.typescript_library( + 'gameservices', + generator_args={ + 'package-name': '@google-cloud/game-servers' + }, + proto_path='/google/cloud/gaming/v1beta', + private=True, + version=version) +s.copy(library, excludes=['package.json', 'README.md']) +# Copy common templates +common_templates = gcp.CommonTemplates() +templates = common_templates.node_library(source_location='build/src') +s.copy(templates, excludes=[]) +# Node.js specific cleanup +subprocess.run(['npm', 'install']) +subprocess.run(['npm', 'run', 'fix']) +subprocess.run(['npx', 'compileProtos', 'src']) 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..9fc25880b6e --- /dev/null +++ b/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.js @@ -0,0 +1,30 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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..43804e1da02 --- /dev/null +++ b/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,28 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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'; + +function main() { + const gameServerClustersServiceClient = new GameServerClustersServiceClient(); + const gameServerConfigsServiceClient = new GameServerConfigsServiceClient(); + const gameServerDeploymentsServiceClient = new GameServerDeploymentsServiceClient(); + const realmsServiceClient = new 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..c9aa74ec221 --- /dev/null +++ b/packages/google-cloud-gaming/system-test/install.ts @@ -0,0 +1,51 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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('typescript consumer tests', () => { + it('should have correct type signature for typescript users', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); + + it('should have correct type signature for javascript users', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), // path to your module. + sample: { + description: 'typescript based user can use the type definitions', + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, + }; + await packNTest(options); // will throw upon error. + }); +}); 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..14542d9008f --- /dev/null +++ b/packages/google-cloud-gaming/test/gapic-game_server_clusters_service-v1beta.ts @@ -0,0 +1,596 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const gameserverclustersserviceModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +function mockLongRunningGrpcMethod( + expectedRequest: {}, + response: {} | null, + error?: {} | null +) { + return (request: {}) => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + }, + }; + return Promise.resolve([mockOperation]); + }; +} +describe('v1beta.GameServerClustersServiceClient', () => { + 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); + }); + describe('listGameServerClusters', () => { + it('invokes listGameServerClusters without error', done => { + const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.listGameServerClusters = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.listGameServerClusters(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes listGameServerClusters with error', done => { + const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.listGameServerClusters = mockSimpleGrpcMethod( + request, + null, + error + ); + client.listGameServerClusters(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getGameServerCluster', () => { + it('invokes getGameServerCluster without error', done => { + const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerClusterRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getGameServerCluster = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getGameServerCluster(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getGameServerCluster with error', done => { + const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerClusterRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getGameServerCluster = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getGameServerCluster(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('previewCreateGameServerCluster', () => { + it('invokes previewCreateGameServerCluster without error', done => { + const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.previewCreateGameServerCluster = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.previewCreateGameServerCluster( + request, + (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + } + ); + }); + + it('invokes previewCreateGameServerCluster with error', done => { + const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.previewCreateGameServerCluster = mockSimpleGrpcMethod( + request, + null, + error + ); + client.previewCreateGameServerCluster( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('previewDeleteGameServerCluster', () => { + it('invokes previewDeleteGameServerCluster without error', done => { + const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.previewDeleteGameServerCluster = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.previewDeleteGameServerCluster( + request, + (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + } + ); + }); + + it('invokes previewDeleteGameServerCluster with error', done => { + const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.previewDeleteGameServerCluster = mockSimpleGrpcMethod( + request, + null, + error + ); + client.previewDeleteGameServerCluster( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('previewUpdateGameServerCluster', () => { + it('invokes previewUpdateGameServerCluster without error', done => { + const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest = {}; + request.gameServerCluster = {}; + request.gameServerCluster.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.previewUpdateGameServerCluster = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.previewUpdateGameServerCluster( + request, + (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + } + ); + }); + + it('invokes previewUpdateGameServerCluster with error', done => { + const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest = {}; + request.gameServerCluster = {}; + request.gameServerCluster.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.previewUpdateGameServerCluster = mockSimpleGrpcMethod( + request, + null, + error + ); + client.previewUpdateGameServerCluster( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('createGameServerCluster', () => { + it('invokes createGameServerCluster without error', done => { + const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createGameServerCluster = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .createGameServerCluster(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes createGameServerCluster with error', done => { + const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createGameServerCluster = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .createGameServerCluster(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('deleteGameServerCluster', () => { + it('invokes deleteGameServerCluster without error', done => { + const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteGameServerCluster = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .deleteGameServerCluster(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes deleteGameServerCluster with error', done => { + const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteGameServerCluster = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .deleteGameServerCluster(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('updateGameServerCluster', () => { + it('invokes updateGameServerCluster without error', done => { + const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest = {}; + request.gameServerCluster = {}; + request.gameServerCluster.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateGameServerCluster = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .updateGameServerCluster(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes updateGameServerCluster with error', done => { + const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest = {}; + request.gameServerCluster = {}; + request.gameServerCluster.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateGameServerCluster = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .updateGameServerCluster(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); +}); 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..c6da1ff6b13 --- /dev/null +++ b/packages/google-cloud-gaming/test/gapic-game_server_configs_service-v1beta.ts @@ -0,0 +1,350 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const gameserverconfigsserviceModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +function mockLongRunningGrpcMethod( + expectedRequest: {}, + response: {} | null, + error?: {} | null +) { + return (request: {}) => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + }, + }; + return Promise.resolve([mockOperation]); + }; +} +describe('v1beta.GameServerConfigsServiceClient', () => { + 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); + }); + describe('listGameServerConfigs', () => { + it('invokes listGameServerConfigs without error', done => { + const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.listGameServerConfigs = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.listGameServerConfigs(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes listGameServerConfigs with error', done => { + const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.listGameServerConfigs = mockSimpleGrpcMethod( + request, + null, + error + ); + client.listGameServerConfigs(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getGameServerConfig', () => { + it('invokes getGameServerConfig without error', done => { + const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerConfigRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getGameServerConfig = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getGameServerConfig(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getGameServerConfig with error', done => { + const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerConfigRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getGameServerConfig = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getGameServerConfig(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createGameServerConfig', () => { + it('invokes createGameServerConfig without error', done => { + const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createGameServerConfig = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .createGameServerConfig(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes createGameServerConfig with error', done => { + const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createGameServerConfig = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .createGameServerConfig(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('deleteGameServerConfig', () => { + it('invokes deleteGameServerConfig without error', done => { + const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteGameServerConfig = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .deleteGameServerConfig(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes deleteGameServerConfig with error', done => { + const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteGameServerConfig = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .deleteGameServerConfig(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); +}); 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..8d1dea2ed24 --- /dev/null +++ b/packages/google-cloud-gaming/test/gapic-game_server_deployments_service-v1beta.ts @@ -0,0 +1,665 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const gameserverdeploymentsserviceModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +function mockLongRunningGrpcMethod( + expectedRequest: {}, + response: {} | null, + error?: {} | null +) { + return (request: {}) => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + }, + }; + return Promise.resolve([mockOperation]); + }; +} +describe('v1beta.GameServerDeploymentsServiceClient', () => { + 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); + }); + describe('listGameServerDeployments', () => { + it('invokes listGameServerDeployments without error', done => { + const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.listGameServerDeployments = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.listGameServerDeployments(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes listGameServerDeployments with error', done => { + const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.listGameServerDeployments = mockSimpleGrpcMethod( + request, + null, + error + ); + client.listGameServerDeployments( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('getGameServerDeployment', () => { + it('invokes getGameServerDeployment without error', done => { + const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getGameServerDeployment = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getGameServerDeployment(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getGameServerDeployment with error', done => { + const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getGameServerDeployment = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getGameServerDeployment( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('getGameServerDeploymentRollout', () => { + it('invokes getGameServerDeploymentRollout without error', done => { + const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getGameServerDeploymentRollout = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getGameServerDeploymentRollout( + request, + (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + } + ); + }); + + it('invokes getGameServerDeploymentRollout with error', done => { + const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getGameServerDeploymentRollout = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getGameServerDeploymentRollout( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('previewGameServerDeploymentRollout', () => { + it('invokes previewGameServerDeploymentRollout without error', done => { + const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest = {}; + request.rollout = {}; + request.rollout.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.previewGameServerDeploymentRollout = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.previewGameServerDeploymentRollout( + request, + (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + } + ); + }); + + it('invokes previewGameServerDeploymentRollout with error', done => { + const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest = {}; + request.rollout = {}; + request.rollout.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.previewGameServerDeploymentRollout = mockSimpleGrpcMethod( + request, + null, + error + ); + client.previewGameServerDeploymentRollout( + request, + (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + } + ); + }); + }); + describe('fetchDeploymentState', () => { + it('invokes fetchDeploymentState without error', done => { + const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.fetchDeploymentState = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.fetchDeploymentState(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes fetchDeploymentState with error', done => { + const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.fetchDeploymentState = mockSimpleGrpcMethod( + request, + null, + error + ); + client.fetchDeploymentState(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createGameServerDeployment', () => { + it('invokes createGameServerDeployment without error', done => { + const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createGameServerDeployment = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .createGameServerDeployment(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes createGameServerDeployment with error', done => { + const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createGameServerDeployment = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .createGameServerDeployment(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('deleteGameServerDeployment', () => { + it('invokes deleteGameServerDeployment without error', done => { + const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteGameServerDeployment = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .deleteGameServerDeployment(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes deleteGameServerDeployment with error', done => { + const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteGameServerDeployment = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .deleteGameServerDeployment(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('updateGameServerDeployment', () => { + it('invokes updateGameServerDeployment without error', done => { + const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest = {}; + request.gameServerDeployment = {}; + request.gameServerDeployment.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateGameServerDeployment = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .updateGameServerDeployment(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes updateGameServerDeployment with error', done => { + const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest = {}; + request.gameServerDeployment = {}; + request.gameServerDeployment.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateGameServerDeployment = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .updateGameServerDeployment(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('updateGameServerDeploymentRollout', () => { + it('invokes updateGameServerDeploymentRollout without error', done => { + const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest = {}; + request.rollout = {}; + request.rollout.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateGameServerDeploymentRollout = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .updateGameServerDeploymentRollout(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes updateGameServerDeploymentRollout with error', done => { + const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest = {}; + request.rollout = {}; + request.rollout.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateGameServerDeploymentRollout = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .updateGameServerDeploymentRollout(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); +}); 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..5633160c926 --- /dev/null +++ b/packages/google-cloud-gaming/test/gapic-realms_service-v1beta.ts @@ -0,0 +1,444 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 protosTypes from '../protos/protos'; +import * as assert from 'assert'; +import {describe, it} from 'mocha'; +const realmsserviceModule = require('../src'); + +const FAKE_STATUS_CODE = 1; +class FakeError { + name: string; + message: string; + code: number; + constructor(n: number) { + this.name = 'fakeName'; + this.message = 'fake message'; + this.code = n; + } +} +const error = new FakeError(FAKE_STATUS_CODE); +export interface Callback { + (err: FakeError | null, response?: {} | null): void; +} + +export class Operation { + constructor() {} + promise() {} +} +function mockSimpleGrpcMethod( + expectedRequest: {}, + response: {} | null, + error: FakeError | null +) { + return (actualRequest: {}, options: {}, callback: Callback) => { + assert.deepStrictEqual(actualRequest, expectedRequest); + if (error) { + callback(error); + } else if (response) { + callback(null, response); + } else { + callback(null); + } + }; +} +function mockLongRunningGrpcMethod( + expectedRequest: {}, + response: {} | null, + error?: {} | null +) { + return (request: {}) => { + assert.deepStrictEqual(request, expectedRequest); + const mockOperation = { + promise() { + return new Promise((resolve, reject) => { + if (error) { + reject(error); + } else { + resolve([response]); + } + }); + }, + }; + return Promise.resolve([mockOperation]); + }; +} +describe('v1beta.RealmsServiceClient', () => { + 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); + }); + describe('listRealms', () => { + it('invokes listRealms without error', done => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IListRealmsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.listRealms = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.listRealms(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes listRealms with error', done => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IListRealmsRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.listRealms = mockSimpleGrpcMethod( + request, + null, + error + ); + client.listRealms(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('getRealm', () => { + it('invokes getRealm without error', done => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IGetRealmRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getRealm = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.getRealm(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes getRealm with error', done => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IGetRealmRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.getRealm = mockSimpleGrpcMethod( + request, + null, + error + ); + client.getRealm(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('previewRealmUpdate', () => { + it('invokes previewRealmUpdate without error', done => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest = {}; + request.realm = {}; + request.realm.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.previewRealmUpdate = mockSimpleGrpcMethod( + request, + expectedResponse, + null + ); + client.previewRealmUpdate(request, (err: {}, response: {}) => { + assert.ifError(err); + assert.deepStrictEqual(response, expectedResponse); + done(); + }); + }); + + it('invokes previewRealmUpdate with error', done => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest = {}; + request.realm = {}; + request.realm.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.previewRealmUpdate = mockSimpleGrpcMethod( + request, + null, + error + ); + client.previewRealmUpdate(request, (err: FakeError, response: {}) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + assert(typeof response === 'undefined'); + done(); + }); + }); + }); + describe('createRealm', () => { + it('invokes createRealm without error', done => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.ICreateRealmRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createRealm = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .createRealm(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes createRealm with error', done => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.ICreateRealmRequest = {}; + request.parent = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.createRealm = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .createRealm(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('deleteRealm', () => { + it('invokes deleteRealm without error', done => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IDeleteRealmRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteRealm = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .deleteRealm(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes deleteRealm with error', done => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IDeleteRealmRequest = {}; + request.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.deleteRealm = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .deleteRealm(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); + describe('updateRealm', () => { + it('invokes updateRealm without error', done => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IUpdateRealmRequest = {}; + request.realm = {}; + request.realm.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateRealm = mockLongRunningGrpcMethod( + request, + expectedResponse + ); + client + .updateRealm(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then((responses: [Operation]) => { + assert.deepStrictEqual(responses[0], expectedResponse); + done(); + }) + .catch((err: {}) => { + done(err); + }); + }); + + it('invokes updateRealm with error', done => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + // Mock request + const request: protosTypes.google.cloud.gaming.v1beta.IUpdateRealmRequest = {}; + request.realm = {}; + request.realm.name = ''; + // Mock response + const expectedResponse = {}; + // Mock gRPC layer + client._innerApiCalls.updateRealm = mockLongRunningGrpcMethod( + request, + null, + error + ); + client + .updateRealm(request) + .then((responses: [Operation]) => { + const operation = responses[0]; + return operation ? operation.promise() : {}; + }) + .then(() => { + assert.fail(); + }) + .catch((err: FakeError) => { + assert(err instanceof FakeError); + assert.strictEqual(err.code, FAKE_STATUS_CODE); + done(); + }); + }); + }); +}); diff --git a/packages/google-cloud-gaming/tsconfig.json b/packages/google-cloud-gaming/tsconfig.json new file mode 100644 index 00000000000..613d35597b5 --- /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": [ + "es2016", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/packages/google-cloud-gaming/tslint.json b/packages/google-cloud-gaming/tslint.json new file mode 100644 index 00000000000..617dc975bae --- /dev/null +++ b/packages/google-cloud-gaming/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "gts/tslint.json" +} diff --git a/packages/google-cloud-gaming/webpack.config.js b/packages/google-cloud-gaming/webpack.config.js new file mode 100644 index 00000000000..f94b68d05c6 --- /dev/null +++ b/packages/google-cloud-gaming/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2019 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT 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', +}; From d34f2b188e2a225cf4a120e9e7571f7d4bddf3fa Mon Sep 17 00:00:00 2001 From: Eric Schmidt Date: Mon, 10 Feb 2020 14:25:58 -0800 Subject: [PATCH 002/180] Adds skip rules for linkinator --- packages/google-cloud-gaming/.gitignore | 2 ++ packages/google-cloud-gaming/linkinator.config.json | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/.gitignore b/packages/google-cloud-gaming/.gitignore index 5d32b23782f..e68581533de 100644 --- a/packages/google-cloud-gaming/.gitignore +++ b/packages/google-cloud-gaming/.gitignore @@ -12,3 +12,5 @@ system-test/*key.json .DS_Store package-lock.json __pycache__ +*.code-workspace + diff --git a/packages/google-cloud-gaming/linkinator.config.json b/packages/google-cloud-gaming/linkinator.config.json index b555215ca02..76c36e4fff0 100644 --- a/packages/google-cloud-gaming/linkinator.config.json +++ b/packages/google-cloud-gaming/linkinator.config.json @@ -3,6 +3,8 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "img.shields.io" + "img.shields.io", + "https://googleapis.dev/nodejs/game-services/latest", + "https://www.npmjs.org/package/@google-cloud/game-servers" ] } From 9385315dcd4b5413e4139e14d13c77831991de8c Mon Sep 17 00:00:00 2001 From: Eric Schmidt Date: Tue, 11 Feb 2020 14:21:43 -0800 Subject: [PATCH 003/180] feat: updates package.json files and quickstart --- packages/google-cloud-gaming/package.json | 4 +++- .../google-cloud-gaming/samples/package.json | 2 +- .../samples/test/quickstart.js | 20 +++++++++---------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index b9880545d24..76dcc003a29 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -25,7 +25,9 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^1.12.0" + "google-gax": "^1.12.0", + "node": "^13.8.0", + "node-gyp": "^6.1.0" }, "devDependencies": { "@types/mocha": "^5.2.5", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index 1202f25b5d3..7e445c2d4a5 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^1.0.1" + "@google-cloud/game-servers": "^0.1.0" }, "devDependencies": { "c8": "^5.0.1", diff --git a/packages/google-cloud-gaming/samples/test/quickstart.js b/packages/google-cloud-gaming/samples/test/quickstart.js index 5a021415dcd..e8365800a02 100644 --- a/packages/google-cloud-gaming/samples/test/quickstart.js +++ b/packages/google-cloud-gaming/samples/test/quickstart.js @@ -16,19 +16,19 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -"use strict"; +'use strict'; -const path = require("path"); -const { assert } = require("chai"); -const cp = require("child_process"); -const { describe, it } = require("mocha"); +const path = require('path'); +const {assert} = require('chai'); +const cp = require('child_process'); +const {describe, it} = require('mocha'); -const execSync = cmd => cp.execSync(cmd, { encoding: "utf-8" }); +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); -const cwd = path.join(__dirname, ".."); +const cwd = path.join(__dirname, '..'); -describe("Quickstart", () => { - it("should run quickstart", async () => { - const stdout = execSync(`node ./samples/quickstart.js`, { cwd }); +describe('Quickstart', () => { + it('should run quickstart', async () => { + const stdout = execSync(`node quickstart.js`, {cwd}); }); }); From 6bc706f166dff9eb22df6d6464418b57275a981f Mon Sep 17 00:00:00 2001 From: Eric Schmidt Date: Fri, 21 Feb 2020 14:50:55 -0800 Subject: [PATCH 004/180] Adds quickstart --- packages/google-cloud-gaming/.gitignore | 2 +- .../google-cloud-gaming/samples/quickstart.js | 36 +++++++++++++++---- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-gaming/.gitignore b/packages/google-cloud-gaming/.gitignore index e68581533de..d313cfabc06 100644 --- a/packages/google-cloud-gaming/.gitignore +++ b/packages/google-cloud-gaming/.gitignore @@ -13,4 +13,4 @@ system-test/*key.json package-lock.json __pycache__ *.code-workspace - +launch.json diff --git a/packages/google-cloud-gaming/samples/quickstart.js b/packages/google-cloud-gaming/samples/quickstart.js index 4b8eca19b83..197b63d827b 100644 --- a/packages/google-cloud-gaming/samples/quickstart.js +++ b/packages/google-cloud-gaming/samples/quickstart.js @@ -14,13 +14,37 @@ 'use strict'; /** -* DESCRIBE WHAT THIS SAMPLE DOES. -* @param {string} LIST EXPECTED ARGUMENTS. -*/ -async function main() { -// [START LIBRARY_NAME_quickstart] + * Create a Game Servers realm. + * @param {string} projectId string project identifier. + * @param {string} location Compute Engine region. + */ +async function main(projectId, location) { + // [START game_servers_quickstart] + const {RealmsServiceClient} = require('@google-cloud/game-servers'); -// [END LIBRARY_NAME_quickstart] + const client = new RealmsServiceClient(); + + const request = { + parent: `projects/${projectId}/locations/${location}`, + realmId: 'my-realm', + 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}`); + // [END game_servers_quickstart] } main(...process.argv.slice(2)).catch(err => { From 38d4a36c4a06d5ecab1403537ad43b9199dffbd7 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 1 Mar 2020 10:11:21 -0800 Subject: [PATCH 005/180] build: get the build passing (#17) --- packages/google-cloud-gaming/.gitignore | 2 - packages/google-cloud-gaming/.jsdoc.js | 13 +++-- packages/google-cloud-gaming/README.md | 44 +++++++++++++++- .../linkinator.config.json | 3 +- packages/google-cloud-gaming/package.json | 9 ++-- .../google-cloud-gaming/samples/README.md | 50 ++++++++++++++++++ .../google-cloud-gaming/samples/package.json | 3 +- .../google-cloud-gaming/samples/quickstart.js | 51 ++++++++++++------- .../samples/test/quickstart.js | 28 ++++++++-- packages/google-cloud-gaming/src/index.ts | 2 + packages/google-cloud-gaming/synth.metadata | 9 ++-- 11 files changed, 171 insertions(+), 43 deletions(-) create mode 100644 packages/google-cloud-gaming/samples/README.md diff --git a/packages/google-cloud-gaming/.gitignore b/packages/google-cloud-gaming/.gitignore index d313cfabc06..5d32b23782f 100644 --- a/packages/google-cloud-gaming/.gitignore +++ b/packages/google-cloud-gaming/.gitignore @@ -12,5 +12,3 @@ system-test/*key.json .DS_Store package-lock.json __pycache__ -*.code-workspace -launch.json diff --git a/packages/google-cloud-gaming/.jsdoc.js b/packages/google-cloud-gaming/.jsdoc.js index 8dc1e9dca09..824912fc39d 100644 --- a/packages/google-cloud-gaming/.jsdoc.js +++ b/packages/google-cloud-gaming/.jsdoc.js @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. // +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** 'use strict'; @@ -31,16 +34,20 @@ module.exports = { source: { excludePattern: '(^|\\/|\\\\)[._]', include: [ - 'build/src' + 'build/src', + 'protos' ], includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2018 Google, LLC.', + copyright: 'Copyright 2019 Google, LLC.', includeDate: false, sourceFiles: false, systemName: '@google-cloud/game-servers', - theme: 'lumen' + theme: 'lumen', + default: { + outputSourceFiles: false + } }, markdown: { idInHeadings: true diff --git a/packages/google-cloud-gaming/README.md b/packages/google-cloud-gaming/README.md index 7d1a53afd2f..70a96afa07f 100644 --- a/packages/google-cloud-gaming/README.md +++ b/packages/google-cloud-gaming/README.md @@ -29,8 +29,8 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. * [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) @@ -52,6 +52,46 @@ npm install @google-cloud/game-servers ``` +### Using the client library + +```javascript + const {RealmsServiceClient} = require('@google-cloud/game-servers'); + + const client = new RealmsServiceClient(); + + const request = { + parent: `projects/${projectId}/locations/${location}`, + realmId: 'my-realm', + 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}`); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-game-servers/tree/master/samples) directory. The samples' `README.md` +has instructions for running the samples. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Quickstart | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | diff --git a/packages/google-cloud-gaming/linkinator.config.json b/packages/google-cloud-gaming/linkinator.config.json index 76c36e4fff0..bb699db7901 100644 --- a/packages/google-cloud-gaming/linkinator.config.json +++ b/packages/google-cloud-gaming/linkinator.config.json @@ -4,7 +4,6 @@ "https://codecov.io/gh/googleapis/", "www.googleapis.com", "img.shields.io", - "https://googleapis.dev/nodejs/game-services/latest", - "https://www.npmjs.org/package/@google-cloud/game-servers" + "https://googleapis.dev/nodejs/game-services/latest" ] } diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 76dcc003a29..5c612e0288f 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -22,12 +22,11 @@ "prepare": "npm run compile-protos && npm run compile", "system-test": "c8 mocha build/system-test", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", - "test": "c8 mocha build/test" + "test": "c8 mocha build/test", + "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { - "google-gax": "^1.12.0", - "node": "^13.8.0", - "node-gyp": "^6.1.0" + "google-gax": "^1.14.2" }, "devDependencies": { "@types/mocha": "^5.2.5", @@ -41,7 +40,7 @@ "jsdoc": "^3.5.5", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", - "linkinator": "^1.5.0", + "linkinator": "^2.0.3", "mocha": "^6.0.0", "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", diff --git a/packages/google-cloud-gaming/samples/README.md b/packages/google-cloud-gaming/samples/README.md new file mode 100644 index 00000000000..3ef463220e1 --- /dev/null +++ b/packages/google-cloud-gaming/samples/README.md @@ -0,0 +1,50 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Google Cloud Game Servers: Node.js Samples](https://github.com/googleapis/nodejs-game-servers) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/nodejs-game-servers#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Quickstart + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node samples/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/game-servers/ diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index 7e445c2d4a5..c844a88d0c6 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -18,6 +18,7 @@ "devDependencies": { "c8": "^5.0.1", "chai": "^4.2.0", - "mocha": "^6.1.4" + "mocha": "^6.1.4", + "uuid": "^7.0.1" } } diff --git a/packages/google-cloud-gaming/samples/quickstart.js b/packages/google-cloud-gaming/samples/quickstart.js index 197b63d827b..a6dc596f2b3 100644 --- a/packages/google-cloud-gaming/samples/quickstart.js +++ b/packages/google-cloud-gaming/samples/quickstart.js @@ -13,37 +13,50 @@ '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. */ -async function main(projectId, location) { +async function main(projectId, location, realmId) { // [START game_servers_quickstart] const {RealmsServiceClient} = require('@google-cloud/game-servers'); - const client = new RealmsServiceClient(); + 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 realIm = 'DESIRED_REALM_ID'; - const request = { - parent: `projects/${projectId}/locations/${location}`, - realmId: 'my-realm', - 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 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; + const [operation] = await client.createRealm(request); + const results = await operation.promise(); + const [realm] = results; - console.log('Realm created:'); + console.log('Realm created:'); - console.log(`\tRealm name: ${realm.name}`); - console.log(`\tRealm description: ${realm.description}`); - console.log(`\tRealm time zone: ${realm.timeZone}`); + console.log(`\tRealm name: ${realm.name}`); + console.log(`\tRealm description: ${realm.description}`); + console.log(`\tRealm time zone: ${realm.timeZone}`); + } + quickstart(); // [END game_servers_quickstart] } diff --git a/packages/google-cloud-gaming/samples/test/quickstart.js b/packages/google-cloud-gaming/samples/test/quickstart.js index e8365800a02..1c04c5ac07d 100644 --- a/packages/google-cloud-gaming/samples/test/quickstart.js +++ b/packages/google-cloud-gaming/samples/test/quickstart.js @@ -18,17 +18,35 @@ 'use strict'; -const path = require('path'); const {assert} = require('chai'); const cp = require('child_process'); -const {describe, it} = require('mocha'); +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'}); -const cwd = path.join(__dirname, '..'); - 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`, {cwd}); + const stdout = execSync( + `node quickstart.js ${projectId} ${location} ${realmId}` + ); + assert.include(stdout, 'Realm created:'); + }); + + after(async () => { + await client.deleteRealm({ + name: client.realmPath(projectId, location, realmId), + }); }); }); diff --git a/packages/google-cloud-gaming/src/index.ts b/packages/google-cloud-gaming/src/index.ts index a6996245a82..8203dad4994 100644 --- a/packages/google-cloud-gaming/src/index.ts +++ b/packages/google-cloud-gaming/src/index.ts @@ -38,3 +38,5 @@ export default { GameServerDeploymentsServiceClient, RealmsServiceClient, }; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 8585f8cae75..42811922cb7 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -1,19 +1,20 @@ { - "updateTime": "2020-02-10T21:21:11.414668Z", + "updateTime": "2020-03-01T12:27:13.049881Z", "sources": [ { "git": { "name": "googleapis-private", "remote": "https://github.com/googleapis/googleapis-private.git", - "sha": "a1f5059959398f6278a600b81bbf2828141e1a69", - "internalRef": "293086097" + "sha": "93896777e78b247f3a2228bde08b1fe1cf4179a5", + "internalRef": "295938567", + "log": "93896777e78b247f3a2228bde08b1fe1cf4179a5\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 295938567\n\n" } }, { "template": { "name": "node_library", "origin": "synthtool.gcp", - "version": "2019.10.17" + "version": "2020.2.4" } } ], From f1571c4b8fb26a233bfb9a7663f775fcd6aa052c Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sun, 1 Mar 2020 10:25:06 -0800 Subject: [PATCH 006/180] build: get sample and system tests passing (#18) --- packages/google-cloud-gaming/README.md | 56 +++++++++++-------- packages/google-cloud-gaming/package.json | 4 +- .../google-cloud-gaming/samples/README.md | 8 ++- .../samples/test/quickstart.js | 3 +- packages/google-cloud-gaming/synth.metadata | 5 +- 5 files changed, 43 insertions(+), 33 deletions(-) diff --git a/packages/google-cloud-gaming/README.md b/packages/google-cloud-gaming/README.md index 70a96afa07f..ee58f23720c 100644 --- a/packages/google-cloud-gaming/README.md +++ b/packages/google-cloud-gaming/README.md @@ -11,7 +11,7 @@ -Gaming client for Node.js +Game service client for Node.js * [Google Cloud Game Servers Node.js Client API Reference][client-docs] @@ -57,28 +57,36 @@ npm install @google-cloud/game-servers ```javascript const {RealmsServiceClient} = require('@google-cloud/game-servers'); - const client = new RealmsServiceClient(); - - const request = { - parent: `projects/${projectId}/locations/${location}`, - realmId: 'my-realm', - 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}`); + 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 realIm = '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(); ``` @@ -91,7 +99,7 @@ has instructions for running the samples. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Quickstart | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Create Game Server Realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 5c612e0288f..f6134e8327b 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,8 +1,8 @@ { "name": "@google-cloud/game-servers", "version": "0.1.0", - "description": "Gaming client for Node.js", - "repository": "googleapis/nodejs-gaming", + "description": "Game service client for Node.js", + "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", "author": "Google LLC", "files": [ diff --git a/packages/google-cloud-gaming/samples/README.md b/packages/google-cloud-gaming/samples/README.md index 3ef463220e1..7ec52a6728a 100644 --- a/packages/google-cloud-gaming/samples/README.md +++ b/packages/google-cloud-gaming/samples/README.md @@ -12,7 +12,7 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) - * [Quickstart](#quickstart) + * [Create Game Server Realm](#create-game-server-realm) ## Before you begin @@ -29,7 +29,9 @@ Before running the samples, make sure you've followed the steps outlined in -### Quickstart +### Create Game Server Realm + +Creates a new Realm within Cloud Game Servers View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/quickstart.js). @@ -38,7 +40,7 @@ View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/ma __Usage:__ -`node samples/quickstart.js` +`node quickstart.js ` diff --git a/packages/google-cloud-gaming/samples/test/quickstart.js b/packages/google-cloud-gaming/samples/test/quickstart.js index 1c04c5ac07d..e9faf4f0756 100644 --- a/packages/google-cloud-gaming/samples/test/quickstart.js +++ b/packages/google-cloud-gaming/samples/test/quickstart.js @@ -45,8 +45,9 @@ describe('Quickstart', () => { }); after(async () => { - await client.deleteRealm({ + const [operation] = await client.deleteRealm({ name: client.realmPath(projectId, location, realmId), }); + await operation.promise(); }); }); diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 42811922cb7..3dc4d906271 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -1,13 +1,12 @@ { - "updateTime": "2020-03-01T12:27:13.049881Z", + "updateTime": "2020-03-01T18:18:36.980720Z", "sources": [ { "git": { "name": "googleapis-private", "remote": "https://github.com/googleapis/googleapis-private.git", "sha": "93896777e78b247f3a2228bde08b1fe1cf4179a5", - "internalRef": "295938567", - "log": "93896777e78b247f3a2228bde08b1fe1cf4179a5\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 295938567\n\n" + "internalRef": "295938567" } }, { From 5e38dd564c08cdacfde5c5d18e46c933417cfecd Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 1 Mar 2020 19:32:03 +0100 Subject: [PATCH 007/180] chore(deps): update dependency @types/mocha (#1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@types/mocha](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | devDependencies | major | [`^5.2.5` -> `^7.0.0`](https://renovatebot.com/diffs/npm/@types%2fmocha/5.2.7/7.0.1) | | [mocha](https://mochajs.org/) ([source](https://togithub.com/mochajs/mocha)) | devDependencies | major | [`^6.1.4` -> `^7.0.0`](https://renovatebot.com/diffs/npm/mocha/6.2.2/7.1.0) | --- ### Release Notes
mochajs/mocha ### [`v7.1.0`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​710--2020-02-26) [Compare Source](https://togithub.com/mochajs/mocha/compare/v7.0.1...v7.1.0) #### :tada: Enhancements [#​4038](https://togithub.com/mochajs/mocha/issues/4038): Add Node.js native ESM support ([**@​giltayar**](https://togithub.com/giltayar)) Mocha supports writing your test files as ES modules: - Node.js only v12.11.0 and above - Node.js below v13.2.0, you must set `--experimental-modules` option - current limitations: please check our [documentation](https://mochajs.org/#nodejs-native-esm-support) - for programmatic usage: see [API: loadFilesAsync()](https://mochajs.org/api/mocha#loadFilesAsync) **Note:** Node.JS native [ECMAScript Modules](https://nodejs.org/api/esm.html) implementation has status: **Stability: 1 - Experimental** #### :bug: Fixes - [#​4181](https://togithub.com/mochajs/mocha/issues/4181): Programmatic API cannot access retried test objects ([**@​juergba**](https://togithub.com/juergba)) - [#​4174](https://togithub.com/mochajs/mocha/issues/4174): Browser: fix `allowUncaught` option ([**@​juergba**](https://togithub.com/juergba)) #### :book: Documentation - [#​4058](https://togithub.com/mochajs/mocha/issues/4058): Manage author list in AUTHORS instead of `package.json` ([**@​outsideris**](https://togithub.com/outsideris)) #### :nut_and_bolt: Other - [#​4138](https://togithub.com/mochajs/mocha/issues/4138): Upgrade ESLint v6.8 ([**@​kaicataldo**](https://togithub.com/kaicataldo)) ### [`v7.0.1`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​701--2020-01-25) [Compare Source](https://togithub.com/mochajs/mocha/compare/v7.0.0...v7.0.1) #### :bug: Fixes - [#​4165](https://togithub.com/mochajs/mocha/issues/4165): Fix exception when skipping tests programmatically ([**@​juergba**](https://togithub.com/juergba)) - [#​4153](https://togithub.com/mochajs/mocha/issues/4153): Restore backwards compatibility for `reporterOptions` ([**@​holm**](https://togithub.com/holm)) - [#​4150](https://togithub.com/mochajs/mocha/issues/4150): Fix recovery of an open test upon uncaught exception ([**@​juergba**](https://togithub.com/juergba)) - [#​4147](https://togithub.com/mochajs/mocha/issues/4147): Fix regression of leaking uncaught exception handler ([**@​juergba**](https://togithub.com/juergba)) #### :book: Documentation - [#​4146](https://togithub.com/mochajs/mocha/issues/4146): Update copyright & trademark notices per OJSF ([**@​boneskull**](https://togithub.com/boneskull)) - [#​4140](https://togithub.com/mochajs/mocha/issues/4140): Fix broken links ([**@​KyoungWan**](https://togithub.com/KyoungWan)) #### :nut_and_bolt: Other - [#​4133](https://togithub.com/mochajs/mocha/issues/4133): Print more descriptive error message ([**@​Zirak**](https://togithub.com/Zirak)) ### [`v7.0.0`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​700--2020-01-05) [Compare Source](https://togithub.com/mochajs/mocha/compare/v6.2.2...v7.0.0) #### :boom: Breaking Changes - [#​3885](https://togithub.com/mochajs/mocha/issues/3885): **Drop Node.js v6.x support** ([**@​mojosoeun**](https://togithub.com/mojosoeun)) - [#​3890](https://togithub.com/mochajs/mocha/issues/3890): Remove Node.js debug-related flags `--debug`/`--debug-brk` and deprecate `debug` argument ([**@​juergba**](https://togithub.com/juergba)) - [#​3962](https://togithub.com/mochajs/mocha/issues/3962): Changes to command-line options ([**@​ParkSB**](https://togithub.com/ParkSB)): - `--list-interfaces` replaces `--interfaces` - `--list-reporters` replaces `--reporters` - Hook pattern of `this.skip()` ([**@​juergba**](https://togithub.com/juergba)): - [#​3859](https://togithub.com/mochajs/mocha/issues/3859): When conditionally skipping in a `it` test, related `afterEach` hooks are now executed - [#​3741](https://togithub.com/mochajs/mocha/issues/3741): When conditionally skipping in a `beforeEach` hook, subsequent inner `beforeEach` hooks are now skipped and related `afterEach` hooks are executed - [#​4136](https://togithub.com/mochajs/mocha/issues/4136): Disallow `this.skip()` within `after` hooks - [#​3967](https://togithub.com/mochajs/mocha/issues/3967): Remove deprecated `getOptions()` and `lib/cli/options.js` ([**@​juergba**](https://togithub.com/juergba)) - [#​4083](https://togithub.com/mochajs/mocha/issues/4083): Uncaught exception in `pending` test: don't swallow, but retrospectively fail the test for correct exit code ([**@​juergba**](https://togithub.com/juergba)) - [#​4004](https://togithub.com/mochajs/mocha/issues/4004): Align `Mocha` constructor's option names with command-line options ([**@​juergba**](https://togithub.com/juergba)) #### :tada: Enhancements - [#​3980](https://togithub.com/mochajs/mocha/issues/3980): Refactor and improve `--watch` mode with chokidar ([**@​geigerzaehler**](https://togithub.com/geigerzaehler)): - adds command-line options `--watch-files` and `--watch-ignore` - removes `--watch-extensions` - [#​3979](https://togithub.com/mochajs/mocha/issues/3979): Type "rs\\n" to restart tests ([**@​broofa**](https://togithub.com/broofa)) #### :fax: Deprecations These are _soft_-deprecated, and will emit a warning upon use. Support will be removed in (likely) the next major version of Mocha: - [#​3968](https://togithub.com/mochajs/mocha/issues/3968): Deprecate legacy configuration via `mocha.opts` ([**@​juergba**](https://togithub.com/juergba)) #### :bug: Fixes - [#​4125](https://togithub.com/mochajs/mocha/issues/4125): Fix timeout handling with `--inspect-brk`/`--inspect` ([**@​juergba**](https://togithub.com/juergba)) - [#​4070](https://togithub.com/mochajs/mocha/issues/4070): `Mocha` constructor: improve browser setup ([**@​juergba**](https://togithub.com/juergba)) - [#​4068](https://togithub.com/mochajs/mocha/issues/4068): XUnit reporter should handle exceptions during diff generation ([**@​rgroothuijsen**](https://togithub.com/rgroothuijsen)) - [#​4030](https://togithub.com/mochajs/mocha/issues/4030): Fix `--allow-uncaught` with `this.skip()` ([**@​juergba**](https://togithub.com/juergba)) #### :mag: Coverage - [#​4109](https://togithub.com/mochajs/mocha/issues/4109): Add Node.js v13.x to CI test matrix ([**@​juergba**](https://togithub.com/juergba)) #### :book: Documentation - [#​4129](https://togithub.com/mochajs/mocha/issues/4129): Fix broken links ([**@​SaeromB**](https://togithub.com/SaeromB)) - [#​4127](https://togithub.com/mochajs/mocha/issues/4127): Add reporter alias names to docs ([**@​khg0712**](https://togithub.com/khg0712)) - [#​4101](https://togithub.com/mochajs/mocha/issues/4101): Clarify invalid usage of `done()` ([**@​jgehrcke**](https://togithub.com/jgehrcke)) - [#​4092](https://togithub.com/mochajs/mocha/issues/4092): Replace `:coffee:` with emoji ☕️ ([**@​pzrq**](https://togithub.com/pzrq)) - [#​4088](https://togithub.com/mochajs/mocha/issues/4088): Initial draft of project charter ([**@​boneskull**](https://togithub.com/boneskull)) - [#​4066](https://togithub.com/mochajs/mocha/issues/4066): Change `sh` to `bash` for code block in docs/index.md ([**@​HyunSangHan**](https://togithub.com/HyunSangHan)) - [#​4045](https://togithub.com/mochajs/mocha/issues/4045): Update README.md concerning GraphicsMagick installation ([**@​HyunSangHan**](https://togithub.com/HyunSangHan)) - [#​3988](https://togithub.com/mochajs/mocha/issues/3988): Fix sponsors background color for readability ([**@​outsideris**](https://togithub.com/outsideris)) #### :nut_and_bolt: Other - [#​4118](https://togithub.com/mochajs/mocha/issues/4118): Update node-environment-flags to 1.0.6 ([**@​kylef**](https://togithub.com/kylef)) - [#​4097](https://togithub.com/mochajs/mocha/issues/4097): Add GH Funding Metadata ([**@​SheetJSDev**](https://togithub.com/SheetJSDev)) - [#​4089](https://togithub.com/mochajs/mocha/issues/4089): Add funding information to `package.json` ([**@​Munter**](https://togithub.com/Munter)) - [#​4077](https://togithub.com/mochajs/mocha/issues/4077): Improve integration tests ([**@​soobing**](https://togithub.com/soobing))
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :ghost: **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/config-help/issues) if that's undesired. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 4 ++-- packages/google-cloud-gaming/samples/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index f6134e8327b..ae1bd6d936d 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -29,7 +29,7 @@ "google-gax": "^1.14.2" }, "devDependencies": { - "@types/mocha": "^5.2.5", + "@types/mocha": "^7.0.0", "@types/node": "^12.0.0", "c8": "^6.0.0", "eslint": "^6.8.0", @@ -41,7 +41,7 @@ "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", "linkinator": "^2.0.3", - "mocha": "^6.0.0", + "mocha": "^7.0.0", "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", "prettier": "^1.19.1", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index c844a88d0c6..d1d2cdd9028 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -18,7 +18,7 @@ "devDependencies": { "c8": "^5.0.1", "chai": "^4.2.0", - "mocha": "^6.1.4", + "mocha": "^7.0.0", "uuid": "^7.0.1" } } From 9d73f75cdc451de6b2372df54790c972f71914ec Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 1 Mar 2020 19:38:03 +0100 Subject: [PATCH 008/180] chore(deps): update dependency c8 to v7 (#2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [c8](https://togithub.com/bcoe/c8) | devDependencies | major | [`^5.0.1` -> `^7.0.0`](https://renovatebot.com/diffs/npm/c8/5.0.4/7.1.0) | | [c8](https://togithub.com/bcoe/c8) | devDependencies | major | [`^6.0.0` -> `^7.0.0`](https://renovatebot.com/diffs/npm/c8/6.0.1/7.1.0) | --- ### Release Notes
bcoe/c8 ### [`v7.1.0`](https://togithub.com/bcoe/c8/blob/master/CHANGELOG.md#​710httpswwwgithubcombcoec8comparev701v710-2020-02-09) [Compare Source](https://togithub.com/bcoe/c8/compare/v7.0.1...v7.1.0) ##### Features - adds TypeScript definitions ([d39801b](https://www.github.com/bcoe/c8/commit/d39801bc9b2713aa56592010e6394a295bd12b0b)), closes [#​195](https://www.github.com/bcoe/c8/issues/195) ##### Bug Fixes - **deps:** update dependency furi to v2 ([#​193](https://www.github.com/bcoe/c8/issues/193)) ([6b9af6e](https://www.github.com/bcoe/c8/commit/6b9af6ee8cbbacd85eea91dc49bb269fe3651c12)) - **deps:** v8-to-istanbul with patch for crasher ([#​200](https://www.github.com/bcoe/c8/issues/200)) ([d4b7d80](https://www.github.com/bcoe/c8/commit/d4b7d80d78f3d1cb2e9a2e9e106af0cef327b446)) ##### [7.0.1](https://www.github.com/bcoe/c8/compare/v7.0.0...v7.0.1) (2020-01-13) ##### Bug Fixes - all flag not propagated to check-coverage command ([#​188](https://www.github.com/bcoe/c8/issues/188)) ([86eaf72](https://www.github.com/bcoe/c8/commit/86eaf72a8c7af93d6ec9699b741d11df50017a8d)) ### [`v7.0.1`](https://togithub.com/bcoe/c8/blob/master/CHANGELOG.md#​710httpswwwgithubcombcoec8comparev701v710-2020-02-09) [Compare Source](https://togithub.com/bcoe/c8/compare/v7.0.0...v7.0.1) ##### Features - adds TypeScript definitions ([d39801b](https://www.github.com/bcoe/c8/commit/d39801bc9b2713aa56592010e6394a295bd12b0b)), closes [#​195](https://www.github.com/bcoe/c8/issues/195) ##### Bug Fixes - **deps:** update dependency furi to v2 ([#​193](https://www.github.com/bcoe/c8/issues/193)) ([6b9af6e](https://www.github.com/bcoe/c8/commit/6b9af6ee8cbbacd85eea91dc49bb269fe3651c12)) - **deps:** v8-to-istanbul with patch for crasher ([#​200](https://www.github.com/bcoe/c8/issues/200)) ([d4b7d80](https://www.github.com/bcoe/c8/commit/d4b7d80d78f3d1cb2e9a2e9e106af0cef327b446)) ##### [7.0.1](https://www.github.com/bcoe/c8/compare/v7.0.0...v7.0.1) (2020-01-13) ##### Bug Fixes - all flag not propagated to check-coverage command ([#​188](https://www.github.com/bcoe/c8/issues/188)) ([86eaf72](https://www.github.com/bcoe/c8/commit/86eaf72a8c7af93d6ec9699b741d11df50017a8d)) ### [`v7.0.0`](https://togithub.com/bcoe/c8/blob/master/CHANGELOG.md#​700httpswwwgithubcombcoec8comparev601v700-2019-12-22) [Compare Source](https://togithub.com/bcoe/c8/compare/v6.0.1...v7.0.0) ##### ⚠ BREAKING CHANGES - new test-exclude with modified exclude rules ([#​179](https://togithub.com/bcoe/c8/issues/179)) - **istanbul-reports:** lcov reports now use relative paths ([#​168](https://togithub.com/bcoe/c8/issues/168)) ##### Features - adds --all functionality ([#​158](https://www.github.com/bcoe/c8/issues/158)) ([2eb631e](https://www.github.com/bcoe/c8/commit/2eb631e460eba3d06925ee1d128e0db82ec50b6c)) - **istanbul-reports:** lcov reports now use relative paths ([#​168](https://www.github.com/bcoe/c8/issues/168)) ([35d9338](https://www.github.com/bcoe/c8/commit/35d9338b69ba803c19a19d16ff601e3ec5692fa6)) - new test-exclude with modified exclude rules ([#​179](https://www.github.com/bcoe/c8/issues/179)) ([af7d94d](https://www.github.com/bcoe/c8/commit/af7d94d715ab98d67e6b5bff5dfba19430681c9c)) ##### Bug Fixes - **deps:** update dependency v8-to-istanbul to v4 ([#​167](https://www.github.com/bcoe/c8/issues/167)) ([97b9769](https://www.github.com/bcoe/c8/commit/97b97699870ddc4af780cedb25cbb3a87e0eb777)) - **deps:** update dependency yargs to v15 ([#​164](https://www.github.com/bcoe/c8/issues/164)) ([e41a483](https://www.github.com/bcoe/c8/commit/e41a4831aac92591f303d48038a327e9631affee)) - **deps:** update dependency yargs-parser to v16 ([#​157](https://www.github.com/bcoe/c8/issues/157)) ([15746e5](https://www.github.com/bcoe/c8/commit/15746e51640e6e172f27f02c12056e2977342005)) ##### [6.0.1](https://togithub.com/bcoe/c8/compare/v6.0.0...v6.0.1) (2019-10-26) ##### Bug Fixes - regex flags in dependency were breaking Node 8 ([a9d9645](https://togithub.com/bcoe/c8/commit/a9d9645858031cee985087828f5e04cfd8922868)) ### [`v6.0.1`](https://togithub.com/bcoe/c8/blob/master/CHANGELOG.md#​700httpswwwgithubcombcoec8comparev601v700-2019-12-22) [Compare Source](https://togithub.com/bcoe/c8/compare/v6.0.0...v6.0.1) ##### ⚠ BREAKING CHANGES - new test-exclude with modified exclude rules ([#​179](https://togithub.com/bcoe/c8/issues/179)) - **istanbul-reports:** lcov reports now use relative paths ([#​168](https://togithub.com/bcoe/c8/issues/168)) ##### Features - adds --all functionality ([#​158](https://www.github.com/bcoe/c8/issues/158)) ([2eb631e](https://www.github.com/bcoe/c8/commit/2eb631e460eba3d06925ee1d128e0db82ec50b6c)) - **istanbul-reports:** lcov reports now use relative paths ([#​168](https://www.github.com/bcoe/c8/issues/168)) ([35d9338](https://www.github.com/bcoe/c8/commit/35d9338b69ba803c19a19d16ff601e3ec5692fa6)) - new test-exclude with modified exclude rules ([#​179](https://www.github.com/bcoe/c8/issues/179)) ([af7d94d](https://www.github.com/bcoe/c8/commit/af7d94d715ab98d67e6b5bff5dfba19430681c9c)) ##### Bug Fixes - **deps:** update dependency v8-to-istanbul to v4 ([#​167](https://www.github.com/bcoe/c8/issues/167)) ([97b9769](https://www.github.com/bcoe/c8/commit/97b97699870ddc4af780cedb25cbb3a87e0eb777)) - **deps:** update dependency yargs to v15 ([#​164](https://www.github.com/bcoe/c8/issues/164)) ([e41a483](https://www.github.com/bcoe/c8/commit/e41a4831aac92591f303d48038a327e9631affee)) - **deps:** update dependency yargs-parser to v16 ([#​157](https://www.github.com/bcoe/c8/issues/157)) ([15746e5](https://www.github.com/bcoe/c8/commit/15746e51640e6e172f27f02c12056e2977342005)) ##### [6.0.1](https://togithub.com/bcoe/c8/compare/v6.0.0...v6.0.1) (2019-10-26) ##### Bug Fixes - regex flags in dependency were breaking Node 8 ([a9d9645](https://togithub.com/bcoe/c8/commit/a9d9645858031cee985087828f5e04cfd8922868)) ### [`v6.0.0`](https://togithub.com/bcoe/c8/blob/master/CHANGELOG.md#​600httpsgithubcombcoec8comparev504v600-2019-10-24) [Compare Source](https://togithub.com/bcoe/c8/compare/v5.0.4...v6.0.0) ##### ⚠ BREAKING CHANGES - Node.js' source-map and lineLength cache is now used to remap coverage output (this allows tools like ts-node to be supported, which transpile at runtime). ##### Features - use Node.js' source-map cache, to support tools like ts-node ([#​152](https://togithub.com/bcoe/c8/issues/152)) ([53bba15](https://togithub.com/bcoe/c8/commit/53bba15bee07e8f0446fd85cc59d2b562fe34a21)) ##### Bug Fixes - **deps:** update dependency yargs-parser to v15 ([#​153](https://togithub.com/bcoe/c8/issues/153)) ([80153de](https://togithub.com/bcoe/c8/commit/80153de61be8e5830f1c228945184e4878f8cf0c)) ##### [5.0.4](https://togithub.com/bcoe/c8/compare/v5.0.3...v5.0.4) (2019-09-06) ##### Bug Fixes - **deps:** merging failed when the same script occurred multiple times in the same report ([#​147](https://togithub.com/bcoe/c8/issues/147)) ([1ebcaf9](https://togithub.com/bcoe/c8/commit/1ebcaf9)) - don't load JSON that does not look like coverage ([#​146](https://togithub.com/bcoe/c8/issues/146)) ([a6481f1](https://togithub.com/bcoe/c8/commit/a6481f1)) - **deps:** update dependency yargs-parser to v14 ([#​144](https://togithub.com/bcoe/c8/issues/144)) ([9b3d089](https://togithub.com/bcoe/c8/commit/9b3d089)) ##### [5.0.3](https://www.github.com/bcoe/c8/compare/v5.0.2...v5.0.3) (2019-09-06) ##### Bug Fixes - **deps:** update dependency rimraf to v3 ([#​132](https://www.github.com/bcoe/c8/issues/132)) ([7601748](https://www.github.com/bcoe/c8/commit/7601748)) - **deps:** update dependency yargs to v14 ([#​134](https://www.github.com/bcoe/c8/issues/134)) ([e49737f](https://www.github.com/bcoe/c8/commit/e49737f)) - **deps:** update deps to address warning in cross-spawn ([#​141](https://www.github.com/bcoe/c8/issues/141)) ([4b66221](https://www.github.com/bcoe/c8/commit/4b66221)) ##### [5.0.2](https://www.github.com/bcoe/c8/compare/v5.0.1...v5.0.2) (2019-06-24) ##### Bug Fixes - HTML report now has correct source positions for Node >10.16.0 ([#​125](https://www.github.com/bcoe/c8/issues/125)) ([c49fa7f](https://www.github.com/bcoe/c8/commit/c49fa7f)) - **deps:** update dependency find-up to v4 ([#​119](https://www.github.com/bcoe/c8/issues/119)) ([c568d96](https://www.github.com/bcoe/c8/commit/c568d96)) - **deps:** update dependency yargs-parser to v13 ([#​124](https://www.github.com/bcoe/c8/issues/124)) ([1eb3394](https://www.github.com/bcoe/c8/commit/1eb3394)) - do not override NODE_V8_COVERAGE if set ([#​70](https://www.github.com/bcoe/c8/issues/70)) ([8bb67b0](https://www.github.com/bcoe/c8/commit/8bb67b0)) ##### [5.0.1](https://www.github.com/bcoe/c8/compare/v5.0.0...v5.0.1) (2019-05-20) ##### Bug Fixes - temporary files should be in tmp folder ([#​106](https://www.github.com/bcoe/c8/issues/106)) ([64dd2e6](https://www.github.com/bcoe/c8/commit/64dd2e6))
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index ae1bd6d936d..9f75640e7d7 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -31,7 +31,7 @@ "devDependencies": { "@types/mocha": "^7.0.0", "@types/node": "^12.0.0", - "c8": "^6.0.0", + "c8": "^7.0.0", "eslint": "^6.8.0", "eslint-config-prettier": "^6.10.0", "eslint-plugin-node": "^11.0.0", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index d1d2cdd9028..91be2ba1fde 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -16,7 +16,7 @@ "@google-cloud/game-servers": "^0.1.0" }, "devDependencies": { - "c8": "^5.0.1", + "c8": "^7.0.0", "chai": "^4.2.0", "mocha": "^7.0.0", "uuid": "^7.0.1" From 817ef3e544d77b2698599e56acab14935c72cd1a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 08:34:51 -0800 Subject: [PATCH 009/180] chore: release 1.0.0 (#4) * created CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] Co-authored-by: Justin Beckwith --- packages/google-cloud-gaming/CHANGELOG.md | 8 ++++++++ packages/google-cloud-gaming/package.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-gaming/CHANGELOG.md diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md new file mode 100644 index 00000000000..b8971a5e837 --- /dev/null +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +## 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/package.json b/packages/google-cloud-gaming/package.json index 9f75640e7d7..2f34834c147 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "0.1.0", + "version": "1.0.0", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index 91be2ba1fde..8d05ef4a008 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^0.1.0" + "@google-cloud/game-servers": "^1.0.0" }, "devDependencies": { "c8": "^7.0.0", From 1530a063922cd60021f304cc39af0d7235e8f0bf Mon Sep 17 00:00:00 2001 From: Eric Schmidt Date: Mon, 2 Mar 2020 16:42:59 -0800 Subject: [PATCH 010/180] feat: adds CRUD samples for GS realms (#21) * Adds Game Servers realm samples * feat: adds realm CRUD tests * feat: adds quickstart test * fix: updates region tags --- packages/google-cloud-gaming/.gitignore | 2 + .../google-cloud-gaming/samples/quickstart.js | 7 +-- .../samples/test/quickstart.test.js | 50 +++++++++++++++++++ 3 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 packages/google-cloud-gaming/samples/test/quickstart.test.js diff --git a/packages/google-cloud-gaming/.gitignore b/packages/google-cloud-gaming/.gitignore index 5d32b23782f..d313cfabc06 100644 --- a/packages/google-cloud-gaming/.gitignore +++ b/packages/google-cloud-gaming/.gitignore @@ -12,3 +12,5 @@ system-test/*key.json .DS_Store package-lock.json __pycache__ +*.code-workspace +launch.json diff --git a/packages/google-cloud-gaming/samples/quickstart.js b/packages/google-cloud-gaming/samples/quickstart.js index a6dc596f2b3..3a9c542322b 100644 --- a/packages/google-cloud-gaming/samples/quickstart.js +++ b/packages/google-cloud-gaming/samples/quickstart.js @@ -22,9 +22,10 @@ * 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 game_servers_quickstart] + // [START cloud_game_servers_quickstart] const {RealmsServiceClient} = require('@google-cloud/game-servers'); async function quickstart() { @@ -33,7 +34,7 @@ async function main(projectId, location, realmId) { // TODO(developer): uncomment the following section, and add values // const projectId = 'YOUR_PROJECT_ID'; // const location = 'us-central1; - // const realIm = 'DESIRED_REALM_ID'; + // const realmId = 'DESIRED_REALM_ID'; const request = { parent: `projects/${projectId}/locations/${location}`, @@ -57,7 +58,7 @@ async function main(projectId, location, realmId) { console.log(`\tRealm time zone: ${realm.timeZone}`); } quickstart(); - // [END game_servers_quickstart] + // [END cloud_game_servers_quickstart] } main(...process.argv.slice(2)).catch(err => { 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..74b1644527f --- /dev/null +++ b/packages/google-cloud-gaming/samples/test/quickstart.test.js @@ -0,0 +1,50 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +const {assert} = require('chai'); +const {describe, it, after} = require('mocha'); +const {RealmsServiceClient} = require('@google-cloud/game-servers'); + +const cp = require('child_process'); +const uuid = require('uuid'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const LOCATION = 'us-central1'; + +describe('Game Servers Quickstart Test', () => { + const client = new RealmsServiceClient(); + let realmId; + + it('should create a realm', async () => { + const projectId = await client.getProjectId(); + realmId = `test-${uuid.v4()}`; + + const quickstart_output = execSync( + `node quickstart.js ${projectId} ${LOCATION} ${realmId}` + ); + assert.match(quickstart_output, /Realm time zone:/); + }); + + after(async () => { + const projectId = await client.getProjectId(); + const request = { + name: `projects/${projectId}/locations/${LOCATION}/realms/${realmId}`, + }; + const [operation] = await client.deleteRealm(request); + await operation.promise(); + }); +}); From 996e75de29e7b936694c694f6caea1e6d43dbebb Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2020 16:55:19 -0800 Subject: [PATCH 011/180] chore: release 1.1.0 (#22) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json [ci skip] --- packages/google-cloud-gaming/CHANGELOG.md | 7 +++++++ packages/google-cloud-gaming/package.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index b8971a5e837..ae358dd2da6 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 2f34834c147..ca5c8154d2e 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "1.0.0", + "version": "1.1.0", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index 8d05ef4a008..b738ce91b0d 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^1.0.0" + "@google-cloud/game-servers": "^1.1.0" }, "devDependencies": { "c8": "^7.0.0", From 0254ed4290fd512b01fa6984da32ee9e0976a95c Mon Sep 17 00:00:00 2001 From: Eric Schmidt Date: Tue, 10 Mar 2020 10:13:20 -0700 Subject: [PATCH 012/180] test: adds cleanup function for tests (#28) * feat: adds cleanup function for tests --- .../google-cloud-gaming/samples/test/quickstart.test.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/samples/test/quickstart.test.js b/packages/google-cloud-gaming/samples/test/quickstart.test.js index 74b1644527f..8d370fa7d5b 100644 --- a/packages/google-cloud-gaming/samples/test/quickstart.test.js +++ b/packages/google-cloud-gaming/samples/test/quickstart.test.js @@ -15,7 +15,8 @@ 'use strict'; const {assert} = require('chai'); -const {describe, it, after} = require('mocha'); +const cleanup = require('./clean.js'); +const {describe, it, before, after} = require('mocha'); const {RealmsServiceClient} = require('@google-cloud/game-servers'); const cp = require('child_process'); @@ -29,6 +30,10 @@ describe('Game Servers Quickstart Test', () => { const client = new RealmsServiceClient(); let realmId; + before(async () => { + await cleanup(); + }); + it('should create a realm', async () => { const projectId = await client.getProjectId(); realmId = `test-${uuid.v4()}`; From 8e17b2a48e1689b1c17fbb4247fbf1f38cd58b6c Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 11 Mar 2020 16:24:07 -0700 Subject: [PATCH 013/180] build: update linkinator config (#25) --- packages/google-cloud-gaming/linkinator.config.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/linkinator.config.json b/packages/google-cloud-gaming/linkinator.config.json index bb699db7901..bcceee2ec81 100644 --- a/packages/google-cloud-gaming/linkinator.config.json +++ b/packages/google-cloud-gaming/linkinator.config.json @@ -5,5 +5,7 @@ "www.googleapis.com", "img.shields.io", "https://googleapis.dev/nodejs/game-services/latest" - ] + ], + "silent": true, + "concurrency": 10 } From f1a49b40fb454c67e158407678ae2ec5d5b66252 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 11 Mar 2020 16:48:07 -0700 Subject: [PATCH 014/180] build(tests): fix coveralls and enable build cop (#27) --- packages/google-cloud-gaming/.mocharc.js | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 packages/google-cloud-gaming/.mocharc.js diff --git a/packages/google-cloud-gaming/.mocharc.js b/packages/google-cloud-gaming/.mocharc.js new file mode 100644 index 00000000000..ff7b34fa5d1 --- /dev/null +++ b/packages/google-cloud-gaming/.mocharc.js @@ -0,0 +1,28 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +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 From abb25c0c3b02afd48e8f526910fba62f608e383f Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Thu, 19 Mar 2020 08:53:57 -0700 Subject: [PATCH 015/180] chore: remove snippet leading whitespace (#30) --- packages/google-cloud-gaming/README.md | 74 +++++++++++++++----------- 1 file changed, 42 insertions(+), 32 deletions(-) diff --git a/packages/google-cloud-gaming/README.md b/packages/google-cloud-gaming/README.md index ee58f23720c..a5cc24211c0 100644 --- a/packages/google-cloud-gaming/README.md +++ b/packages/google-cloud-gaming/README.md @@ -55,38 +55,38 @@ 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 realIm = '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(); +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(); ``` @@ -99,6 +99,10 @@ has instructions for running the samples. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | +| Create_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_realm.js,samples/README.md) | +| Delete_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_realm.js,samples/README.md) | +| Get_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_realm.js,samples/README.md) | +| List_realms | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_realms.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_realms.js,samples/README.md) | | Create Game Server Realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | @@ -128,6 +132,12 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-game-servers/blob/master/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 template in this +[directory](https://github.com/googleapis/synthtool/tree/master/synthtool/gcp/templates/node_library). + ## License Apache Version 2.0 From 5a1fe1169800d06198b27ca3f6207af4e567ccec Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 25 Mar 2020 09:52:07 -0700 Subject: [PATCH 016/180] chore: regenerate the code (#34) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR was generated using Autosynth. :rainbow:
Log from Synthtool ``` 2020-03-22 04:28:29,042 synthtool > Executing /tmpfs/src/git/autosynth/working_repo/synth.py. 2020-03-22 04:28:29,094 synthtool > Ensuring dependencies. 2020-03-22 04:28:29,099 synthtool > Cloning googleapis-private. 2020-03-22 04:28:30,886 synthtool > Pulling Docker image: gapic-generator-typescript:latest latest: Pulling from gapic-images/gapic-generator-typescript Digest: sha256:3762b8bcba247ef4d020ffc7043e2881a20b5fab0ffd98d542f365d3f3a3829d Status: Image is up to date for gcr.io/gapic-images/gapic-generator-typescript:latest 2020-03-22 04:28:31,792 synthtool > Generating code for: google/cloud/gaming/v1beta. 2020-03-22 04:28:33,083 synthtool > Generated code into /tmpfs/tmp/tmphqwgbi7o. .eslintignore .eslintrc.yml .github/ISSUE_TEMPLATE/bug_report.md .github/ISSUE_TEMPLATE/feature_request.md .github/ISSUE_TEMPLATE/support_request.md .github/PULL_REQUEST_TEMPLATE.md .github/publish.yml .github/release-please.yml .github/workflows/ci.yaml .kokoro/common.cfg .kokoro/continuous/node10/common.cfg .kokoro/continuous/node10/docs.cfg .kokoro/continuous/node10/lint.cfg .kokoro/continuous/node10/samples-test.cfg .kokoro/continuous/node10/system-test.cfg .kokoro/continuous/node10/test.cfg .kokoro/continuous/node12/common.cfg .kokoro/continuous/node12/test.cfg .kokoro/continuous/node8/common.cfg .kokoro/continuous/node8/test.cfg .kokoro/docs.sh .kokoro/lint.sh .kokoro/presubmit/node10/common.cfg .kokoro/presubmit/node10/docs.cfg .kokoro/presubmit/node10/lint.cfg .kokoro/presubmit/node10/samples-test.cfg .kokoro/presubmit/node10/system-test.cfg .kokoro/presubmit/node10/test.cfg .kokoro/presubmit/node12/common.cfg .kokoro/presubmit/node12/test.cfg .kokoro/presubmit/node8/common.cfg .kokoro/presubmit/node8/test.cfg .kokoro/presubmit/windows/common.cfg .kokoro/presubmit/windows/test.cfg .kokoro/publish.sh .kokoro/release/docs.cfg .kokoro/release/docs.sh .kokoro/release/publish.cfg .kokoro/samples-test.sh .kokoro/system-test.sh .kokoro/test.bat .kokoro/test.sh .kokoro/trampoline.sh .mocharc.js .nycrc .prettierignore .prettierrc CODE_OF_CONDUCT.md CONTRIBUTING.md LICENSE README.md codecov.yaml renovate.json samples/README.md npm WARN npm npm does not support Node.js v12.16.1 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11. npm WARN npm You can find the latest version at https://nodejs.org/ > protobufjs@6.8.9 postinstall /tmpfs/src/git/autosynth/working_repo/node_modules/protobufjs > node scripts/postinstall > @google-cloud/game-servers@1.1.0 prepare /tmpfs/src/git/autosynth/working_repo > npm run compile-protos && npm run compile npm WARN npm npm does not support Node.js v12.16.1 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11. npm WARN npm You can find the latest version at https://nodejs.org/ > @google-cloud/game-servers@1.1.0 compile-protos /tmpfs/src/git/autosynth/working_repo > compileProtos src installing semver@^5.5.0 installing uglify-js@^3.3.25 installing espree@^3.5.4 installing escodegen@^1.9.1 npm WARN npm npm does not support Node.js v12.16.1 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11. npm WARN npm You can find the latest version at https://nodejs.org/ > @google-cloud/game-servers@1.1.0 compile /tmpfs/src/git/autosynth/working_repo > tsc -p . && cp -r protos build/ npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.1 (node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/watchpack/node_modules/chokidar/node_modules/fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.12: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: abbrev@1.1.1 (node_modules/watchpack/node_modules/fsevents/node_modules/abbrev): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/abbrev' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.abbrev.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ansi-regex@2.1.1 (node_modules/watchpack/node_modules/fsevents/node_modules/ansi-regex): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/ansi-regex' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.ansi-regex.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: aproba@1.2.0 (node_modules/watchpack/node_modules/fsevents/node_modules/aproba): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/aproba' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.aproba.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: balanced-match@1.0.0 (node_modules/watchpack/node_modules/fsevents/node_modules/balanced-match): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/balanced-match' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.balanced-match.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: chownr@1.1.4 (node_modules/watchpack/node_modules/fsevents/node_modules/chownr): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/chownr' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.chownr.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: code-point-at@1.1.0 (node_modules/watchpack/node_modules/fsevents/node_modules/code-point-at): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/code-point-at' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.code-point-at.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: concat-map@0.0.1 (node_modules/watchpack/node_modules/fsevents/node_modules/concat-map): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/concat-map' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.concat-map.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: console-control-strings@1.1.0 (node_modules/watchpack/node_modules/fsevents/node_modules/console-control-strings): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/console-control-strings' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.console-control-strings.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: core-util-is@1.0.2 (node_modules/watchpack/node_modules/fsevents/node_modules/core-util-is): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/core-util-is' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.core-util-is.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: deep-extend@0.6.0 (node_modules/watchpack/node_modules/fsevents/node_modules/deep-extend): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/deep-extend' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.deep-extend.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: delegates@1.0.0 (node_modules/watchpack/node_modules/fsevents/node_modules/delegates): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/delegates' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.delegates.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: detect-libc@1.0.3 (node_modules/watchpack/node_modules/fsevents/node_modules/detect-libc): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/detect-libc' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.detect-libc.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs.realpath@1.0.0 (node_modules/watchpack/node_modules/fsevents/node_modules/fs.realpath): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/fs.realpath' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.fs.realpath.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: has-unicode@2.0.1 (node_modules/watchpack/node_modules/fsevents/node_modules/has-unicode): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/has-unicode' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.has-unicode.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: inherits@2.0.4 (node_modules/watchpack/node_modules/fsevents/node_modules/inherits): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/inherits' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.inherits.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ini@1.3.5 (node_modules/watchpack/node_modules/fsevents/node_modules/ini): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/ini' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.ini.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: isarray@1.0.0 (node_modules/watchpack/node_modules/fsevents/node_modules/isarray): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/isarray' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.isarray.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: minimist@1.2.5 (node_modules/watchpack/node_modules/fsevents/node_modules/minimist): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/minimist' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.minimist.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ms@2.1.2 (node_modules/watchpack/node_modules/fsevents/node_modules/ms): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/ms' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.ms.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: npm-normalize-package-bin@1.0.1 (node_modules/watchpack/node_modules/fsevents/node_modules/npm-normalize-package-bin): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/npm-normalize-package-bin' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.npm-normalize-package-bin.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: number-is-nan@1.0.1 (node_modules/watchpack/node_modules/fsevents/node_modules/number-is-nan): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/number-is-nan' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.number-is-nan.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: object-assign@4.1.1 (node_modules/watchpack/node_modules/fsevents/node_modules/object-assign): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/object-assign' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.object-assign.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: os-homedir@1.0.2 (node_modules/watchpack/node_modules/fsevents/node_modules/os-homedir): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/os-homedir' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.os-homedir.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: os-tmpdir@1.0.2 (node_modules/watchpack/node_modules/fsevents/node_modules/os-tmpdir): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/os-tmpdir' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.os-tmpdir.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: path-is-absolute@1.0.1 (node_modules/watchpack/node_modules/fsevents/node_modules/path-is-absolute): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/path-is-absolute' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.path-is-absolute.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: process-nextick-args@2.0.1 (node_modules/watchpack/node_modules/fsevents/node_modules/process-nextick-args): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/process-nextick-args' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.process-nextick-args.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: safe-buffer@5.1.2 (node_modules/watchpack/node_modules/fsevents/node_modules/safe-buffer): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/safe-buffer' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.safe-buffer.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: safer-buffer@2.1.2 (node_modules/watchpack/node_modules/fsevents/node_modules/safer-buffer): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/safer-buffer' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.safer-buffer.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: sax@1.2.4 (node_modules/watchpack/node_modules/fsevents/node_modules/sax): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/sax' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.sax.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: semver@5.7.1 (node_modules/watchpack/node_modules/fsevents/node_modules/semver): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/semver' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.semver.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: set-blocking@2.0.0 (node_modules/watchpack/node_modules/fsevents/node_modules/set-blocking): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/set-blocking' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.set-blocking.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: signal-exit@3.0.2 (node_modules/watchpack/node_modules/fsevents/node_modules/signal-exit): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/signal-exit' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.signal-exit.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: strip-json-comments@2.0.1 (node_modules/watchpack/node_modules/fsevents/node_modules/strip-json-comments): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/strip-json-comments' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.strip-json-comments.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: util-deprecate@1.0.2 (node_modules/watchpack/node_modules/fsevents/node_modules/util-deprecate): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/util-deprecate' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.util-deprecate.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: wrappy@1.0.2 (node_modules/watchpack/node_modules/fsevents/node_modules/wrappy): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/wrappy' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.wrappy.DELETE' npm WARN optional SKIPPING OPTIONAL DEPENDENCY: yallist@3.1.1 (node_modules/watchpack/node_modules/fsevents/node_modules/yallist): npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/yallist' -> '/tmpfs/src/git/autosynth/working_repo/node_modules/watchpack/node_modules/fsevents/node_modules/.yallist.DELETE' added 967 packages from 454 contributors and audited 6746 packages in 29.414s found 0 vulnerabilities npm WARN npm npm does not support Node.js v12.16.1 npm WARN npm You should probably upgrade to a newer version of node as we npm WARN npm can't make any promises that npm will work with this version. npm WARN npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11. npm WARN npm You can find the latest version at https://nodejs.org/ > @google-cloud/game-servers@1.1.0 fix /tmpfs/src/git/autosynth/working_repo > gts fix && eslint samples --fix /tmpfs/src/git/autosynth/working_repo/samples/create_realm.js 34:41 error "@google-cloud/game-servers" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/delete_realm.js 34:41 error "@google-cloud/game-servers" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/get_realm.js 34:41 error "@google-cloud/game-servers" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/list_realms.js 28:41 error "@google-cloud/game-servers" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/quickstart.js 29:41 error "@google-cloud/game-servers" is not found node/no-missing-require 34:5 warning Unexpected 'todo' comment no-warning-comments /tmpfs/src/git/autosynth/working_repo/samples/test/clean.js 15:51 error "@google-cloud/game-servers" is not found node/no-missing-require 16:39 error "@google-cloud/game-servers" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/create_realm.test.js 17:26 error "chai" is not found node/no-missing-require 20:39 error "@google-cloud/game-servers" is not found node/no-missing-require 23:22 error "uuid" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/delete_realm.test.js 17:26 error "chai" is not found node/no-missing-require 20:39 error "@google-cloud/game-servers" is not found node/no-missing-require 23:22 error "uuid" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/get_realm.test.js 17:26 error "chai" is not found node/no-missing-require 20:39 error "@google-cloud/game-servers" is not found node/no-missing-require 23:22 error "uuid" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/list_realms.test.js 17:26 error "chai" is not found node/no-missing-require 20:39 error "@google-cloud/game-servers" is not found node/no-missing-require 23:22 error "uuid" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/quickstart.js 21:26 error "chai" is not found node/no-missing-require 24:22 error "uuid" is not found node/no-missing-require 25:39 error "@google-cloud/game-servers" is not found node/no-missing-require /tmpfs/src/git/autosynth/working_repo/samples/test/quickstart.test.js 17:26 error "chai" is not found node/no-missing-require 20:39 error "@google-cloud/game-servers" is not found node/no-missing-require 23:22 error "uuid" is not found node/no-missing-require ✖ 26 problems (25 errors, 1 warning) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @google-cloud/game-servers@1.1.0 fix: `gts fix && eslint samples --fix` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @google-cloud/game-servers@1.1.0 fix script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /home/kbuilder/.npm/_logs/2020-03-22T11_29_21_368Z-debug.log 2020-03-22 04:29:25,572 synthtool > Wrote metadata to synth.metadata. ```
--- packages/google-cloud-gaming/.gitignore | 2 - packages/google-cloud-gaming/.jsdoc.js | 2 +- .../google-cloud-gaming/.repo-metadata.json | 2 +- packages/google-cloud-gaming/README.md | 23 +++- .../linkinator.config.json | 3 +- .../google-cloud-gaming/samples/README.md | 72 +++++++++++ packages/google-cloud-gaming/src/index.ts | 2 +- .../game_server_clusters_service_client.ts | 112 +++++++++++------ .../game_server_configs_service_client.ts | 106 +++++++++++----- .../game_server_deployments_service_client.ts | 114 ++++++++++++------ .../google-cloud-gaming/src/v1beta/index.ts | 2 +- .../src/v1beta/realms_service_client.ts | 109 +++++++++++------ packages/google-cloud-gaming/synth.metadata | 15 +-- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- .../system-test/install.ts | 2 +- ...pic-game_server_clusters_service-v1beta.ts | 54 ++++++++- ...apic-game_server_configs_service-v1beta.ts | 38 +++++- ...-game_server_deployments_service-v1beta.ts | 58 ++++++++- .../test/gapic-realms_service-v1beta.ts | 42 ++++++- .../google-cloud-gaming/webpack.config.js | 2 +- 21 files changed, 604 insertions(+), 160 deletions(-) diff --git a/packages/google-cloud-gaming/.gitignore b/packages/google-cloud-gaming/.gitignore index d313cfabc06..5d32b23782f 100644 --- a/packages/google-cloud-gaming/.gitignore +++ b/packages/google-cloud-gaming/.gitignore @@ -12,5 +12,3 @@ system-test/*key.json .DS_Store package-lock.json __pycache__ -*.code-workspace -launch.json diff --git a/packages/google-cloud-gaming/.jsdoc.js b/packages/google-cloud-gaming/.jsdoc.js index 824912fc39d..88fca114a13 100644 --- a/packages/google-cloud-gaming/.jsdoc.js +++ b/packages/google-cloud-gaming/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-gaming/.repo-metadata.json b/packages/google-cloud-gaming/.repo-metadata.json index 80fe4cea01b..61f4574e9bd 100644 --- a/packages/google-cloud-gaming/.repo-metadata.json +++ b/packages/google-cloud-gaming/.repo-metadata.json @@ -2,7 +2,7 @@ "name": "game-servers", "name_pretty": "Google Cloud Game Servers", "product_documentation": "https://cloud.google.com/game-servers/", - "client_documentation": "https://googleapis.dev/nodejs/game-services/latest", + "client_documentation": "https://googleapis.dev/nodejs/game-servers/latest", "issue_tracker": "", "release_level": "beta", "language": "nodejs", diff --git a/packages/google-cloud-gaming/README.md b/packages/google-cloud-gaming/README.md index a5cc24211c0..fccb71d1cf6 100644 --- a/packages/google-cloud-gaming/README.md +++ b/packages/google-cloud-gaming/README.md @@ -110,6 +110,27 @@ has instructions for running the samples. 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. + +Client libraries targetting some end-of-life versions of Node.js are available, and +can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. + +_Legacy Node.js versions are supported as a best effort:_ + +* Legacy versions will not be tested in continuous integration. +* Some security patches may not be able to be backported. +* Dependencies will not be kept up-to-date, and features will not be backported. + +#### Legacy tags available + +* `legacy-8`: install client libraries from this dist-tag for versions + compatible with Node.js 8. + ## Versioning This library follows [Semantic Versioning](http://semver.org/). @@ -144,7 +165,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-game-servers/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/nodejs/game-services/latest +[client-docs]: https://googleapis.dev/nodejs/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 diff --git a/packages/google-cloud-gaming/linkinator.config.json b/packages/google-cloud-gaming/linkinator.config.json index bcceee2ec81..29a223b6db6 100644 --- a/packages/google-cloud-gaming/linkinator.config.json +++ b/packages/google-cloud-gaming/linkinator.config.json @@ -3,8 +3,7 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "img.shields.io", - "https://googleapis.dev/nodejs/game-services/latest" + "img.shields.io" ], "silent": true, "concurrency": 10 diff --git a/packages/google-cloud-gaming/samples/README.md b/packages/google-cloud-gaming/samples/README.md index 7ec52a6728a..ea7144fb660 100644 --- a/packages/google-cloud-gaming/samples/README.md +++ b/packages/google-cloud-gaming/samples/README.md @@ -12,6 +12,10 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Create_realm](#create_realm) + * [Delete_realm](#delete_realm) + * [Get_realm](#get_realm) + * [List_realms](#list_realms) * [Create Game Server Realm](#create-game-server-realm) ## Before you begin @@ -29,6 +33,74 @@ Before running the samples, make sure you've followed the steps outlined in +### Create_realm + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_realm.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_realm.js,samples/README.md) + +__Usage:__ + + +`node samples/create_realm.js` + + +----- + + + + +### Delete_realm + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_realm.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_realm.js,samples/README.md) + +__Usage:__ + + +`node samples/delete_realm.js` + + +----- + + + + +### Get_realm + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_realm.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_realm.js,samples/README.md) + +__Usage:__ + + +`node samples/get_realm.js` + + +----- + + + + +### List_realms + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_realms.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_realms.js,samples/README.md) + +__Usage:__ + + +`node samples/list_realms.js` + + +----- + + + + ### Create Game Server Realm Creates a new Realm within Cloud Game Servers diff --git a/packages/google-cloud-gaming/src/index.ts b/packages/google-cloud-gaming/src/index.ts index 8203dad4994..35803393554 100644 --- a/packages/google-cloud-gaming/src/index.ts +++ b/packages/google-cloud-gaming/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. 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 index 3370becad2d..8284d5c00c8 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. @@ -39,13 +39,23 @@ const version = require('../../../package.json').version; * @memberof v1beta */ export class GameServerClustersServiceClient { - private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; + private _opts: ClientOptions; + 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; operationsClient: gax.OperationsClient; - gameServerClustersServiceStub: Promise<{[name: string]: Function}>; + gameServerClustersServiceStub?: Promise<{[name: string]: Function}>; /** * Construct an instance of GameServerClustersServiceClient. @@ -69,8 +79,6 @@ export class GameServerClustersServiceClient { * 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 {function} [options.promise] - Custom promise module to use instead - * of native Promises. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ @@ -101,26 +109,29 @@ export class GameServerClustersServiceClient { // If we are in browser, we are already using fallback because of the // "browser" field in package.json. // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = (this .constructor as typeof GameServerClustersServiceClient).scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); + 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 = gaxGrpc.auth as gax.GoogleAuth; + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + 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/${gaxModule.version}`); + clientHeader.push(`gl-web/${this._gaxModule.version}`); } if (!opts.fallback) { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); @@ -136,7 +147,7 @@ export class GameServerClustersServiceClient { 'protos', 'protos.json' ); - const protos = gaxGrpc.loadProto( + this._protos = this._gaxGrpc.loadProto( opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); @@ -144,19 +155,19 @@ export class GameServerClustersServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - gameServerClusterPathTemplate: new gaxModule.PathTemplate( + gameServerClusterPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}' ), - gameServerConfigPathTemplate: new gaxModule.PathTemplate( + gameServerConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}' ), - gameServerDeploymentPathTemplate: new gaxModule.PathTemplate( + gameServerDeploymentPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}' ), - gameServerDeploymentRolloutPathTemplate: new gaxModule.PathTemplate( + gameServerDeploymentRolloutPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout' ), - realmPathTemplate: new gaxModule.PathTemplate( + realmPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/realms/{realm}' ), }; @@ -165,13 +176,15 @@ export class GameServerClustersServiceClient { // an Operation object that allows for tracking of the operation, // rather than holding a request open. const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); + ? this._gaxModule.protobuf.Root.fromJSON( + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); - this.operationsClient = gaxModule + this.operationsClient = this._gaxModule .lro({ auth: this.auth, - grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }) .operationsClient(opts); const createGameServerClusterResponse = protoFilesRoot.lookup( @@ -194,7 +207,7 @@ export class GameServerClustersServiceClient { ) as gax.protobuf.Type; this._descriptors.longrunning = { - createGameServerCluster: new gaxModule.LongrunningDescriptor( + createGameServerCluster: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createGameServerClusterResponse.decode.bind( createGameServerClusterResponse @@ -203,7 +216,7 @@ export class GameServerClustersServiceClient { createGameServerClusterMetadata ) ), - deleteGameServerCluster: new gaxModule.LongrunningDescriptor( + deleteGameServerCluster: new this._gaxModule.LongrunningDescriptor( this.operationsClient, deleteGameServerClusterResponse.decode.bind( deleteGameServerClusterResponse @@ -212,7 +225,7 @@ export class GameServerClustersServiceClient { deleteGameServerClusterMetadata ) ), - updateGameServerCluster: new gaxModule.LongrunningDescriptor( + updateGameServerCluster: new this._gaxModule.LongrunningDescriptor( this.operationsClient, updateGameServerClusterResponse.decode.bind( updateGameServerClusterResponse @@ -224,7 +237,7 @@ export class GameServerClustersServiceClient { }; // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( + this._defaults = this._gaxGrpc.constructSettings( 'google.cloud.gaming.v1beta.GameServerClustersService', gapicConfig as gax.ClientConfig, opts.clientConfig || {}, @@ -235,17 +248,36 @@ export class GameServerClustersServiceClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this._innerApiCalls = {}; + } + + /** + * 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 = gaxGrpc.createStub( - opts.fallback - ? (protos as protobuf.Root).lookupService( + this.gameServerClustersServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( 'google.cloud.gaming.v1beta.GameServerClustersService' ) : // tslint:disable-next-line no-any - (protos as any).google.cloud.gaming.v1beta.GameServerClustersService, - opts + (this._protos as any).google.cloud.gaming.v1beta + .GameServerClustersService, + this._opts ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides @@ -267,16 +299,17 @@ export class GameServerClustersServiceClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error | null | undefined) => () => { throw err; } ); - const apiCall = gaxModule.createApiCall( + const apiCall = this._gaxModule.createApiCall( innerCallPromise, - defaults[methodName], + this._defaults[methodName], this._descriptors.page[methodName] || this._descriptors.stream[methodName] || this._descriptors.longrunning[methodName] @@ -290,6 +323,8 @@ export class GameServerClustersServiceClient { return apiCall(argument, callOptions, callback); }; } + + return this.gameServerClustersServiceStub; } /** @@ -418,6 +453,7 @@ export class GameServerClustersServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.listGameServerClusters( request, options, @@ -500,6 +536,7 @@ export class GameServerClustersServiceClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.getGameServerCluster(request, options, callback); } previewCreateGameServerCluster( @@ -579,6 +616,7 @@ export class GameServerClustersServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.previewCreateGameServerCluster( request, options, @@ -661,6 +699,7 @@ export class GameServerClustersServiceClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.previewDeleteGameServerCluster( request, options, @@ -743,6 +782,7 @@ export class GameServerClustersServiceClient { ] = gax.routingHeader.fromParams({ 'game_server_cluster.name': request.gameServerCluster!.name || '', }); + this.initialize(); return this._innerApiCalls.previewUpdateGameServerCluster( request, options, @@ -832,6 +872,7 @@ export class GameServerClustersServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.createGameServerCluster( request, options, @@ -920,6 +961,7 @@ export class GameServerClustersServiceClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.deleteGameServerCluster( request, options, @@ -1008,6 +1050,7 @@ export class GameServerClustersServiceClient { ] = gax.routingHeader.fromParams({ 'game_server_cluster.name': request.gameServerCluster!.name || '', }); + this.initialize(); return this._innerApiCalls.updateGameServerCluster( request, options, @@ -1349,8 +1392,9 @@ export class GameServerClustersServiceClient { * The client will no longer be usable and all future behavior is undefined. */ close(): Promise { + this.initialize(); if (!this._terminated) { - return this.gameServerClustersServiceStub.then(stub => { + return this.gameServerClustersServiceStub!.then(stub => { this._terminated = true; stub.close(); }); 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 index 2d4844d0abe..d5dccd134fe 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. @@ -38,13 +38,23 @@ const version = require('../../../package.json').version; * @memberof v1beta */ export class GameServerConfigsServiceClient { - private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; + private _opts: ClientOptions; + 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; operationsClient: gax.OperationsClient; - gameServerConfigsServiceStub: Promise<{[name: string]: Function}>; + gameServerConfigsServiceStub?: Promise<{[name: string]: Function}>; /** * Construct an instance of GameServerConfigsServiceClient. @@ -68,8 +78,6 @@ export class GameServerConfigsServiceClient { * 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 {function} [options.promise] - Custom promise module to use instead - * of native Promises. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ @@ -100,26 +108,29 @@ export class GameServerConfigsServiceClient { // If we are in browser, we are already using fallback because of the // "browser" field in package.json. // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = (this .constructor as typeof GameServerConfigsServiceClient).scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); + 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 = gaxGrpc.auth as gax.GoogleAuth; + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + 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/${gaxModule.version}`); + clientHeader.push(`gl-web/${this._gaxModule.version}`); } if (!opts.fallback) { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); @@ -135,7 +146,7 @@ export class GameServerConfigsServiceClient { 'protos', 'protos.json' ); - const protos = gaxGrpc.loadProto( + this._protos = this._gaxGrpc.loadProto( opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); @@ -143,19 +154,19 @@ export class GameServerConfigsServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - gameServerClusterPathTemplate: new gaxModule.PathTemplate( + gameServerClusterPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}' ), - gameServerConfigPathTemplate: new gaxModule.PathTemplate( + gameServerConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}' ), - gameServerDeploymentPathTemplate: new gaxModule.PathTemplate( + gameServerDeploymentPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}' ), - gameServerDeploymentRolloutPathTemplate: new gaxModule.PathTemplate( + gameServerDeploymentRolloutPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout' ), - realmPathTemplate: new gaxModule.PathTemplate( + realmPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/realms/{realm}' ), }; @@ -164,13 +175,15 @@ export class GameServerConfigsServiceClient { // an Operation object that allows for tracking of the operation, // rather than holding a request open. const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); + ? this._gaxModule.protobuf.Root.fromJSON( + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); - this.operationsClient = gaxModule + this.operationsClient = this._gaxModule .lro({ auth: this.auth, - grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }) .operationsClient(opts); const createGameServerConfigResponse = protoFilesRoot.lookup( @@ -187,7 +200,7 @@ export class GameServerConfigsServiceClient { ) as gax.protobuf.Type; this._descriptors.longrunning = { - createGameServerConfig: new gaxModule.LongrunningDescriptor( + createGameServerConfig: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createGameServerConfigResponse.decode.bind( createGameServerConfigResponse @@ -196,7 +209,7 @@ export class GameServerConfigsServiceClient { createGameServerConfigMetadata ) ), - deleteGameServerConfig: new gaxModule.LongrunningDescriptor( + deleteGameServerConfig: new this._gaxModule.LongrunningDescriptor( this.operationsClient, deleteGameServerConfigResponse.decode.bind( deleteGameServerConfigResponse @@ -208,7 +221,7 @@ export class GameServerConfigsServiceClient { }; // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( + this._defaults = this._gaxGrpc.constructSettings( 'google.cloud.gaming.v1beta.GameServerConfigsService', gapicConfig as gax.ClientConfig, opts.clientConfig || {}, @@ -219,17 +232,36 @@ export class GameServerConfigsServiceClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this._innerApiCalls = {}; + } + + /** + * 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 = gaxGrpc.createStub( - opts.fallback - ? (protos as protobuf.Root).lookupService( + this.gameServerConfigsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( 'google.cloud.gaming.v1beta.GameServerConfigsService' ) : // tslint:disable-next-line no-any - (protos as any).google.cloud.gaming.v1beta.GameServerConfigsService, - opts + (this._protos as any).google.cloud.gaming.v1beta + .GameServerConfigsService, + this._opts ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides @@ -247,16 +279,17 @@ export class GameServerConfigsServiceClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error | null | undefined) => () => { throw err; } ); - const apiCall = gaxModule.createApiCall( + const apiCall = this._gaxModule.createApiCall( innerCallPromise, - defaults[methodName], + this._defaults[methodName], this._descriptors.page[methodName] || this._descriptors.stream[methodName] || this._descriptors.longrunning[methodName] @@ -270,6 +303,8 @@ export class GameServerConfigsServiceClient { return apiCall(argument, callOptions, callback); }; } + + return this.gameServerConfigsServiceStub; } /** @@ -399,6 +434,7 @@ export class GameServerConfigsServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.listGameServerConfigs( request, options, @@ -481,6 +517,7 @@ export class GameServerConfigsServiceClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.getGameServerConfig(request, options, callback); } @@ -568,6 +605,7 @@ export class GameServerConfigsServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.createGameServerConfig( request, options, @@ -657,6 +695,7 @@ export class GameServerConfigsServiceClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.deleteGameServerConfig( request, options, @@ -998,8 +1037,9 @@ export class GameServerConfigsServiceClient { * The client will no longer be usable and all future behavior is undefined. */ close(): Promise { + this.initialize(); if (!this._terminated) { - return this.gameServerConfigsServiceStub.then(stub => { + return this.gameServerConfigsServiceStub!.then(stub => { this._terminated = true; stub.close(); }); 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 index f61edcd6bd5..e4d27a173ea 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. @@ -39,13 +39,23 @@ const version = require('../../../package.json').version; * @memberof v1beta */ export class GameServerDeploymentsServiceClient { - private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; + private _opts: ClientOptions; + 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; operationsClient: gax.OperationsClient; - gameServerDeploymentsServiceStub: Promise<{[name: string]: Function}>; + gameServerDeploymentsServiceStub?: Promise<{[name: string]: Function}>; /** * Construct an instance of GameServerDeploymentsServiceClient. @@ -69,8 +79,6 @@ export class GameServerDeploymentsServiceClient { * 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 {function} [options.promise] - Custom promise module to use instead - * of native Promises. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ @@ -101,26 +109,29 @@ export class GameServerDeploymentsServiceClient { // If we are in browser, we are already using fallback because of the // "browser" field in package.json. // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = (this .constructor as typeof GameServerDeploymentsServiceClient).scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); + 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 = gaxGrpc.auth as gax.GoogleAuth; + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + 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/${gaxModule.version}`); + clientHeader.push(`gl-web/${this._gaxModule.version}`); } if (!opts.fallback) { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); @@ -136,7 +147,7 @@ export class GameServerDeploymentsServiceClient { 'protos', 'protos.json' ); - const protos = gaxGrpc.loadProto( + this._protos = this._gaxGrpc.loadProto( opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); @@ -144,19 +155,19 @@ export class GameServerDeploymentsServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - gameServerClusterPathTemplate: new gaxModule.PathTemplate( + gameServerClusterPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}' ), - gameServerConfigPathTemplate: new gaxModule.PathTemplate( + gameServerConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}' ), - gameServerDeploymentPathTemplate: new gaxModule.PathTemplate( + gameServerDeploymentPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}' ), - gameServerDeploymentRolloutPathTemplate: new gaxModule.PathTemplate( + gameServerDeploymentRolloutPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout' ), - realmPathTemplate: new gaxModule.PathTemplate( + realmPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/realms/{realm}' ), }; @@ -165,13 +176,15 @@ export class GameServerDeploymentsServiceClient { // an Operation object that allows for tracking of the operation, // rather than holding a request open. const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); + ? this._gaxModule.protobuf.Root.fromJSON( + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); - this.operationsClient = gaxModule + this.operationsClient = this._gaxModule .lro({ auth: this.auth, - grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }) .operationsClient(opts); const createGameServerDeploymentResponse = protoFilesRoot.lookup( @@ -200,7 +213,7 @@ export class GameServerDeploymentsServiceClient { ) as gax.protobuf.Type; this._descriptors.longrunning = { - createGameServerDeployment: new gaxModule.LongrunningDescriptor( + createGameServerDeployment: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createGameServerDeploymentResponse.decode.bind( createGameServerDeploymentResponse @@ -209,7 +222,7 @@ export class GameServerDeploymentsServiceClient { createGameServerDeploymentMetadata ) ), - deleteGameServerDeployment: new gaxModule.LongrunningDescriptor( + deleteGameServerDeployment: new this._gaxModule.LongrunningDescriptor( this.operationsClient, deleteGameServerDeploymentResponse.decode.bind( deleteGameServerDeploymentResponse @@ -218,7 +231,7 @@ export class GameServerDeploymentsServiceClient { deleteGameServerDeploymentMetadata ) ), - updateGameServerDeployment: new gaxModule.LongrunningDescriptor( + updateGameServerDeployment: new this._gaxModule.LongrunningDescriptor( this.operationsClient, updateGameServerDeploymentResponse.decode.bind( updateGameServerDeploymentResponse @@ -227,7 +240,7 @@ export class GameServerDeploymentsServiceClient { updateGameServerDeploymentMetadata ) ), - updateGameServerDeploymentRollout: new gaxModule.LongrunningDescriptor( + updateGameServerDeploymentRollout: new this._gaxModule.LongrunningDescriptor( this.operationsClient, updateGameServerDeploymentRolloutResponse.decode.bind( updateGameServerDeploymentRolloutResponse @@ -239,7 +252,7 @@ export class GameServerDeploymentsServiceClient { }; // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( + this._defaults = this._gaxGrpc.constructSettings( 'google.cloud.gaming.v1beta.GameServerDeploymentsService', gapicConfig as gax.ClientConfig, opts.clientConfig || {}, @@ -250,18 +263,36 @@ export class GameServerDeploymentsServiceClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this._innerApiCalls = {}; + } + + /** + * 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 = gaxGrpc.createStub( - opts.fallback - ? (protos as protobuf.Root).lookupService( + this.gameServerDeploymentsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( 'google.cloud.gaming.v1beta.GameServerDeploymentsService' ) : // tslint:disable-next-line no-any - (protos as any).google.cloud.gaming.v1beta + (this._protos as any).google.cloud.gaming.v1beta .GameServerDeploymentsService, - opts + this._opts ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides @@ -284,16 +315,17 @@ export class GameServerDeploymentsServiceClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error | null | undefined) => () => { throw err; } ); - const apiCall = gaxModule.createApiCall( + const apiCall = this._gaxModule.createApiCall( innerCallPromise, - defaults[methodName], + this._defaults[methodName], this._descriptors.page[methodName] || this._descriptors.stream[methodName] || this._descriptors.longrunning[methodName] @@ -307,6 +339,8 @@ export class GameServerDeploymentsServiceClient { return apiCall(argument, callOptions, callback); }; } + + return this.gameServerDeploymentsServiceStub; } /** @@ -435,6 +469,7 @@ export class GameServerDeploymentsServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.listGameServerDeployments( request, options, @@ -517,6 +552,7 @@ export class GameServerDeploymentsServiceClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.getGameServerDeployment( request, options, @@ -599,6 +635,7 @@ export class GameServerDeploymentsServiceClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.getGameServerDeploymentRollout( request, options, @@ -682,6 +719,7 @@ export class GameServerDeploymentsServiceClient { ] = gax.routingHeader.fromParams({ 'rollout.name': request.rollout!.name || '', }); + this.initialize(); return this._innerApiCalls.previewGameServerDeploymentRollout( request, options, @@ -766,6 +804,7 @@ export class GameServerDeploymentsServiceClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.fetchDeploymentState(request, options, callback); } @@ -851,6 +890,7 @@ export class GameServerDeploymentsServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.createGameServerDeployment( request, options, @@ -939,6 +979,7 @@ export class GameServerDeploymentsServiceClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.deleteGameServerDeployment( request, options, @@ -1027,6 +1068,7 @@ export class GameServerDeploymentsServiceClient { ] = gax.routingHeader.fromParams({ 'game_server_deployment.name': request.gameServerDeployment!.name || '', }); + this.initialize(); return this._innerApiCalls.updateGameServerDeployment( request, options, @@ -1115,6 +1157,7 @@ export class GameServerDeploymentsServiceClient { ] = gax.routingHeader.fromParams({ 'rollout.name': request.rollout!.name || '', }); + this.initialize(); return this._innerApiCalls.updateGameServerDeploymentRollout( request, options, @@ -1456,8 +1499,9 @@ export class GameServerDeploymentsServiceClient { * The client will no longer be usable and all future behavior is undefined. */ close(): Promise { + this.initialize(); if (!this._terminated) { - return this.gameServerDeploymentsServiceStub.then(stub => { + return this.gameServerDeploymentsServiceStub!.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-gaming/src/v1beta/index.ts b/packages/google-cloud-gaming/src/v1beta/index.ts index 80e7089516e..861b577d05e 100644 --- a/packages/google-cloud-gaming/src/v1beta/index.ts +++ b/packages/google-cloud-gaming/src/v1beta/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index 3a2ecfe4722..d2ad30b92e6 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. @@ -39,13 +39,23 @@ const version = require('../../../package.json').version; * @memberof v1beta */ export class RealmsServiceClient { - private _descriptors: Descriptors = {page: {}, stream: {}, longrunning: {}}; + private _descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; private _innerApiCalls: {[name: string]: Function}; private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; + private _opts: ClientOptions; + 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; operationsClient: gax.OperationsClient; - realmsServiceStub: Promise<{[name: string]: Function}>; + realmsServiceStub?: Promise<{[name: string]: Function}>; /** * Construct an instance of RealmsServiceClient. @@ -69,8 +79,6 @@ export class RealmsServiceClient { * 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 {function} [options.promise] - Custom promise module to use instead - * of native Promises. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. */ @@ -100,25 +108,28 @@ export class RealmsServiceClient { // If we are in browser, we are already using fallback because of the // "browser" field in package.json. // But if we were explicitly requested to use fallback, let's do it now. - const gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. opts.scopes = (this.constructor as typeof RealmsServiceClient).scopes; - const gaxGrpc = new gaxModule.GrpcClient(opts); + 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 = gaxGrpc.auth as gax.GoogleAuth; + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Determine the client header string. - const clientHeader = [`gax/${gaxModule.version}`, `gapic/${version}`]; + 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/${gaxModule.version}`); + clientHeader.push(`gl-web/${this._gaxModule.version}`); } if (!opts.fallback) { - clientHeader.push(`grpc/${gaxGrpc.grpcVersion}`); + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { clientHeader.push(`${opts.libName}/${opts.libVersion}`); @@ -134,7 +145,7 @@ export class RealmsServiceClient { 'protos', 'protos.json' ); - const protos = gaxGrpc.loadProto( + this._protos = this._gaxGrpc.loadProto( opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath ); @@ -142,19 +153,19 @@ export class RealmsServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this._pathTemplates = { - gameServerClusterPathTemplate: new gaxModule.PathTemplate( + gameServerClusterPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}' ), - gameServerConfigPathTemplate: new gaxModule.PathTemplate( + gameServerConfigPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}' ), - gameServerDeploymentPathTemplate: new gaxModule.PathTemplate( + gameServerDeploymentPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}' ), - gameServerDeploymentRolloutPathTemplate: new gaxModule.PathTemplate( + gameServerDeploymentRolloutPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout' ), - realmPathTemplate: new gaxModule.PathTemplate( + realmPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/realms/{realm}' ), }; @@ -163,13 +174,15 @@ export class RealmsServiceClient { // an Operation object that allows for tracking of the operation, // rather than holding a request open. const protoFilesRoot = opts.fallback - ? gaxModule.protobuf.Root.fromJSON(require('../../protos/protos.json')) - : gaxModule.protobuf.loadSync(nodejsProtoPath); + ? this._gaxModule.protobuf.Root.fromJSON( + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); - this.operationsClient = gaxModule + this.operationsClient = this._gaxModule .lro({ auth: this.auth, - grpc: 'grpc' in gaxGrpc ? gaxGrpc.grpc : undefined, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, }) .operationsClient(opts); const createRealmResponse = protoFilesRoot.lookup( @@ -192,17 +205,17 @@ export class RealmsServiceClient { ) as gax.protobuf.Type; this._descriptors.longrunning = { - createRealm: new gaxModule.LongrunningDescriptor( + createRealm: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createRealmResponse.decode.bind(createRealmResponse), createRealmMetadata.decode.bind(createRealmMetadata) ), - deleteRealm: new gaxModule.LongrunningDescriptor( + deleteRealm: new this._gaxModule.LongrunningDescriptor( this.operationsClient, deleteRealmResponse.decode.bind(deleteRealmResponse), deleteRealmMetadata.decode.bind(deleteRealmMetadata) ), - updateRealm: new gaxModule.LongrunningDescriptor( + updateRealm: new this._gaxModule.LongrunningDescriptor( this.operationsClient, updateRealmResponse.decode.bind(updateRealmResponse), updateRealmMetadata.decode.bind(updateRealmMetadata) @@ -210,7 +223,7 @@ export class RealmsServiceClient { }; // Put together the default options sent with requests. - const defaults = gaxGrpc.constructSettings( + this._defaults = this._gaxGrpc.constructSettings( 'google.cloud.gaming.v1beta.RealmsService', gapicConfig as gax.ClientConfig, opts.clientConfig || {}, @@ -221,17 +234,35 @@ export class RealmsServiceClient { // of calling the API is handled in `google-gax`, with this code // merely providing the destination and request information. this._innerApiCalls = {}; + } + + /** + * 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 = gaxGrpc.createStub( - opts.fallback - ? (protos as protobuf.Root).lookupService( + this.realmsServiceStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( 'google.cloud.gaming.v1beta.RealmsService' ) : // tslint:disable-next-line no-any - (protos as any).google.cloud.gaming.v1beta.RealmsService, - opts + (this._protos as any).google.cloud.gaming.v1beta.RealmsService, + this._opts ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides @@ -251,16 +282,17 @@ export class RealmsServiceClient { if (this._terminated) { return Promise.reject('The client has already been closed.'); } - return stub[methodName].apply(stub, args); + const func = stub[methodName]; + return func.apply(stub, args); }, (err: Error | null | undefined) => () => { throw err; } ); - const apiCall = gaxModule.createApiCall( + const apiCall = this._gaxModule.createApiCall( innerCallPromise, - defaults[methodName], + this._defaults[methodName], this._descriptors.page[methodName] || this._descriptors.stream[methodName] || this._descriptors.longrunning[methodName] @@ -274,6 +306,8 @@ export class RealmsServiceClient { return apiCall(argument, callOptions, callback); }; } + + return this.realmsServiceStub; } /** @@ -393,6 +427,7 @@ export class RealmsServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.listRealms(request, options, callback); } getRealm( @@ -462,6 +497,7 @@ export class RealmsServiceClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.getRealm(request, options, callback); } previewRealmUpdate( @@ -540,6 +576,7 @@ export class RealmsServiceClient { ] = gax.routingHeader.fromParams({ 'realm.name': request.realm!.name || '', }); + this.initialize(); return this._innerApiCalls.previewRealmUpdate(request, options, callback); } @@ -625,6 +662,7 @@ export class RealmsServiceClient { ] = gax.routingHeader.fromParams({ parent: request.parent || '', }); + this.initialize(); return this._innerApiCalls.createRealm(request, options, callback); } deleteRealm( @@ -709,6 +747,7 @@ export class RealmsServiceClient { ] = gax.routingHeader.fromParams({ name: request.name || '', }); + this.initialize(); return this._innerApiCalls.deleteRealm(request, options, callback); } updateRealm( @@ -793,6 +832,7 @@ export class RealmsServiceClient { ] = gax.routingHeader.fromParams({ 'realm.name': request.realm!.name || '', }); + this.initialize(); return this._innerApiCalls.updateRealm(request, options, callback); } // -------------------- @@ -1130,8 +1170,9 @@ export class RealmsServiceClient { * The client will no longer be usable and all future behavior is undefined. */ close(): Promise { + this.initialize(); if (!this._terminated) { - return this.realmsServiceStub.then(stub => { + return this.realmsServiceStub!.then(stub => { this._terminated = true; stub.close(); }); diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 3dc4d906271..e6a09e486ff 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -1,19 +1,20 @@ { - "updateTime": "2020-03-01T18:18:36.980720Z", + "updateTime": "2020-03-22T11:29:25.571404Z", "sources": [ { "git": { "name": "googleapis-private", "remote": "https://github.com/googleapis/googleapis-private.git", - "sha": "93896777e78b247f3a2228bde08b1fe1cf4179a5", - "internalRef": "295938567" + "sha": "e6378caa596533251006a9eb318f3f9e71984f2b", + "internalRef": "301441701", + "log": "e6378caa596533251006a9eb318f3f9e71984f2b\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 301441701\n\nf557255ffc2382115850c7e4832b5505676ae63b\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 299734673\n\n27f8117872914cb033c33f2351bee19d34f7b0cc\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 298524614\n\n71a4d0fafde0d09abd8ab93773eedfb4490f1e40\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 298477635\n\n" } }, { - "template": { - "name": "node_library", - "origin": "synthtool.gcp", - "version": "2020.2.4" + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "7e98e1609c91082f4eeb63b530c6468aefd18cfd" } } ], 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 index 9fc25880b6e..ca8d73c6102 100644 --- a/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. 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 index 43804e1da02..38e748f15cf 100644 --- a/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. diff --git a/packages/google-cloud-gaming/system-test/install.ts b/packages/google-cloud-gaming/system-test/install.ts index c9aa74ec221..c4d80e9c0c8 100644 --- a/packages/google-cloud-gaming/system-test/install.ts +++ b/packages/google-cloud-gaming/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. 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 index 14542d9008f..dc53d99d273 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. @@ -110,6 +110,26 @@ describe('v1beta.GameServerClustersServiceClient', () => { ); 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', () => { + const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); describe('listGameServerClusters', () => { it('invokes listGameServerClusters without error', done => { const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( @@ -118,6 +138,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersRequest = {}; request.parent = ''; @@ -143,6 +165,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersRequest = {}; request.parent = ''; @@ -170,6 +194,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerClusterRequest = {}; request.name = ''; @@ -195,6 +221,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerClusterRequest = {}; request.name = ''; @@ -222,6 +250,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest = {}; request.parent = ''; @@ -250,6 +280,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest = {}; request.parent = ''; @@ -280,6 +312,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest = {}; request.name = ''; @@ -308,6 +342,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest = {}; request.name = ''; @@ -338,6 +374,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest = {}; request.gameServerCluster = {}; @@ -367,6 +405,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest = {}; request.gameServerCluster = {}; @@ -398,6 +438,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest = {}; request.parent = ''; @@ -430,6 +472,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest = {}; request.parent = ''; @@ -465,6 +509,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest = {}; request.name = ''; @@ -497,6 +543,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest = {}; request.name = ''; @@ -532,6 +580,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest = {}; request.gameServerCluster = {}; @@ -565,6 +615,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest = {}; request.gameServerCluster = {}; 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 index c6da1ff6b13..b92cf957db6 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. @@ -109,6 +109,26 @@ describe('v1beta.GameServerConfigsServiceClient', () => { ); 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', () => { + const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); describe('listGameServerConfigs', () => { it('invokes listGameServerConfigs without error', done => { const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( @@ -117,6 +137,8 @@ describe('v1beta.GameServerConfigsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsRequest = {}; request.parent = ''; @@ -142,6 +164,8 @@ describe('v1beta.GameServerConfigsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsRequest = {}; request.parent = ''; @@ -169,6 +193,8 @@ describe('v1beta.GameServerConfigsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerConfigRequest = {}; request.name = ''; @@ -194,6 +220,8 @@ describe('v1beta.GameServerConfigsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerConfigRequest = {}; request.name = ''; @@ -221,6 +249,8 @@ describe('v1beta.GameServerConfigsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest = {}; request.parent = ''; @@ -253,6 +283,8 @@ describe('v1beta.GameServerConfigsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest = {}; request.parent = ''; @@ -288,6 +320,8 @@ describe('v1beta.GameServerConfigsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest = {}; request.name = ''; @@ -320,6 +354,8 @@ describe('v1beta.GameServerConfigsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest = {}; request.name = ''; 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 index 8d1dea2ed24..ee2f9a0dbc2 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. @@ -110,6 +110,26 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); 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', () => { + const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); describe('listGameServerDeployments', () => { it('invokes listGameServerDeployments without error', done => { const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( @@ -118,6 +138,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest = {}; request.parent = ''; @@ -143,6 +165,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest = {}; request.parent = ''; @@ -173,6 +197,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest = {}; request.name = ''; @@ -198,6 +224,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest = {}; request.name = ''; @@ -228,6 +256,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest = {}; request.name = ''; @@ -256,6 +286,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest = {}; request.name = ''; @@ -286,6 +318,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest = {}; request.rollout = {}; @@ -315,6 +349,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest = {}; request.rollout = {}; @@ -346,6 +382,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest = {}; request.name = ''; @@ -371,6 +409,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest = {}; request.name = ''; @@ -398,6 +438,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest = {}; request.parent = ''; @@ -430,6 +472,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest = {}; request.parent = ''; @@ -465,6 +509,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest = {}; request.name = ''; @@ -497,6 +543,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest = {}; request.name = ''; @@ -532,6 +580,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest = {}; request.gameServerDeployment = {}; @@ -565,6 +615,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest = {}; request.gameServerDeployment = {}; @@ -601,6 +653,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest = {}; request.rollout = {}; @@ -634,6 +688,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { projectId: 'bogus', } ); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest = {}; request.rollout = {}; diff --git a/packages/google-cloud-gaming/test/gapic-realms_service-v1beta.ts b/packages/google-cloud-gaming/test/gapic-realms_service-v1beta.ts index 5633160c926..c81fa967ae5 100644 --- a/packages/google-cloud-gaming/test/gapic-realms_service-v1beta.ts +++ b/packages/google-cloud-gaming/test/gapic-realms_service-v1beta.ts @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. @@ -104,12 +104,30 @@ describe('v1beta.RealmsServiceClient', () => { }); 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', () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); describe('listRealms', () => { it('invokes listRealms without error', done => { const client = new realmsserviceModule.v1beta.RealmsServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IListRealmsRequest = {}; request.parent = ''; @@ -133,6 +151,8 @@ describe('v1beta.RealmsServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IListRealmsRequest = {}; request.parent = ''; @@ -158,6 +178,8 @@ describe('v1beta.RealmsServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IGetRealmRequest = {}; request.name = ''; @@ -181,6 +203,8 @@ describe('v1beta.RealmsServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IGetRealmRequest = {}; request.name = ''; @@ -206,6 +230,8 @@ describe('v1beta.RealmsServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest = {}; request.realm = {}; @@ -230,6 +256,8 @@ describe('v1beta.RealmsServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest = {}; request.realm = {}; @@ -256,6 +284,8 @@ describe('v1beta.RealmsServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.ICreateRealmRequest = {}; request.parent = ''; @@ -286,6 +316,8 @@ describe('v1beta.RealmsServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.ICreateRealmRequest = {}; request.parent = ''; @@ -319,6 +351,8 @@ describe('v1beta.RealmsServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IDeleteRealmRequest = {}; request.name = ''; @@ -349,6 +383,8 @@ describe('v1beta.RealmsServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IDeleteRealmRequest = {}; request.name = ''; @@ -382,6 +418,8 @@ describe('v1beta.RealmsServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IUpdateRealmRequest = {}; request.realm = {}; @@ -413,6 +451,8 @@ describe('v1beta.RealmsServiceClient', () => { credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); + // Initialize client before mocking + client.initialize(); // Mock request const request: protosTypes.google.cloud.gaming.v1beta.IUpdateRealmRequest = {}; request.realm = {}; diff --git a/packages/google-cloud-gaming/webpack.config.js b/packages/google-cloud-gaming/webpack.config.js index f94b68d05c6..38b76f94355 100644 --- a/packages/google-cloud-gaming/webpack.config.js +++ b/packages/google-cloud-gaming/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC +// 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. From bbcc5d222e8f9ed5d96661567655f3627a87919d Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 31 Mar 2020 13:44:37 -0700 Subject: [PATCH 017/180] feat!: drop node8 support (#37) BREAKING CHANGE: The library now supports Node.js v10+. The last version to support Node.js v8 is tagged legacy-8 on NPM. --- packages/google-cloud-gaming/.eslintrc.json | 3 + packages/google-cloud-gaming/.eslintrc.yml | 15 - packages/google-cloud-gaming/.prettierrc | 8 - packages/google-cloud-gaming/.prettierrc.js | 17 + packages/google-cloud-gaming/package.json | 10 +- .../google/cloud/gaming/v1beta/common.proto | 3 +- .../gaming/v1beta/game_server_clusters.proto | 22 +- .../v1beta/game_server_clusters_service.proto | 4 +- .../gaming/v1beta/game_server_configs.proto | 8 +- .../v1beta/game_server_configs_service.proto | 4 +- .../v1beta/game_server_deployments.proto | 8 +- .../game_server_deployments_service.proto | 9 +- .../google/cloud/gaming/v1beta/realms.proto | 8 +- .../cloud/gaming/v1beta/realms_service.proto | 4 +- .../google-cloud-gaming/protos/protos.json | 22 +- packages/google-cloud-gaming/src/index.ts | 2 - .../game_server_clusters_service_client.ts | 530 +++-- .../game_server_configs_service_client.ts | 344 +-- .../game_server_deployments_service_client.ts | 590 +++--- .../src/v1beta/realms_service_client.ts | 434 ++-- packages/google-cloud-gaming/synth.metadata | 20 +- .../system-test/fixtures/sample/src/index.js | 1 - .../system-test/fixtures/sample/src/index.ts | 15 +- ...pic-game_server_clusters_service-v1beta.ts | 648 ------ ...apic-game_server_configs_service-v1beta.ts | 386 ---- ...-game_server_deployments_service-v1beta.ts | 721 ------- .../test/gapic-realms_service-v1beta.ts | 484 ----- ...pic_game_server_clusters_service_v1beta.ts | 1681 +++++++++++++++ ...apic_game_server_configs_service_v1beta.ts | 1140 ++++++++++ ..._game_server_deployments_service_v1beta.ts | 1858 +++++++++++++++++ .../test/gapic_realms_service_v1beta.ts | 1358 ++++++++++++ .../google-cloud-gaming/webpack.config.js | 12 +- 32 files changed, 7229 insertions(+), 3140 deletions(-) create mode 100644 packages/google-cloud-gaming/.eslintrc.json delete mode 100644 packages/google-cloud-gaming/.eslintrc.yml delete mode 100644 packages/google-cloud-gaming/.prettierrc create mode 100644 packages/google-cloud-gaming/.prettierrc.js delete mode 100644 packages/google-cloud-gaming/test/gapic-game_server_clusters_service-v1beta.ts delete mode 100644 packages/google-cloud-gaming/test/gapic-game_server_configs_service-v1beta.ts delete mode 100644 packages/google-cloud-gaming/test/gapic-game_server_deployments_service-v1beta.ts delete mode 100644 packages/google-cloud-gaming/test/gapic-realms_service-v1beta.ts create mode 100644 packages/google-cloud-gaming/test/gapic_game_server_clusters_service_v1beta.ts create mode 100644 packages/google-cloud-gaming/test/gapic_game_server_configs_service_v1beta.ts create mode 100644 packages/google-cloud-gaming/test/gapic_game_server_deployments_service_v1beta.ts create mode 100644 packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts 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/.eslintrc.yml b/packages/google-cloud-gaming/.eslintrc.yml deleted file mode 100644 index 73eeec27612..00000000000 --- a/packages/google-cloud-gaming/.eslintrc.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -extends: - - 'eslint:recommended' - - 'plugin:node/recommended' - - prettier -plugins: - - node - - prettier -rules: - prettier/prettier: error - block-scoped-var: error - eqeqeq: error - no-warning-comments: warn - no-var: error - prefer-const: error diff --git a/packages/google-cloud-gaming/.prettierrc b/packages/google-cloud-gaming/.prettierrc deleted file mode 100644 index df6eac07446..00000000000 --- a/packages/google-cloud-gaming/.prettierrc +++ /dev/null @@ -1,8 +0,0 @@ ---- -bracketSpacing: false -printWidth: 80 -semi: true -singleQuote: true -tabWidth: 2 -trailingComma: es5 -useTabs: false diff --git a/packages/google-cloud-gaming/.prettierrc.js b/packages/google-cloud-gaming/.prettierrc.js new file mode 100644 index 00000000000..08cba3775be --- /dev/null +++ b/packages/google-cloud-gaming/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index ca5c8154d2e..f4b362cd61c 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -26,17 +26,18 @@ "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { - "google-gax": "^1.14.2" + "google-gax": "^2.0.1" }, "devDependencies": { "@types/mocha": "^7.0.0", "@types/node": "^12.0.0", + "@types/sinon": "^7.5.2", "c8": "^7.0.0", "eslint": "^6.8.0", "eslint-config-prettier": "^6.10.0", "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.1.2", - "gts": "^1.0.0", + "gts": "2.0.0-alpha.9", "jsdoc": "^3.5.5", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", @@ -45,12 +46,13 @@ "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", "prettier": "^1.19.1", + "sinon": "^9.0.1", "ts-loader": "^6.2.1", - "typescript": "~3.6.4", + "typescript": "^3.8.3", "webpack": "^4.41.2", "webpack-cli": "^3.3.10" }, "engines": { - "node": ">=8.13.0" + "node": ">=10" } } 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 index 1db6b77cfa4..027272cf309 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; 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 index 62ce7ef9cba..fd67a112b2c 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -25,6 +24,7 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListGameServerClustersRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerCluster" + child_type: "gameservices.googleapis.com/GameServerCluster" } ]; @@ -90,7 +90,7 @@ message CreateGameServerClusterRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerCluster" + child_type: "gameservices.googleapis.com/GameServerCluster" } ]; @@ -105,7 +105,12 @@ message CreateGameServerClusterRequest { message PreviewCreateGameServerClusterRequest { // Required. The parent resource name. Uses the form: // `projects/{project}/locations/{location}/realms/{realm}`. - string parent = 1 [(google.api.field_behavior) = REQUIRED]; + 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]; @@ -143,7 +148,12 @@ message DeleteGameServerClusterRequest { 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]; + 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]; 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 index 462e42dde47..2d81c438273 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -23,6 +22,7 @@ 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"; 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 index ac57c5c3a19..ea0820bd79d 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -24,6 +23,7 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListGameServerConfigsRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerConfig" + child_type: "gameservices.googleapis.com/GameServerConfig" } ]; @@ -91,7 +91,7 @@ message CreateGameServerConfigRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerConfig" + child_type: "gameservices.googleapis.com/GameServerConfig" } ]; 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 index 89dd582307a..29e886c50df 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -23,6 +22,7 @@ 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"; 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 index d0682520900..2e87e386c85 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -25,6 +24,7 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListGameServerDeploymentsRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerDeployment" + child_type: "gameservices.googleapis.com/GameServerDeployment" } ]; @@ -105,7 +105,7 @@ message CreateGameServerDeploymentRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerDeployment" + child_type: "gameservices.googleapis.com/GameServerDeployment" } ]; 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 index ccb0c5055f4..ccacfbacd5a 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -23,6 +22,7 @@ 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"; @@ -95,6 +95,11 @@ service GameServerDeploymentsService { } // 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" 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 index 38281aa6789..c1fa9982f2f 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -25,6 +24,7 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListRealmsRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/Realm" + child_type: "gameservices.googleapis.com/Realm" } ]; @@ -90,7 +90,7 @@ message CreateRealmRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/Realm" + child_type: "gameservices.googleapis.com/Realm" } ]; 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 index b7dfaa07cc3..4c87cac3d36 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -23,6 +22,7 @@ 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"; diff --git a/packages/google-cloud-gaming/protos/protos.json b/packages/google-cloud-gaming/protos/protos.json index 5a0173d1665..7d73f19966c 100644 --- a/packages/google-cloud-gaming/protos/protos.json +++ b/packages/google-cloud-gaming/protos/protos.json @@ -306,7 +306,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" } }, "pageSize": { @@ -376,7 +376,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" } }, "gameServerClusterId": { @@ -401,7 +401,8 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" } }, "gameServerClusterId": { @@ -457,7 +458,8 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" } }, "previewTime": { @@ -695,7 +697,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerConfig" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerConfig" } }, "pageSize": { @@ -765,7 +767,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerConfig" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerConfig" } }, "configId": { @@ -933,7 +935,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerDeployment" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerDeployment" } }, "pageSize": { @@ -1015,7 +1017,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerDeployment" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerDeployment" } }, "deploymentId": { @@ -1364,7 +1366,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/Realm" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/Realm" } }, "pageSize": { @@ -1434,7 +1436,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/Realm" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/Realm" } }, "realmId": { diff --git a/packages/google-cloud-gaming/src/index.ts b/packages/google-cloud-gaming/src/index.ts index 35803393554..f0357c3b1d2 100644 --- a/packages/google-cloud-gaming/src/index.ts +++ b/packages/google-cloud-gaming/src/index.ts @@ -29,8 +29,6 @@ export { GameServerDeploymentsServiceClient, RealmsServiceClient, }; -// For compatibility with JavaScript libraries we need to provide this default export: -// tslint:disable-next-line no-default-export export default { v1beta, GameServerClustersServiceClient, 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 index 8284d5c00c8..94a3c009259 100644 --- 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 @@ -18,7 +18,6 @@ import * as gax from 'google-gax'; import { - APICallback, Callback, CallOptions, Descriptors, @@ -27,7 +26,7 @@ import { } from 'google-gax'; import * as path from 'path'; -import * as protosTypes from '../../protos/protos'; +import * as protos from '../../protos/protos'; import * as gapicConfig from './game_server_clusters_service_client_config.json'; const version = require('../../../package.json').version; @@ -39,14 +38,6 @@ const version = require('../../../package.json').version; * @memberof v1beta */ export class GameServerClustersServiceClient { - private _descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - private _innerApiCalls: {[name: string]: Function}; - private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; private _opts: ClientOptions; private _gaxModule: typeof gax | typeof gax.fallback; @@ -54,6 +45,14 @@ export class GameServerClustersServiceClient { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; gameServerClustersServiceStub?: Promise<{[name: string]: Function}>; @@ -148,13 +147,16 @@ export class GameServerClustersServiceClient { 'protos.json' ); this._protos = this._gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. - this._pathTemplates = { + this.pathTemplates = { gameServerClusterPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}' ), @@ -177,6 +179,7 @@ export class GameServerClustersServiceClient { // rather than holding a request open. const protoFilesRoot = opts.fallback ? this._gaxModule.protobuf.Root.fromJSON( + // eslint-disable-next-line @typescript-eslint/no-var-requires require('../../protos/protos.json') ) : this._gaxModule.protobuf.loadSync(nodejsProtoPath); @@ -206,7 +209,7 @@ export class GameServerClustersServiceClient { '.google.cloud.gaming.v1beta.OperationMetadata' ) as gax.protobuf.Type; - this._descriptors.longrunning = { + this.descriptors.longrunning = { createGameServerCluster: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createGameServerClusterResponse.decode.bind( @@ -247,7 +250,7 @@ export class GameServerClustersServiceClient { // 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 = {}; + this.innerApiCalls = {}; } /** @@ -274,7 +277,7 @@ export class GameServerClustersServiceClient { ? (this._protos as protobuf.Root).lookupService( 'google.cloud.gaming.v1beta.GameServerClustersService' ) - : // tslint:disable-next-line no-any + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.gaming.v1beta .GameServerClustersService, this._opts @@ -292,9 +295,8 @@ export class GameServerClustersServiceClient { 'updateGameServerCluster', 'previewUpdateGameServerCluster', ]; - for (const methodName of gameServerClustersServiceStubMethods) { - const innerCallPromise = this.gameServerClustersServiceStub.then( + const callPromise = this.gameServerClustersServiceStub.then( stub => (...args: Array<{}>) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); @@ -308,20 +310,14 @@ export class GameServerClustersServiceClient { ); const apiCall = this._gaxModule.createApiCall( - innerCallPromise, + callPromise, this._defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.stream[methodName] || - this._descriptors.longrunning[methodName] + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); - this._innerApiCalls[methodName] = ( - argument: {}, - callOptions?: CallOptions, - callback?: APICallback - ) => { - return apiCall(argument, callOptions, callback); - }; + this.innerApiCalls[methodName] = apiCall; } return this.gameServerClustersServiceStub; @@ -378,26 +374,37 @@ export class GameServerClustersServiceClient { // -- Service calls -- // ------------------- listGameServerClusters( - request: protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + request: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersResponse, + protos.google.cloud.gaming.v1beta.IListGameServerClustersResponse, ( - | protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersRequest + | protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest | undefined ), {} | undefined ] >; listGameServerClusters( - request: protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + request: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersResponse, - | protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersRequest + protos.google.cloud.gaming.v1beta.IListGameServerClustersResponse, + | protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + listGameServerClusters( + request: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + callback: Callback< + protos.google.cloud.gaming.v1beta.IListGameServerClustersResponse, + | protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -412,26 +419,28 @@ export class GameServerClustersServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ listGameServerClusters( - request: protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + request: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersResponse, - | protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersRequest + protos.google.cloud.gaming.v1beta.IListGameServerClustersResponse, + | protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersResponse, - | protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersRequest + protos.google.cloud.gaming.v1beta.IListGameServerClustersResponse, + | protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersResponse, + protos.google.cloud.gaming.v1beta.IListGameServerClustersResponse, ( - | protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersRequest + | protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest | undefined ), {} | undefined @@ -454,33 +463,44 @@ export class GameServerClustersServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.listGameServerClusters( + return this.innerApiCalls.listGameServerClusters( request, options, callback ); } getGameServerCluster( - request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, + request: protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IGameServerCluster, ( - | protosTypes.google.cloud.gaming.v1beta.IGetGameServerClusterRequest + | protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest | undefined ), {} | undefined ] >; getGameServerCluster( - request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, + request: protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, - | protosTypes.google.cloud.gaming.v1beta.IGetGameServerClusterRequest + protos.google.cloud.gaming.v1beta.IGameServerCluster, + | protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest + | null | undefined, - {} | 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; /** @@ -495,26 +515,28 @@ export class GameServerClustersServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getGameServerCluster( - request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, + request: protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, - | protosTypes.google.cloud.gaming.v1beta.IGetGameServerClusterRequest + protos.google.cloud.gaming.v1beta.IGameServerCluster, + | protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, - | protosTypes.google.cloud.gaming.v1beta.IGetGameServerClusterRequest + protos.google.cloud.gaming.v1beta.IGameServerCluster, + | protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IGameServerCluster, ( - | protosTypes.google.cloud.gaming.v1beta.IGetGameServerClusterRequest + | protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest | undefined ), {} | undefined @@ -537,29 +559,40 @@ export class GameServerClustersServiceClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.getGameServerCluster(request, options, callback); + return this.innerApiCalls.getGameServerCluster(request, options, callback); } previewCreateGameServerCluster( - request: protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, + request: protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, + protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, ( - | protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest + | protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest | undefined ), {} | undefined ] >; previewCreateGameServerCluster( - request: protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, + request: protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, - | protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest + protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, + | protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest + | null | undefined, - {} | 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; /** @@ -575,26 +608,28 @@ export class GameServerClustersServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ previewCreateGameServerCluster( - request: protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, + request: protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, - | protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest + protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, + | protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, - | protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest + protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, + | protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, + protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, ( - | protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest + | protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest | undefined ), {} | undefined @@ -617,33 +652,44 @@ export class GameServerClustersServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.previewCreateGameServerCluster( + return this.innerApiCalls.previewCreateGameServerCluster( request, options, callback ); } previewDeleteGameServerCluster( - request: protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, + request: protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, + protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, ( - | protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest + | protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest | undefined ), {} | undefined ] >; previewDeleteGameServerCluster( - request: protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, + request: protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, - | protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest + protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, + | protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest + | null | undefined, - {} | 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; /** @@ -658,26 +704,28 @@ export class GameServerClustersServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ previewDeleteGameServerCluster( - request: protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, + request: protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, - | protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest + protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, + | protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, - | protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest + protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, + | protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, + protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, ( - | protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest + | protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest | undefined ), {} | undefined @@ -700,33 +748,44 @@ export class GameServerClustersServiceClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.previewDeleteGameServerCluster( + return this.innerApiCalls.previewDeleteGameServerCluster( request, options, callback ); } previewUpdateGameServerCluster( - request: protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, + request: protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, + protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, ( - | protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest + | protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest | undefined ), {} | undefined ] >; previewUpdateGameServerCluster( - request: protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, + request: protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, - | protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest + protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, + | protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest + | null | undefined, - {} | 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; /** @@ -741,26 +800,28 @@ export class GameServerClustersServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ previewUpdateGameServerCluster( - request: protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, + request: protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, - | protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest + protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, + | protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, - | protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest + protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, + | protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, + protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, ( - | protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest + | protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest | undefined ), {} | undefined @@ -783,7 +844,7 @@ export class GameServerClustersServiceClient { 'game_server_cluster.name': request.gameServerCluster!.name || '', }); this.initialize(); - return this._innerApiCalls.previewUpdateGameServerCluster( + return this.innerApiCalls.previewUpdateGameServerCluster( request, options, callback @@ -791,28 +852,39 @@ export class GameServerClustersServiceClient { } createGameServerCluster( - request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, + request: protos.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; createGameServerCluster( - request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, + request: protos.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + 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; /** @@ -827,32 +899,32 @@ export class GameServerClustersServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ createGameServerCluster( - request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, + request: protos.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -873,35 +945,46 @@ export class GameServerClustersServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.createGameServerCluster( + return this.innerApiCalls.createGameServerCluster( request, options, callback ); } deleteGameServerCluster( - request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, + request: protos.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; deleteGameServerCluster( - request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, + request: protos.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGameServerCluster( + request: protos.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): void; /** @@ -916,32 +999,32 @@ export class GameServerClustersServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ deleteGameServerCluster( - request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, + request: protos.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -962,35 +1045,46 @@ export class GameServerClustersServiceClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.deleteGameServerCluster( + return this.innerApiCalls.deleteGameServerCluster( request, options, callback ); } updateGameServerCluster( - request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, + request: protos.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; updateGameServerCluster( - request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, + request: protos.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + 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; /** @@ -1005,32 +1099,32 @@ export class GameServerClustersServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ updateGameServerCluster( - request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, + request: protos.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerCluster, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -1051,7 +1145,7 @@ export class GameServerClustersServiceClient { 'game_server_cluster.name': request.gameServerCluster!.name || '', }); this.initialize(); - return this._innerApiCalls.updateGameServerCluster( + return this.innerApiCalls.updateGameServerCluster( request, options, callback @@ -1076,11 +1170,11 @@ export class GameServerClustersServiceClient { realm: string, cluster: string ) { - return this._pathTemplates.gameServerClusterPathTemplate.render({ - project, - location, - realm, - cluster, + return this.pathTemplates.gameServerClusterPathTemplate.render({ + project: project, + location: location, + realm: realm, + cluster: cluster, }); } @@ -1092,7 +1186,7 @@ export class GameServerClustersServiceClient { * @returns {string} A string representing the project. */ matchProjectFromGameServerClusterName(gameServerClusterName: string) { - return this._pathTemplates.gameServerClusterPathTemplate.match( + return this.pathTemplates.gameServerClusterPathTemplate.match( gameServerClusterName ).project; } @@ -1105,7 +1199,7 @@ export class GameServerClustersServiceClient { * @returns {string} A string representing the location. */ matchLocationFromGameServerClusterName(gameServerClusterName: string) { - return this._pathTemplates.gameServerClusterPathTemplate.match( + return this.pathTemplates.gameServerClusterPathTemplate.match( gameServerClusterName ).location; } @@ -1118,7 +1212,7 @@ export class GameServerClustersServiceClient { * @returns {string} A string representing the realm. */ matchRealmFromGameServerClusterName(gameServerClusterName: string) { - return this._pathTemplates.gameServerClusterPathTemplate.match( + return this.pathTemplates.gameServerClusterPathTemplate.match( gameServerClusterName ).realm; } @@ -1131,7 +1225,7 @@ export class GameServerClustersServiceClient { * @returns {string} A string representing the cluster. */ matchClusterFromGameServerClusterName(gameServerClusterName: string) { - return this._pathTemplates.gameServerClusterPathTemplate.match( + return this.pathTemplates.gameServerClusterPathTemplate.match( gameServerClusterName ).cluster; } @@ -1151,11 +1245,11 @@ export class GameServerClustersServiceClient { deployment: string, config: string ) { - return this._pathTemplates.gameServerConfigPathTemplate.render({ - project, - location, - deployment, - config, + return this.pathTemplates.gameServerConfigPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + config: config, }); } @@ -1167,7 +1261,7 @@ export class GameServerClustersServiceClient { * @returns {string} A string representing the project. */ matchProjectFromGameServerConfigName(gameServerConfigName: string) { - return this._pathTemplates.gameServerConfigPathTemplate.match( + return this.pathTemplates.gameServerConfigPathTemplate.match( gameServerConfigName ).project; } @@ -1180,7 +1274,7 @@ export class GameServerClustersServiceClient { * @returns {string} A string representing the location. */ matchLocationFromGameServerConfigName(gameServerConfigName: string) { - return this._pathTemplates.gameServerConfigPathTemplate.match( + return this.pathTemplates.gameServerConfigPathTemplate.match( gameServerConfigName ).location; } @@ -1193,7 +1287,7 @@ export class GameServerClustersServiceClient { * @returns {string} A string representing the deployment. */ matchDeploymentFromGameServerConfigName(gameServerConfigName: string) { - return this._pathTemplates.gameServerConfigPathTemplate.match( + return this.pathTemplates.gameServerConfigPathTemplate.match( gameServerConfigName ).deployment; } @@ -1206,7 +1300,7 @@ export class GameServerClustersServiceClient { * @returns {string} A string representing the config. */ matchConfigFromGameServerConfigName(gameServerConfigName: string) { - return this._pathTemplates.gameServerConfigPathTemplate.match( + return this.pathTemplates.gameServerConfigPathTemplate.match( gameServerConfigName ).config; } @@ -1224,10 +1318,10 @@ export class GameServerClustersServiceClient { location: string, deployment: string ) { - return this._pathTemplates.gameServerDeploymentPathTemplate.render({ - project, - location, - deployment, + return this.pathTemplates.gameServerDeploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, }); } @@ -1239,7 +1333,7 @@ export class GameServerClustersServiceClient { * @returns {string} A string representing the project. */ matchProjectFromGameServerDeploymentName(gameServerDeploymentName: string) { - return this._pathTemplates.gameServerDeploymentPathTemplate.match( + return this.pathTemplates.gameServerDeploymentPathTemplate.match( gameServerDeploymentName ).project; } @@ -1252,7 +1346,7 @@ export class GameServerClustersServiceClient { * @returns {string} A string representing the location. */ matchLocationFromGameServerDeploymentName(gameServerDeploymentName: string) { - return this._pathTemplates.gameServerDeploymentPathTemplate.match( + return this.pathTemplates.gameServerDeploymentPathTemplate.match( gameServerDeploymentName ).location; } @@ -1267,7 +1361,7 @@ export class GameServerClustersServiceClient { matchDeploymentFromGameServerDeploymentName( gameServerDeploymentName: string ) { - return this._pathTemplates.gameServerDeploymentPathTemplate.match( + return this.pathTemplates.gameServerDeploymentPathTemplate.match( gameServerDeploymentName ).deployment; } @@ -1285,10 +1379,10 @@ export class GameServerClustersServiceClient { location: string, deployment: string ) { - return this._pathTemplates.gameServerDeploymentRolloutPathTemplate.render({ - project, - location, - deployment, + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.render({ + project: project, + location: location, + deployment: deployment, }); } @@ -1302,7 +1396,7 @@ export class GameServerClustersServiceClient { matchProjectFromGameServerDeploymentRolloutName( gameServerDeploymentRolloutName: string ) { - return this._pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( gameServerDeploymentRolloutName ).project; } @@ -1317,7 +1411,7 @@ export class GameServerClustersServiceClient { matchLocationFromGameServerDeploymentRolloutName( gameServerDeploymentRolloutName: string ) { - return this._pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( gameServerDeploymentRolloutName ).location; } @@ -1332,7 +1426,7 @@ export class GameServerClustersServiceClient { matchDeploymentFromGameServerDeploymentRolloutName( gameServerDeploymentRolloutName: string ) { - return this._pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( gameServerDeploymentRolloutName ).deployment; } @@ -1346,10 +1440,10 @@ export class GameServerClustersServiceClient { * @returns {string} Resource name string. */ realmPath(project: string, location: string, realm: string) { - return this._pathTemplates.realmPathTemplate.render({ - project, - location, - realm, + return this.pathTemplates.realmPathTemplate.render({ + project: project, + location: location, + realm: realm, }); } @@ -1361,7 +1455,7 @@ export class GameServerClustersServiceClient { * @returns {string} A string representing the project. */ matchProjectFromRealmName(realmName: string) { - return this._pathTemplates.realmPathTemplate.match(realmName).project; + return this.pathTemplates.realmPathTemplate.match(realmName).project; } /** @@ -1372,7 +1466,7 @@ export class GameServerClustersServiceClient { * @returns {string} A string representing the location. */ matchLocationFromRealmName(realmName: string) { - return this._pathTemplates.realmPathTemplate.match(realmName).location; + return this.pathTemplates.realmPathTemplate.match(realmName).location; } /** @@ -1383,7 +1477,7 @@ export class GameServerClustersServiceClient { * @returns {string} A string representing the realm. */ matchRealmFromRealmName(realmName: string) { - return this._pathTemplates.realmPathTemplate.match(realmName).realm; + return this.pathTemplates.realmPathTemplate.match(realmName).realm; } /** 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 index d5dccd134fe..a15f97ab699 100644 --- 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 @@ -18,7 +18,6 @@ import * as gax from 'google-gax'; import { - APICallback, Callback, CallOptions, Descriptors, @@ -27,7 +26,7 @@ import { } from 'google-gax'; import * as path from 'path'; -import * as protosTypes from '../../protos/protos'; +import * as protos from '../../protos/protos'; import * as gapicConfig from './game_server_configs_service_client_config.json'; const version = require('../../../package.json').version; @@ -38,14 +37,6 @@ const version = require('../../../package.json').version; * @memberof v1beta */ export class GameServerConfigsServiceClient { - private _descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - private _innerApiCalls: {[name: string]: Function}; - private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; private _opts: ClientOptions; private _gaxModule: typeof gax | typeof gax.fallback; @@ -53,6 +44,14 @@ export class GameServerConfigsServiceClient { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; gameServerConfigsServiceStub?: Promise<{[name: string]: Function}>; @@ -147,13 +146,16 @@ export class GameServerConfigsServiceClient { 'protos.json' ); this._protos = this._gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. - this._pathTemplates = { + this.pathTemplates = { gameServerClusterPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}' ), @@ -176,6 +178,7 @@ export class GameServerConfigsServiceClient { // rather than holding a request open. const protoFilesRoot = opts.fallback ? this._gaxModule.protobuf.Root.fromJSON( + // eslint-disable-next-line @typescript-eslint/no-var-requires require('../../protos/protos.json') ) : this._gaxModule.protobuf.loadSync(nodejsProtoPath); @@ -199,7 +202,7 @@ export class GameServerConfigsServiceClient { '.google.cloud.gaming.v1beta.OperationMetadata' ) as gax.protobuf.Type; - this._descriptors.longrunning = { + this.descriptors.longrunning = { createGameServerConfig: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createGameServerConfigResponse.decode.bind( @@ -231,7 +234,7 @@ export class GameServerConfigsServiceClient { // 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 = {}; + this.innerApiCalls = {}; } /** @@ -258,7 +261,7 @@ export class GameServerConfigsServiceClient { ? (this._protos as protobuf.Root).lookupService( 'google.cloud.gaming.v1beta.GameServerConfigsService' ) - : // tslint:disable-next-line no-any + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.gaming.v1beta .GameServerConfigsService, this._opts @@ -272,9 +275,8 @@ export class GameServerConfigsServiceClient { 'createGameServerConfig', 'deleteGameServerConfig', ]; - for (const methodName of gameServerConfigsServiceStubMethods) { - const innerCallPromise = this.gameServerConfigsServiceStub.then( + const callPromise = this.gameServerConfigsServiceStub.then( stub => (...args: Array<{}>) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); @@ -288,20 +290,14 @@ export class GameServerConfigsServiceClient { ); const apiCall = this._gaxModule.createApiCall( - innerCallPromise, + callPromise, this._defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.stream[methodName] || - this._descriptors.longrunning[methodName] + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); - this._innerApiCalls[methodName] = ( - argument: {}, - callOptions?: CallOptions, - callback?: APICallback - ) => { - return apiCall(argument, callOptions, callback); - }; + this.innerApiCalls[methodName] = apiCall; } return this.gameServerConfigsServiceStub; @@ -358,26 +354,37 @@ export class GameServerConfigsServiceClient { // -- Service calls -- // ------------------- listGameServerConfigs( - request: protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + request: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsResponse, + protos.google.cloud.gaming.v1beta.IListGameServerConfigsResponse, ( - | protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsRequest + | protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest | undefined ), {} | undefined ] >; listGameServerConfigs( - request: protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + request: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsResponse, - | protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsRequest + protos.google.cloud.gaming.v1beta.IListGameServerConfigsResponse, + | protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + listGameServerConfigs( + request: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + callback: Callback< + protos.google.cloud.gaming.v1beta.IListGameServerConfigsResponse, + | protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -393,26 +400,28 @@ export class GameServerConfigsServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ listGameServerConfigs( - request: protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + request: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsResponse, - | protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsRequest + protos.google.cloud.gaming.v1beta.IListGameServerConfigsResponse, + | protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsResponse, - | protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsRequest + protos.google.cloud.gaming.v1beta.IListGameServerConfigsResponse, + | protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsResponse, + protos.google.cloud.gaming.v1beta.IListGameServerConfigsResponse, ( - | protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsRequest + | protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest | undefined ), {} | undefined @@ -435,33 +444,37 @@ export class GameServerConfigsServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.listGameServerConfigs( - request, - options, - callback - ); + return this.innerApiCalls.listGameServerConfigs(request, options, callback); } getGameServerConfig( - request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, + request: protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, - ( - | protosTypes.google.cloud.gaming.v1beta.IGetGameServerConfigRequest - | undefined - ), + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest | undefined, {} | undefined ] >; getGameServerConfig( - request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, + request: protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, - | protosTypes.google.cloud.gaming.v1beta.IGetGameServerConfigRequest + protos.google.cloud.gaming.v1beta.IGameServerConfig, + | protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest + | null | undefined, - {} | 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; /** @@ -476,28 +489,27 @@ export class GameServerConfigsServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getGameServerConfig( - request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, + request: protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, - | protosTypes.google.cloud.gaming.v1beta.IGetGameServerConfigRequest + protos.google.cloud.gaming.v1beta.IGameServerConfig, + | protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, - | protosTypes.google.cloud.gaming.v1beta.IGetGameServerConfigRequest + protos.google.cloud.gaming.v1beta.IGameServerConfig, + | protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, - ( - | protosTypes.google.cloud.gaming.v1beta.IGetGameServerConfigRequest - | undefined - ), + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest | undefined, {} | undefined ] > | void { @@ -518,32 +530,43 @@ export class GameServerConfigsServiceClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.getGameServerConfig(request, options, callback); + return this.innerApiCalls.getGameServerConfig(request, options, callback); } createGameServerConfig( - request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, + request: protos.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; createGameServerConfig( - request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, + request: protos.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + 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; /** @@ -560,32 +583,32 @@ export class GameServerConfigsServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ createGameServerConfig( - request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, + request: protos.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -606,35 +629,46 @@ export class GameServerConfigsServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.createGameServerConfig( + return this.innerApiCalls.createGameServerConfig( request, options, callback ); } deleteGameServerConfig( - request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, + request: protos.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; deleteGameServerConfig( - request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, + request: protos.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGameServerConfig( + request: protos.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): void; /** @@ -650,32 +684,32 @@ export class GameServerConfigsServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ deleteGameServerConfig( - request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, + request: protos.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerConfig, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -696,7 +730,7 @@ export class GameServerConfigsServiceClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.deleteGameServerConfig( + return this.innerApiCalls.deleteGameServerConfig( request, options, callback @@ -721,11 +755,11 @@ export class GameServerConfigsServiceClient { realm: string, cluster: string ) { - return this._pathTemplates.gameServerClusterPathTemplate.render({ - project, - location, - realm, - cluster, + return this.pathTemplates.gameServerClusterPathTemplate.render({ + project: project, + location: location, + realm: realm, + cluster: cluster, }); } @@ -737,7 +771,7 @@ export class GameServerConfigsServiceClient { * @returns {string} A string representing the project. */ matchProjectFromGameServerClusterName(gameServerClusterName: string) { - return this._pathTemplates.gameServerClusterPathTemplate.match( + return this.pathTemplates.gameServerClusterPathTemplate.match( gameServerClusterName ).project; } @@ -750,7 +784,7 @@ export class GameServerConfigsServiceClient { * @returns {string} A string representing the location. */ matchLocationFromGameServerClusterName(gameServerClusterName: string) { - return this._pathTemplates.gameServerClusterPathTemplate.match( + return this.pathTemplates.gameServerClusterPathTemplate.match( gameServerClusterName ).location; } @@ -763,7 +797,7 @@ export class GameServerConfigsServiceClient { * @returns {string} A string representing the realm. */ matchRealmFromGameServerClusterName(gameServerClusterName: string) { - return this._pathTemplates.gameServerClusterPathTemplate.match( + return this.pathTemplates.gameServerClusterPathTemplate.match( gameServerClusterName ).realm; } @@ -776,7 +810,7 @@ export class GameServerConfigsServiceClient { * @returns {string} A string representing the cluster. */ matchClusterFromGameServerClusterName(gameServerClusterName: string) { - return this._pathTemplates.gameServerClusterPathTemplate.match( + return this.pathTemplates.gameServerClusterPathTemplate.match( gameServerClusterName ).cluster; } @@ -796,11 +830,11 @@ export class GameServerConfigsServiceClient { deployment: string, config: string ) { - return this._pathTemplates.gameServerConfigPathTemplate.render({ - project, - location, - deployment, - config, + return this.pathTemplates.gameServerConfigPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + config: config, }); } @@ -812,7 +846,7 @@ export class GameServerConfigsServiceClient { * @returns {string} A string representing the project. */ matchProjectFromGameServerConfigName(gameServerConfigName: string) { - return this._pathTemplates.gameServerConfigPathTemplate.match( + return this.pathTemplates.gameServerConfigPathTemplate.match( gameServerConfigName ).project; } @@ -825,7 +859,7 @@ export class GameServerConfigsServiceClient { * @returns {string} A string representing the location. */ matchLocationFromGameServerConfigName(gameServerConfigName: string) { - return this._pathTemplates.gameServerConfigPathTemplate.match( + return this.pathTemplates.gameServerConfigPathTemplate.match( gameServerConfigName ).location; } @@ -838,7 +872,7 @@ export class GameServerConfigsServiceClient { * @returns {string} A string representing the deployment. */ matchDeploymentFromGameServerConfigName(gameServerConfigName: string) { - return this._pathTemplates.gameServerConfigPathTemplate.match( + return this.pathTemplates.gameServerConfigPathTemplate.match( gameServerConfigName ).deployment; } @@ -851,7 +885,7 @@ export class GameServerConfigsServiceClient { * @returns {string} A string representing the config. */ matchConfigFromGameServerConfigName(gameServerConfigName: string) { - return this._pathTemplates.gameServerConfigPathTemplate.match( + return this.pathTemplates.gameServerConfigPathTemplate.match( gameServerConfigName ).config; } @@ -869,10 +903,10 @@ export class GameServerConfigsServiceClient { location: string, deployment: string ) { - return this._pathTemplates.gameServerDeploymentPathTemplate.render({ - project, - location, - deployment, + return this.pathTemplates.gameServerDeploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, }); } @@ -884,7 +918,7 @@ export class GameServerConfigsServiceClient { * @returns {string} A string representing the project. */ matchProjectFromGameServerDeploymentName(gameServerDeploymentName: string) { - return this._pathTemplates.gameServerDeploymentPathTemplate.match( + return this.pathTemplates.gameServerDeploymentPathTemplate.match( gameServerDeploymentName ).project; } @@ -897,7 +931,7 @@ export class GameServerConfigsServiceClient { * @returns {string} A string representing the location. */ matchLocationFromGameServerDeploymentName(gameServerDeploymentName: string) { - return this._pathTemplates.gameServerDeploymentPathTemplate.match( + return this.pathTemplates.gameServerDeploymentPathTemplate.match( gameServerDeploymentName ).location; } @@ -912,7 +946,7 @@ export class GameServerConfigsServiceClient { matchDeploymentFromGameServerDeploymentName( gameServerDeploymentName: string ) { - return this._pathTemplates.gameServerDeploymentPathTemplate.match( + return this.pathTemplates.gameServerDeploymentPathTemplate.match( gameServerDeploymentName ).deployment; } @@ -930,10 +964,10 @@ export class GameServerConfigsServiceClient { location: string, deployment: string ) { - return this._pathTemplates.gameServerDeploymentRolloutPathTemplate.render({ - project, - location, - deployment, + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.render({ + project: project, + location: location, + deployment: deployment, }); } @@ -947,7 +981,7 @@ export class GameServerConfigsServiceClient { matchProjectFromGameServerDeploymentRolloutName( gameServerDeploymentRolloutName: string ) { - return this._pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( gameServerDeploymentRolloutName ).project; } @@ -962,7 +996,7 @@ export class GameServerConfigsServiceClient { matchLocationFromGameServerDeploymentRolloutName( gameServerDeploymentRolloutName: string ) { - return this._pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( gameServerDeploymentRolloutName ).location; } @@ -977,7 +1011,7 @@ export class GameServerConfigsServiceClient { matchDeploymentFromGameServerDeploymentRolloutName( gameServerDeploymentRolloutName: string ) { - return this._pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( gameServerDeploymentRolloutName ).deployment; } @@ -991,10 +1025,10 @@ export class GameServerConfigsServiceClient { * @returns {string} Resource name string. */ realmPath(project: string, location: string, realm: string) { - return this._pathTemplates.realmPathTemplate.render({ - project, - location, - realm, + return this.pathTemplates.realmPathTemplate.render({ + project: project, + location: location, + realm: realm, }); } @@ -1006,7 +1040,7 @@ export class GameServerConfigsServiceClient { * @returns {string} A string representing the project. */ matchProjectFromRealmName(realmName: string) { - return this._pathTemplates.realmPathTemplate.match(realmName).project; + return this.pathTemplates.realmPathTemplate.match(realmName).project; } /** @@ -1017,7 +1051,7 @@ export class GameServerConfigsServiceClient { * @returns {string} A string representing the location. */ matchLocationFromRealmName(realmName: string) { - return this._pathTemplates.realmPathTemplate.match(realmName).location; + return this.pathTemplates.realmPathTemplate.match(realmName).location; } /** @@ -1028,7 +1062,7 @@ export class GameServerConfigsServiceClient { * @returns {string} A string representing the realm. */ matchRealmFromRealmName(realmName: string) { - return this._pathTemplates.realmPathTemplate.match(realmName).realm; + return this.pathTemplates.realmPathTemplate.match(realmName).realm; } /** 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 index e4d27a173ea..718b0d64672 100644 --- 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 @@ -18,7 +18,6 @@ import * as gax from 'google-gax'; import { - APICallback, Callback, CallOptions, Descriptors, @@ -27,7 +26,7 @@ import { } from 'google-gax'; import * as path from 'path'; -import * as protosTypes from '../../protos/protos'; +import * as protos from '../../protos/protos'; import * as gapicConfig from './game_server_deployments_service_client_config.json'; const version = require('../../../package.json').version; @@ -39,14 +38,6 @@ const version = require('../../../package.json').version; * @memberof v1beta */ export class GameServerDeploymentsServiceClient { - private _descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - private _innerApiCalls: {[name: string]: Function}; - private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; private _opts: ClientOptions; private _gaxModule: typeof gax | typeof gax.fallback; @@ -54,6 +45,14 @@ export class GameServerDeploymentsServiceClient { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; gameServerDeploymentsServiceStub?: Promise<{[name: string]: Function}>; @@ -148,13 +147,16 @@ export class GameServerDeploymentsServiceClient { 'protos.json' ); this._protos = this._gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. - this._pathTemplates = { + this.pathTemplates = { gameServerClusterPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}' ), @@ -177,6 +179,7 @@ export class GameServerDeploymentsServiceClient { // rather than holding a request open. const protoFilesRoot = opts.fallback ? this._gaxModule.protobuf.Root.fromJSON( + // eslint-disable-next-line @typescript-eslint/no-var-requires require('../../protos/protos.json') ) : this._gaxModule.protobuf.loadSync(nodejsProtoPath); @@ -212,7 +215,7 @@ export class GameServerDeploymentsServiceClient { '.google.cloud.gaming.v1beta.OperationMetadata' ) as gax.protobuf.Type; - this._descriptors.longrunning = { + this.descriptors.longrunning = { createGameServerDeployment: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createGameServerDeploymentResponse.decode.bind( @@ -262,7 +265,7 @@ export class GameServerDeploymentsServiceClient { // 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 = {}; + this.innerApiCalls = {}; } /** @@ -289,7 +292,7 @@ export class GameServerDeploymentsServiceClient { ? (this._protos as protobuf.Root).lookupService( 'google.cloud.gaming.v1beta.GameServerDeploymentsService' ) - : // tslint:disable-next-line no-any + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.gaming.v1beta .GameServerDeploymentsService, this._opts @@ -308,9 +311,8 @@ export class GameServerDeploymentsServiceClient { 'previewGameServerDeploymentRollout', 'fetchDeploymentState', ]; - for (const methodName of gameServerDeploymentsServiceStubMethods) { - const innerCallPromise = this.gameServerDeploymentsServiceStub.then( + const callPromise = this.gameServerDeploymentsServiceStub.then( stub => (...args: Array<{}>) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); @@ -324,20 +326,14 @@ export class GameServerDeploymentsServiceClient { ); const apiCall = this._gaxModule.createApiCall( - innerCallPromise, + callPromise, this._defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.stream[methodName] || - this._descriptors.longrunning[methodName] + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); - this._innerApiCalls[methodName] = ( - argument: {}, - callOptions?: CallOptions, - callback?: APICallback - ) => { - return apiCall(argument, callOptions, callback); - }; + this.innerApiCalls[methodName] = apiCall; } return this.gameServerDeploymentsServiceStub; @@ -394,26 +390,37 @@ export class GameServerDeploymentsServiceClient { // -- Service calls -- // ------------------- listGameServerDeployments( - request: protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + request: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, + protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, ( - | protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest + | protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest | undefined ), {} | undefined ] >; listGameServerDeployments( - request: protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + request: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, - | protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest + protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, + | protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest + | null | undefined, - {} | undefined + {} | null | undefined + > + ): void; + listGameServerDeployments( + request: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + callback: Callback< + protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, + | protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest + | null + | undefined, + {} | null | undefined > ): void; /** @@ -428,26 +435,28 @@ export class GameServerDeploymentsServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ listGameServerDeployments( - request: protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + request: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, - | protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest + protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, + | protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, - | protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest + protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, + | protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, + protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, ( - | protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest + | protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest | undefined ), {} | undefined @@ -470,33 +479,44 @@ export class GameServerDeploymentsServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.listGameServerDeployments( + return this.innerApiCalls.listGameServerDeployments( request, options, callback ); } getGameServerDeployment( - request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, + request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IGameServerDeployment, ( - | protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest + | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest | undefined ), {} | undefined ] >; getGameServerDeployment( - request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, + request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - | protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest + | null | undefined, - {} | 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; /** @@ -511,26 +531,28 @@ export class GameServerDeploymentsServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getGameServerDeployment( - request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, + request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - | protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - | protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IGameServerDeployment, ( - | protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest + | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest | undefined ), {} | undefined @@ -553,33 +575,44 @@ export class GameServerDeploymentsServiceClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.getGameServerDeployment( + return this.innerApiCalls.getGameServerDeployment( request, options, callback ); } getGameServerDeploymentRollout( - request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, + request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, + protos.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, ( - | protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest + | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest | undefined ), {} | undefined ] >; getGameServerDeploymentRollout( - request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, + request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, - | protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest + protos.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, + | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest + | null | undefined, - {} | 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; /** @@ -594,26 +627,28 @@ export class GameServerDeploymentsServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getGameServerDeploymentRollout( - request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, + request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, - | protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest + protos.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, + | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, - | protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest + protos.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, + | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, + protos.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, ( - | protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest + | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest | undefined ), {} | undefined @@ -636,33 +671,44 @@ export class GameServerDeploymentsServiceClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.getGameServerDeploymentRollout( + return this.innerApiCalls.getGameServerDeploymentRollout( request, options, callback ); } previewGameServerDeploymentRollout( - request: protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, + request: protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, + protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, ( - | protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest + | protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest | undefined ), {} | undefined ] >; previewGameServerDeploymentRollout( - request: protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, + request: protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, - | protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest + protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, + | protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest + | null | undefined, - {} | 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; /** @@ -678,26 +724,28 @@ export class GameServerDeploymentsServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ previewGameServerDeploymentRollout( - request: protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, + request: protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, - | protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest + protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, + | protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, - | protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest + protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, + | protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, + protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, ( - | protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest + | protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest | undefined ), {} | undefined @@ -720,33 +768,44 @@ export class GameServerDeploymentsServiceClient { 'rollout.name': request.rollout!.name || '', }); this.initialize(); - return this._innerApiCalls.previewGameServerDeploymentRollout( + return this.innerApiCalls.previewGameServerDeploymentRollout( request, options, callback ); } fetchDeploymentState( - request: protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, + request: protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, + protos.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, ( - | protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest + | protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest | undefined ), {} | undefined ] >; fetchDeploymentState( - request: protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, + request: protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, - | protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest + protos.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, + | protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest + | null | undefined, - {} | 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; /** @@ -763,26 +822,28 @@ export class GameServerDeploymentsServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ fetchDeploymentState( - request: protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, + request: protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, - | protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest + protos.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, + | protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, - | protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest + protos.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, + | protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, + protos.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, ( - | protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest + | protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest | undefined ), {} | undefined @@ -805,32 +866,43 @@ export class GameServerDeploymentsServiceClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.fetchDeploymentState(request, options, callback); + return this.innerApiCalls.fetchDeploymentState(request, options, callback); } createGameServerDeployment( - request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, + request: protos.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; createGameServerDeployment( - request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, + request: protos.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + 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; /** @@ -845,32 +917,32 @@ export class GameServerDeploymentsServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ createGameServerDeployment( - request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, + request: protos.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -891,35 +963,46 @@ export class GameServerDeploymentsServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.createGameServerDeployment( + return this.innerApiCalls.createGameServerDeployment( request, options, callback ); } deleteGameServerDeployment( - request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, + request: protos.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; deleteGameServerDeployment( - request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, + request: protos.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteGameServerDeployment( + request: protos.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): void; /** @@ -934,32 +1017,32 @@ export class GameServerDeploymentsServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ deleteGameServerDeployment( - request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, + request: protos.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -980,35 +1063,46 @@ export class GameServerDeploymentsServiceClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.deleteGameServerDeployment( + return this.innerApiCalls.deleteGameServerDeployment( request, options, callback ); } updateGameServerDeployment( - request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, + request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; updateGameServerDeployment( - request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, + request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + 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; /** @@ -1023,32 +1117,32 @@ export class GameServerDeploymentsServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ updateGameServerDeployment( - request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, + request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -1069,39 +1163,55 @@ export class GameServerDeploymentsServiceClient { 'game_server_deployment.name': request.gameServerDeployment!.name || '', }); this.initialize(); - return this._innerApiCalls.updateGameServerDeployment( + return this.innerApiCalls.updateGameServerDeployment( request, options, callback ); } updateGameServerDeploymentRollout( - request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, + request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; updateGameServerDeploymentRollout( - request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, + request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + 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; /** * 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. @@ -1112,32 +1222,32 @@ export class GameServerDeploymentsServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ updateGameServerDeploymentRollout( - request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, + request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IGameServerDeployment, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -1158,7 +1268,7 @@ export class GameServerDeploymentsServiceClient { 'rollout.name': request.rollout!.name || '', }); this.initialize(); - return this._innerApiCalls.updateGameServerDeploymentRollout( + return this.innerApiCalls.updateGameServerDeploymentRollout( request, options, callback @@ -1183,11 +1293,11 @@ export class GameServerDeploymentsServiceClient { realm: string, cluster: string ) { - return this._pathTemplates.gameServerClusterPathTemplate.render({ - project, - location, - realm, - cluster, + return this.pathTemplates.gameServerClusterPathTemplate.render({ + project: project, + location: location, + realm: realm, + cluster: cluster, }); } @@ -1199,7 +1309,7 @@ export class GameServerDeploymentsServiceClient { * @returns {string} A string representing the project. */ matchProjectFromGameServerClusterName(gameServerClusterName: string) { - return this._pathTemplates.gameServerClusterPathTemplate.match( + return this.pathTemplates.gameServerClusterPathTemplate.match( gameServerClusterName ).project; } @@ -1212,7 +1322,7 @@ export class GameServerDeploymentsServiceClient { * @returns {string} A string representing the location. */ matchLocationFromGameServerClusterName(gameServerClusterName: string) { - return this._pathTemplates.gameServerClusterPathTemplate.match( + return this.pathTemplates.gameServerClusterPathTemplate.match( gameServerClusterName ).location; } @@ -1225,7 +1335,7 @@ export class GameServerDeploymentsServiceClient { * @returns {string} A string representing the realm. */ matchRealmFromGameServerClusterName(gameServerClusterName: string) { - return this._pathTemplates.gameServerClusterPathTemplate.match( + return this.pathTemplates.gameServerClusterPathTemplate.match( gameServerClusterName ).realm; } @@ -1238,7 +1348,7 @@ export class GameServerDeploymentsServiceClient { * @returns {string} A string representing the cluster. */ matchClusterFromGameServerClusterName(gameServerClusterName: string) { - return this._pathTemplates.gameServerClusterPathTemplate.match( + return this.pathTemplates.gameServerClusterPathTemplate.match( gameServerClusterName ).cluster; } @@ -1258,11 +1368,11 @@ export class GameServerDeploymentsServiceClient { deployment: string, config: string ) { - return this._pathTemplates.gameServerConfigPathTemplate.render({ - project, - location, - deployment, - config, + return this.pathTemplates.gameServerConfigPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + config: config, }); } @@ -1274,7 +1384,7 @@ export class GameServerDeploymentsServiceClient { * @returns {string} A string representing the project. */ matchProjectFromGameServerConfigName(gameServerConfigName: string) { - return this._pathTemplates.gameServerConfigPathTemplate.match( + return this.pathTemplates.gameServerConfigPathTemplate.match( gameServerConfigName ).project; } @@ -1287,7 +1397,7 @@ export class GameServerDeploymentsServiceClient { * @returns {string} A string representing the location. */ matchLocationFromGameServerConfigName(gameServerConfigName: string) { - return this._pathTemplates.gameServerConfigPathTemplate.match( + return this.pathTemplates.gameServerConfigPathTemplate.match( gameServerConfigName ).location; } @@ -1300,7 +1410,7 @@ export class GameServerDeploymentsServiceClient { * @returns {string} A string representing the deployment. */ matchDeploymentFromGameServerConfigName(gameServerConfigName: string) { - return this._pathTemplates.gameServerConfigPathTemplate.match( + return this.pathTemplates.gameServerConfigPathTemplate.match( gameServerConfigName ).deployment; } @@ -1313,7 +1423,7 @@ export class GameServerDeploymentsServiceClient { * @returns {string} A string representing the config. */ matchConfigFromGameServerConfigName(gameServerConfigName: string) { - return this._pathTemplates.gameServerConfigPathTemplate.match( + return this.pathTemplates.gameServerConfigPathTemplate.match( gameServerConfigName ).config; } @@ -1331,10 +1441,10 @@ export class GameServerDeploymentsServiceClient { location: string, deployment: string ) { - return this._pathTemplates.gameServerDeploymentPathTemplate.render({ - project, - location, - deployment, + return this.pathTemplates.gameServerDeploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, }); } @@ -1346,7 +1456,7 @@ export class GameServerDeploymentsServiceClient { * @returns {string} A string representing the project. */ matchProjectFromGameServerDeploymentName(gameServerDeploymentName: string) { - return this._pathTemplates.gameServerDeploymentPathTemplate.match( + return this.pathTemplates.gameServerDeploymentPathTemplate.match( gameServerDeploymentName ).project; } @@ -1359,7 +1469,7 @@ export class GameServerDeploymentsServiceClient { * @returns {string} A string representing the location. */ matchLocationFromGameServerDeploymentName(gameServerDeploymentName: string) { - return this._pathTemplates.gameServerDeploymentPathTemplate.match( + return this.pathTemplates.gameServerDeploymentPathTemplate.match( gameServerDeploymentName ).location; } @@ -1374,7 +1484,7 @@ export class GameServerDeploymentsServiceClient { matchDeploymentFromGameServerDeploymentName( gameServerDeploymentName: string ) { - return this._pathTemplates.gameServerDeploymentPathTemplate.match( + return this.pathTemplates.gameServerDeploymentPathTemplate.match( gameServerDeploymentName ).deployment; } @@ -1392,10 +1502,10 @@ export class GameServerDeploymentsServiceClient { location: string, deployment: string ) { - return this._pathTemplates.gameServerDeploymentRolloutPathTemplate.render({ - project, - location, - deployment, + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.render({ + project: project, + location: location, + deployment: deployment, }); } @@ -1409,7 +1519,7 @@ export class GameServerDeploymentsServiceClient { matchProjectFromGameServerDeploymentRolloutName( gameServerDeploymentRolloutName: string ) { - return this._pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( gameServerDeploymentRolloutName ).project; } @@ -1424,7 +1534,7 @@ export class GameServerDeploymentsServiceClient { matchLocationFromGameServerDeploymentRolloutName( gameServerDeploymentRolloutName: string ) { - return this._pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( gameServerDeploymentRolloutName ).location; } @@ -1439,7 +1549,7 @@ export class GameServerDeploymentsServiceClient { matchDeploymentFromGameServerDeploymentRolloutName( gameServerDeploymentRolloutName: string ) { - return this._pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( gameServerDeploymentRolloutName ).deployment; } @@ -1453,10 +1563,10 @@ export class GameServerDeploymentsServiceClient { * @returns {string} Resource name string. */ realmPath(project: string, location: string, realm: string) { - return this._pathTemplates.realmPathTemplate.render({ - project, - location, - realm, + return this.pathTemplates.realmPathTemplate.render({ + project: project, + location: location, + realm: realm, }); } @@ -1468,7 +1578,7 @@ export class GameServerDeploymentsServiceClient { * @returns {string} A string representing the project. */ matchProjectFromRealmName(realmName: string) { - return this._pathTemplates.realmPathTemplate.match(realmName).project; + return this.pathTemplates.realmPathTemplate.match(realmName).project; } /** @@ -1479,7 +1589,7 @@ export class GameServerDeploymentsServiceClient { * @returns {string} A string representing the location. */ matchLocationFromRealmName(realmName: string) { - return this._pathTemplates.realmPathTemplate.match(realmName).location; + return this.pathTemplates.realmPathTemplate.match(realmName).location; } /** @@ -1490,7 +1600,7 @@ export class GameServerDeploymentsServiceClient { * @returns {string} A string representing the realm. */ matchRealmFromRealmName(realmName: string) { - return this._pathTemplates.realmPathTemplate.match(realmName).realm; + return this.pathTemplates.realmPathTemplate.match(realmName).realm; } /** diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index d2ad30b92e6..019117ca424 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -18,7 +18,6 @@ import * as gax from 'google-gax'; import { - APICallback, Callback, CallOptions, Descriptors, @@ -27,7 +26,7 @@ import { } from 'google-gax'; import * as path from 'path'; -import * as protosTypes from '../../protos/protos'; +import * as protos from '../../protos/protos'; import * as gapicConfig from './realms_service_client_config.json'; const version = require('../../../package.json').version; @@ -39,14 +38,6 @@ const version = require('../../../package.json').version; * @memberof v1beta */ export class RealmsServiceClient { - private _descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - private _innerApiCalls: {[name: string]: Function}; - private _pathTemplates: {[name: string]: gax.PathTemplate}; private _terminated = false; private _opts: ClientOptions; private _gaxModule: typeof gax | typeof gax.fallback; @@ -54,6 +45,14 @@ export class RealmsServiceClient { private _protos: {}; private _defaults: {[method: string]: gax.CallSettings}; auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; realmsServiceStub?: Promise<{[name: string]: Function}>; @@ -146,13 +145,16 @@ export class RealmsServiceClient { 'protos.json' ); this._protos = this._gaxGrpc.loadProto( - opts.fallback ? require('../../protos/protos.json') : nodejsProtoPath + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath ); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. - this._pathTemplates = { + this.pathTemplates = { gameServerClusterPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}' ), @@ -175,6 +177,7 @@ export class RealmsServiceClient { // rather than holding a request open. const protoFilesRoot = opts.fallback ? this._gaxModule.protobuf.Root.fromJSON( + // eslint-disable-next-line @typescript-eslint/no-var-requires require('../../protos/protos.json') ) : this._gaxModule.protobuf.loadSync(nodejsProtoPath); @@ -204,7 +207,7 @@ export class RealmsServiceClient { '.google.cloud.gaming.v1beta.OperationMetadata' ) as gax.protobuf.Type; - this._descriptors.longrunning = { + this.descriptors.longrunning = { createRealm: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createRealmResponse.decode.bind(createRealmResponse), @@ -233,7 +236,7 @@ export class RealmsServiceClient { // 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 = {}; + this.innerApiCalls = {}; } /** @@ -260,7 +263,7 @@ export class RealmsServiceClient { ? (this._protos as protobuf.Root).lookupService( 'google.cloud.gaming.v1beta.RealmsService' ) - : // tslint:disable-next-line no-any + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.gaming.v1beta.RealmsService, this._opts ) as Promise<{[method: string]: Function}>; @@ -275,9 +278,8 @@ export class RealmsServiceClient { 'updateRealm', 'previewRealmUpdate', ]; - for (const methodName of realmsServiceStubMethods) { - const innerCallPromise = this.realmsServiceStub.then( + const callPromise = this.realmsServiceStub.then( stub => (...args: Array<{}>) => { if (this._terminated) { return Promise.reject('The client has already been closed.'); @@ -291,20 +293,14 @@ export class RealmsServiceClient { ); const apiCall = this._gaxModule.createApiCall( - innerCallPromise, + callPromise, this._defaults[methodName], - this._descriptors.page[methodName] || - this._descriptors.stream[methodName] || - this._descriptors.longrunning[methodName] + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] ); - this._innerApiCalls[methodName] = ( - argument: {}, - callOptions?: CallOptions, - callback?: APICallback - ) => { - return apiCall(argument, callOptions, callback); - }; + this.innerApiCalls[methodName] = apiCall; } return this.realmsServiceStub; @@ -361,22 +357,30 @@ export class RealmsServiceClient { // -- Service calls -- // ------------------- listRealms( - request: protosTypes.google.cloud.gaming.v1beta.IListRealmsRequest, + request: protos.google.cloud.gaming.v1beta.IListRealmsRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IListRealmsResponse, - protosTypes.google.cloud.gaming.v1beta.IListRealmsRequest | undefined, + protos.google.cloud.gaming.v1beta.IListRealmsResponse, + protos.google.cloud.gaming.v1beta.IListRealmsRequest | undefined, {} | undefined ] >; listRealms( - request: protosTypes.google.cloud.gaming.v1beta.IListRealmsRequest, + request: protos.google.cloud.gaming.v1beta.IListRealmsRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.gaming.v1beta.IListRealmsResponse, - protosTypes.google.cloud.gaming.v1beta.IListRealmsRequest | undefined, - {} | undefined + protos.google.cloud.gaming.v1beta.IListRealmsResponse, + protos.google.cloud.gaming.v1beta.IListRealmsRequest | null | undefined, + {} | null | undefined + > + ): void; + listRealms( + request: protos.google.cloud.gaming.v1beta.IListRealmsRequest, + callback: Callback< + protos.google.cloud.gaming.v1beta.IListRealmsResponse, + protos.google.cloud.gaming.v1beta.IListRealmsRequest | null | undefined, + {} | null | undefined > ): void; /** @@ -391,23 +395,25 @@ export class RealmsServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ listRealms( - request: protosTypes.google.cloud.gaming.v1beta.IListRealmsRequest, + request: protos.google.cloud.gaming.v1beta.IListRealmsRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.gaming.v1beta.IListRealmsResponse, - protosTypes.google.cloud.gaming.v1beta.IListRealmsRequest | undefined, - {} | undefined + protos.google.cloud.gaming.v1beta.IListRealmsResponse, + | protos.google.cloud.gaming.v1beta.IListRealmsRequest + | null + | undefined, + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.gaming.v1beta.IListRealmsResponse, - protosTypes.google.cloud.gaming.v1beta.IListRealmsRequest | undefined, - {} | undefined + protos.google.cloud.gaming.v1beta.IListRealmsResponse, + protos.google.cloud.gaming.v1beta.IListRealmsRequest | null | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IListRealmsResponse, - protosTypes.google.cloud.gaming.v1beta.IListRealmsRequest | undefined, + protos.google.cloud.gaming.v1beta.IListRealmsResponse, + protos.google.cloud.gaming.v1beta.IListRealmsRequest | undefined, {} | undefined ] > | void { @@ -428,25 +434,33 @@ export class RealmsServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.listRealms(request, options, callback); + return this.innerApiCalls.listRealms(request, options, callback); } getRealm( - request: protosTypes.google.cloud.gaming.v1beta.IGetRealmRequest, + request: protos.google.cloud.gaming.v1beta.IGetRealmRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IRealm, - protosTypes.google.cloud.gaming.v1beta.IGetRealmRequest | undefined, + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IGetRealmRequest | undefined, {} | undefined ] >; getRealm( - request: protosTypes.google.cloud.gaming.v1beta.IGetRealmRequest, + request: protos.google.cloud.gaming.v1beta.IGetRealmRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.gaming.v1beta.IRealm, - protosTypes.google.cloud.gaming.v1beta.IGetRealmRequest | undefined, - {} | undefined + 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; /** @@ -461,23 +475,23 @@ export class RealmsServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ getRealm( - request: protosTypes.google.cloud.gaming.v1beta.IGetRealmRequest, + request: protos.google.cloud.gaming.v1beta.IGetRealmRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.gaming.v1beta.IRealm, - protosTypes.google.cloud.gaming.v1beta.IGetRealmRequest | undefined, - {} | undefined + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IGetRealmRequest | null | undefined, + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.gaming.v1beta.IRealm, - protosTypes.google.cloud.gaming.v1beta.IGetRealmRequest | undefined, - {} | undefined + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IGetRealmRequest | null | undefined, + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IRealm, - protosTypes.google.cloud.gaming.v1beta.IGetRealmRequest | undefined, + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IGetRealmRequest | undefined, {} | undefined ] > | void { @@ -498,29 +512,37 @@ export class RealmsServiceClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.getRealm(request, options, callback); + return this.innerApiCalls.getRealm(request, options, callback); } previewRealmUpdate( - request: protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, + request: protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, options?: gax.CallOptions ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, - ( - | protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest - | undefined - ), + protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, + protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest | undefined, {} | undefined ] >; previewRealmUpdate( - request: protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, + request: protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, options: gax.CallOptions, callback: Callback< - protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, - | protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest + protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, + | protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest + | null | undefined, - {} | 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; /** @@ -535,28 +557,27 @@ export class RealmsServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ previewRealmUpdate( - request: protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, + request: protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, optionsOrCallback?: | gax.CallOptions | Callback< - protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, - | protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest + protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, + | protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest + | null | undefined, - {} | undefined + {} | null | undefined >, callback?: Callback< - protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, - | protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest + protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, + | protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest + | null | undefined, - {} | undefined + {} | null | undefined > ): Promise< [ - protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, - ( - | protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest - | undefined - ), + protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, + protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest | undefined, {} | undefined ] > | void { @@ -577,32 +598,43 @@ export class RealmsServiceClient { 'realm.name': request.realm!.name || '', }); this.initialize(); - return this._innerApiCalls.previewRealmUpdate(request, options, callback); + return this.innerApiCalls.previewRealmUpdate(request, options, callback); } createRealm( - request: protosTypes.google.cloud.gaming.v1beta.ICreateRealmRequest, + request: protos.google.cloud.gaming.v1beta.ICreateRealmRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IRealm, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; createRealm( - request: protosTypes.google.cloud.gaming.v1beta.ICreateRealmRequest, + request: protos.google.cloud.gaming.v1beta.ICreateRealmRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IRealm, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + 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; /** @@ -617,32 +649,32 @@ export class RealmsServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ createRealm( - request: protosTypes.google.cloud.gaming.v1beta.ICreateRealmRequest, + request: protos.google.cloud.gaming.v1beta.ICreateRealmRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IRealm, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IRealm, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IRealm, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -663,31 +695,42 @@ export class RealmsServiceClient { parent: request.parent || '', }); this.initialize(); - return this._innerApiCalls.createRealm(request, options, callback); + return this.innerApiCalls.createRealm(request, options, callback); } deleteRealm( - request: protosTypes.google.cloud.gaming.v1beta.IDeleteRealmRequest, + request: protos.google.cloud.gaming.v1beta.IDeleteRealmRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IRealm, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; deleteRealm( - request: protosTypes.google.cloud.gaming.v1beta.IDeleteRealmRequest, + request: protos.google.cloud.gaming.v1beta.IDeleteRealmRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IRealm, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteRealm( + request: protos.google.cloud.gaming.v1beta.IDeleteRealmRequest, + callback: Callback< + LROperation< + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): void; /** @@ -702,32 +745,32 @@ export class RealmsServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ deleteRealm( - request: protosTypes.google.cloud.gaming.v1beta.IDeleteRealmRequest, + request: protos.google.cloud.gaming.v1beta.IDeleteRealmRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IRealm, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IRealm, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IRealm, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -748,31 +791,42 @@ export class RealmsServiceClient { name: request.name || '', }); this.initialize(); - return this._innerApiCalls.deleteRealm(request, options, callback); + return this.innerApiCalls.deleteRealm(request, options, callback); } updateRealm( - request: protosTypes.google.cloud.gaming.v1beta.IUpdateRealmRequest, + request: protos.google.cloud.gaming.v1beta.IUpdateRealmRequest, options?: gax.CallOptions ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IRealm, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] >; updateRealm( - request: protosTypes.google.cloud.gaming.v1beta.IUpdateRealmRequest, + request: protos.google.cloud.gaming.v1beta.IUpdateRealmRequest, options: gax.CallOptions, callback: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IRealm, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + 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; /** @@ -787,32 +841,32 @@ export class RealmsServiceClient { * The promise has a method named "cancel" which cancels the ongoing API call. */ updateRealm( - request: protosTypes.google.cloud.gaming.v1beta.IUpdateRealmRequest, + request: protos.google.cloud.gaming.v1beta.IUpdateRealmRequest, optionsOrCallback?: | gax.CallOptions | Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IRealm, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined >, callback?: Callback< LROperation< - protosTypes.google.cloud.gaming.v1beta.IRealm, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, - {} | undefined + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): Promise< [ LROperation< - protosTypes.google.cloud.gaming.v1beta.IRealm, - protosTypes.google.cloud.gaming.v1beta.IOperationMetadata + protos.google.cloud.gaming.v1beta.IRealm, + protos.google.cloud.gaming.v1beta.IOperationMetadata >, - protosTypes.google.longrunning.IOperation | undefined, + protos.google.longrunning.IOperation | undefined, {} | undefined ] > | void { @@ -833,7 +887,7 @@ export class RealmsServiceClient { 'realm.name': request.realm!.name || '', }); this.initialize(); - return this._innerApiCalls.updateRealm(request, options, callback); + return this.innerApiCalls.updateRealm(request, options, callback); } // -------------------- // -- Path templates -- @@ -854,11 +908,11 @@ export class RealmsServiceClient { realm: string, cluster: string ) { - return this._pathTemplates.gameServerClusterPathTemplate.render({ - project, - location, - realm, - cluster, + return this.pathTemplates.gameServerClusterPathTemplate.render({ + project: project, + location: location, + realm: realm, + cluster: cluster, }); } @@ -870,7 +924,7 @@ export class RealmsServiceClient { * @returns {string} A string representing the project. */ matchProjectFromGameServerClusterName(gameServerClusterName: string) { - return this._pathTemplates.gameServerClusterPathTemplate.match( + return this.pathTemplates.gameServerClusterPathTemplate.match( gameServerClusterName ).project; } @@ -883,7 +937,7 @@ export class RealmsServiceClient { * @returns {string} A string representing the location. */ matchLocationFromGameServerClusterName(gameServerClusterName: string) { - return this._pathTemplates.gameServerClusterPathTemplate.match( + return this.pathTemplates.gameServerClusterPathTemplate.match( gameServerClusterName ).location; } @@ -896,7 +950,7 @@ export class RealmsServiceClient { * @returns {string} A string representing the realm. */ matchRealmFromGameServerClusterName(gameServerClusterName: string) { - return this._pathTemplates.gameServerClusterPathTemplate.match( + return this.pathTemplates.gameServerClusterPathTemplate.match( gameServerClusterName ).realm; } @@ -909,7 +963,7 @@ export class RealmsServiceClient { * @returns {string} A string representing the cluster. */ matchClusterFromGameServerClusterName(gameServerClusterName: string) { - return this._pathTemplates.gameServerClusterPathTemplate.match( + return this.pathTemplates.gameServerClusterPathTemplate.match( gameServerClusterName ).cluster; } @@ -929,11 +983,11 @@ export class RealmsServiceClient { deployment: string, config: string ) { - return this._pathTemplates.gameServerConfigPathTemplate.render({ - project, - location, - deployment, - config, + return this.pathTemplates.gameServerConfigPathTemplate.render({ + project: project, + location: location, + deployment: deployment, + config: config, }); } @@ -945,7 +999,7 @@ export class RealmsServiceClient { * @returns {string} A string representing the project. */ matchProjectFromGameServerConfigName(gameServerConfigName: string) { - return this._pathTemplates.gameServerConfigPathTemplate.match( + return this.pathTemplates.gameServerConfigPathTemplate.match( gameServerConfigName ).project; } @@ -958,7 +1012,7 @@ export class RealmsServiceClient { * @returns {string} A string representing the location. */ matchLocationFromGameServerConfigName(gameServerConfigName: string) { - return this._pathTemplates.gameServerConfigPathTemplate.match( + return this.pathTemplates.gameServerConfigPathTemplate.match( gameServerConfigName ).location; } @@ -971,7 +1025,7 @@ export class RealmsServiceClient { * @returns {string} A string representing the deployment. */ matchDeploymentFromGameServerConfigName(gameServerConfigName: string) { - return this._pathTemplates.gameServerConfigPathTemplate.match( + return this.pathTemplates.gameServerConfigPathTemplate.match( gameServerConfigName ).deployment; } @@ -984,7 +1038,7 @@ export class RealmsServiceClient { * @returns {string} A string representing the config. */ matchConfigFromGameServerConfigName(gameServerConfigName: string) { - return this._pathTemplates.gameServerConfigPathTemplate.match( + return this.pathTemplates.gameServerConfigPathTemplate.match( gameServerConfigName ).config; } @@ -1002,10 +1056,10 @@ export class RealmsServiceClient { location: string, deployment: string ) { - return this._pathTemplates.gameServerDeploymentPathTemplate.render({ - project, - location, - deployment, + return this.pathTemplates.gameServerDeploymentPathTemplate.render({ + project: project, + location: location, + deployment: deployment, }); } @@ -1017,7 +1071,7 @@ export class RealmsServiceClient { * @returns {string} A string representing the project. */ matchProjectFromGameServerDeploymentName(gameServerDeploymentName: string) { - return this._pathTemplates.gameServerDeploymentPathTemplate.match( + return this.pathTemplates.gameServerDeploymentPathTemplate.match( gameServerDeploymentName ).project; } @@ -1030,7 +1084,7 @@ export class RealmsServiceClient { * @returns {string} A string representing the location. */ matchLocationFromGameServerDeploymentName(gameServerDeploymentName: string) { - return this._pathTemplates.gameServerDeploymentPathTemplate.match( + return this.pathTemplates.gameServerDeploymentPathTemplate.match( gameServerDeploymentName ).location; } @@ -1045,7 +1099,7 @@ export class RealmsServiceClient { matchDeploymentFromGameServerDeploymentName( gameServerDeploymentName: string ) { - return this._pathTemplates.gameServerDeploymentPathTemplate.match( + return this.pathTemplates.gameServerDeploymentPathTemplate.match( gameServerDeploymentName ).deployment; } @@ -1063,10 +1117,10 @@ export class RealmsServiceClient { location: string, deployment: string ) { - return this._pathTemplates.gameServerDeploymentRolloutPathTemplate.render({ - project, - location, - deployment, + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.render({ + project: project, + location: location, + deployment: deployment, }); } @@ -1080,7 +1134,7 @@ export class RealmsServiceClient { matchProjectFromGameServerDeploymentRolloutName( gameServerDeploymentRolloutName: string ) { - return this._pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( gameServerDeploymentRolloutName ).project; } @@ -1095,7 +1149,7 @@ export class RealmsServiceClient { matchLocationFromGameServerDeploymentRolloutName( gameServerDeploymentRolloutName: string ) { - return this._pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( gameServerDeploymentRolloutName ).location; } @@ -1110,7 +1164,7 @@ export class RealmsServiceClient { matchDeploymentFromGameServerDeploymentRolloutName( gameServerDeploymentRolloutName: string ) { - return this._pathTemplates.gameServerDeploymentRolloutPathTemplate.match( + return this.pathTemplates.gameServerDeploymentRolloutPathTemplate.match( gameServerDeploymentRolloutName ).deployment; } @@ -1124,10 +1178,10 @@ export class RealmsServiceClient { * @returns {string} Resource name string. */ realmPath(project: string, location: string, realm: string) { - return this._pathTemplates.realmPathTemplate.render({ - project, - location, - realm, + return this.pathTemplates.realmPathTemplate.render({ + project: project, + location: location, + realm: realm, }); } @@ -1139,7 +1193,7 @@ export class RealmsServiceClient { * @returns {string} A string representing the project. */ matchProjectFromRealmName(realmName: string) { - return this._pathTemplates.realmPathTemplate.match(realmName).project; + return this.pathTemplates.realmPathTemplate.match(realmName).project; } /** @@ -1150,7 +1204,7 @@ export class RealmsServiceClient { * @returns {string} A string representing the location. */ matchLocationFromRealmName(realmName: string) { - return this._pathTemplates.realmPathTemplate.match(realmName).location; + return this.pathTemplates.realmPathTemplate.match(realmName).location; } /** @@ -1161,7 +1215,7 @@ export class RealmsServiceClient { * @returns {string} A string representing the realm. */ matchRealmFromRealmName(realmName: string) { - return this._pathTemplates.realmPathTemplate.match(realmName).realm; + return this.pathTemplates.realmPathTemplate.match(realmName).realm; } /** diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index e6a09e486ff..1ae61381671 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -1,23 +1,5 @@ { - "updateTime": "2020-03-22T11:29:25.571404Z", - "sources": [ - { - "git": { - "name": "googleapis-private", - "remote": "https://github.com/googleapis/googleapis-private.git", - "sha": "e6378caa596533251006a9eb318f3f9e71984f2b", - "internalRef": "301441701", - "log": "e6378caa596533251006a9eb318f3f9e71984f2b\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 301441701\n\nf557255ffc2382115850c7e4832b5505676ae63b\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 299734673\n\n27f8117872914cb033c33f2351bee19d34f7b0cc\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 298524614\n\n71a4d0fafde0d09abd8ab93773eedfb4490f1e40\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 298477635\n\n" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "7e98e1609c91082f4eeb63b530c6468aefd18cfd" - } - } - ], + "updateTime": "2020-03-31T19:38:20.766291Z", "destinations": [ { "client": { 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 index ca8d73c6102..395eb46082f 100644 --- a/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.js @@ -16,7 +16,6 @@ // ** 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'); 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 index 38e748f15cf..b1c9997a65b 100644 --- a/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.ts @@ -16,13 +16,18 @@ // ** 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'; +import { + GameServerClustersServiceClient, + GameServerConfigsServiceClient, + GameServerDeploymentsServiceClient, + RealmsServiceClient, +} from '@google-cloud/game-servers'; function main() { - const gameServerClustersServiceClient = new GameServerClustersServiceClient(); - const gameServerConfigsServiceClient = new GameServerConfigsServiceClient(); - const gameServerDeploymentsServiceClient = new GameServerDeploymentsServiceClient(); - const realmsServiceClient = new RealmsServiceClient(); + new GameServerClustersServiceClient(); + new GameServerConfigsServiceClient(); + new GameServerDeploymentsServiceClient(); + new RealmsServiceClient(); } main(); 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 deleted file mode 100644 index dc53d99d273..00000000000 --- a/packages/google-cloud-gaming/test/gapic-game_server_clusters_service-v1beta.ts +++ /dev/null @@ -1,648 +0,0 @@ -// 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. ** - -import * as protosTypes from '../protos/protos'; -import * as assert from 'assert'; -import {describe, it} from 'mocha'; -const gameserverclustersserviceModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -class FakeError { - name: string; - message: string; - code: number; - constructor(n: number) { - this.name = 'fakeName'; - this.message = 'fake message'; - this.code = n; - } -} -const error = new FakeError(FAKE_STATUS_CODE); -export interface Callback { - (err: FakeError | null, response?: {} | null): void; -} - -export class Operation { - constructor() {} - promise() {} -} -function mockSimpleGrpcMethod( - expectedRequest: {}, - response: {} | null, - error: FakeError | null -) { - return (actualRequest: {}, options: {}, callback: Callback) => { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} -function mockLongRunningGrpcMethod( - expectedRequest: {}, - response: {} | null, - error?: {} | null -) { - return (request: {}) => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } - }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} -describe('v1beta.GameServerClustersServiceClient', () => { - 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', () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.close(); - }); - describe('listGameServerClusters', () => { - it('invokes listGameServerClusters without error', done => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.listGameServerClusters = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.listGameServerClusters(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes listGameServerClusters with error', done => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IListGameServerClustersRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.listGameServerClusters = mockSimpleGrpcMethod( - request, - null, - error - ); - client.listGameServerClusters(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('getGameServerCluster', () => { - it('invokes getGameServerCluster without error', done => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerClusterRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getGameServerCluster = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getGameServerCluster(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getGameServerCluster with error', done => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerClusterRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getGameServerCluster = mockSimpleGrpcMethod( - request, - null, - error - ); - client.getGameServerCluster(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('previewCreateGameServerCluster', () => { - it('invokes previewCreateGameServerCluster without error', done => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.previewCreateGameServerCluster = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.previewCreateGameServerCluster( - request, - (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - } - ); - }); - - it('invokes previewCreateGameServerCluster with error', done => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.previewCreateGameServerCluster = mockSimpleGrpcMethod( - request, - null, - error - ); - client.previewCreateGameServerCluster( - request, - (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - } - ); - }); - }); - describe('previewDeleteGameServerCluster', () => { - it('invokes previewDeleteGameServerCluster without error', done => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.previewDeleteGameServerCluster = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.previewDeleteGameServerCluster( - request, - (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - } - ); - }); - - it('invokes previewDeleteGameServerCluster with error', done => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.previewDeleteGameServerCluster = mockSimpleGrpcMethod( - request, - null, - error - ); - client.previewDeleteGameServerCluster( - request, - (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - } - ); - }); - }); - describe('previewUpdateGameServerCluster', () => { - it('invokes previewUpdateGameServerCluster without error', done => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest = {}; - request.gameServerCluster = {}; - request.gameServerCluster.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.previewUpdateGameServerCluster = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.previewUpdateGameServerCluster( - request, - (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - } - ); - }); - - it('invokes previewUpdateGameServerCluster with error', done => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest = {}; - request.gameServerCluster = {}; - request.gameServerCluster.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.previewUpdateGameServerCluster = mockSimpleGrpcMethod( - request, - null, - error - ); - client.previewUpdateGameServerCluster( - request, - (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - } - ); - }); - }); - describe('createGameServerCluster', () => { - it('invokes createGameServerCluster without error', done => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createGameServerCluster = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .createGameServerCluster(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes createGameServerCluster with error', done => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createGameServerCluster = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .createGameServerCluster(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - describe('deleteGameServerCluster', () => { - it('invokes deleteGameServerCluster without error', done => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.deleteGameServerCluster = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .deleteGameServerCluster(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes deleteGameServerCluster with error', done => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.deleteGameServerCluster = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .deleteGameServerCluster(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - describe('updateGameServerCluster', () => { - it('invokes updateGameServerCluster without error', done => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest = {}; - request.gameServerCluster = {}; - request.gameServerCluster.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateGameServerCluster = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .updateGameServerCluster(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes updateGameServerCluster with error', done => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest = {}; - request.gameServerCluster = {}; - request.gameServerCluster.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateGameServerCluster = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .updateGameServerCluster(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); -}); 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 deleted file mode 100644 index b92cf957db6..00000000000 --- a/packages/google-cloud-gaming/test/gapic-game_server_configs_service-v1beta.ts +++ /dev/null @@ -1,386 +0,0 @@ -// 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. ** - -import * as protosTypes from '../protos/protos'; -import * as assert from 'assert'; -import {describe, it} from 'mocha'; -const gameserverconfigsserviceModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -class FakeError { - name: string; - message: string; - code: number; - constructor(n: number) { - this.name = 'fakeName'; - this.message = 'fake message'; - this.code = n; - } -} -const error = new FakeError(FAKE_STATUS_CODE); -export interface Callback { - (err: FakeError | null, response?: {} | null): void; -} - -export class Operation { - constructor() {} - promise() {} -} -function mockSimpleGrpcMethod( - expectedRequest: {}, - response: {} | null, - error: FakeError | null -) { - return (actualRequest: {}, options: {}, callback: Callback) => { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} -function mockLongRunningGrpcMethod( - expectedRequest: {}, - response: {} | null, - error?: {} | null -) { - return (request: {}) => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } - }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} -describe('v1beta.GameServerConfigsServiceClient', () => { - 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', () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.close(); - }); - describe('listGameServerConfigs', () => { - it('invokes listGameServerConfigs without error', done => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.listGameServerConfigs = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.listGameServerConfigs(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes listGameServerConfigs with error', done => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IListGameServerConfigsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.listGameServerConfigs = mockSimpleGrpcMethod( - request, - null, - error - ); - client.listGameServerConfigs(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('getGameServerConfig', () => { - it('invokes getGameServerConfig without error', done => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerConfigRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getGameServerConfig = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getGameServerConfig(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getGameServerConfig with error', done => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerConfigRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getGameServerConfig = mockSimpleGrpcMethod( - request, - null, - error - ); - client.getGameServerConfig(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('createGameServerConfig', () => { - it('invokes createGameServerConfig without error', done => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createGameServerConfig = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .createGameServerConfig(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes createGameServerConfig with error', done => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createGameServerConfig = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .createGameServerConfig(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - describe('deleteGameServerConfig', () => { - it('invokes deleteGameServerConfig without error', done => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.deleteGameServerConfig = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .deleteGameServerConfig(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes deleteGameServerConfig with error', done => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.deleteGameServerConfig = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .deleteGameServerConfig(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); -}); 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 deleted file mode 100644 index ee2f9a0dbc2..00000000000 --- a/packages/google-cloud-gaming/test/gapic-game_server_deployments_service-v1beta.ts +++ /dev/null @@ -1,721 +0,0 @@ -// 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. ** - -import * as protosTypes from '../protos/protos'; -import * as assert from 'assert'; -import {describe, it} from 'mocha'; -const gameserverdeploymentsserviceModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -class FakeError { - name: string; - message: string; - code: number; - constructor(n: number) { - this.name = 'fakeName'; - this.message = 'fake message'; - this.code = n; - } -} -const error = new FakeError(FAKE_STATUS_CODE); -export interface Callback { - (err: FakeError | null, response?: {} | null): void; -} - -export class Operation { - constructor() {} - promise() {} -} -function mockSimpleGrpcMethod( - expectedRequest: {}, - response: {} | null, - error: FakeError | null -) { - return (actualRequest: {}, options: {}, callback: Callback) => { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} -function mockLongRunningGrpcMethod( - expectedRequest: {}, - response: {} | null, - error?: {} | null -) { - return (request: {}) => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } - }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} -describe('v1beta.GameServerDeploymentsServiceClient', () => { - 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', () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - client.close(); - }); - describe('listGameServerDeployments', () => { - it('invokes listGameServerDeployments without error', done => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.listGameServerDeployments = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.listGameServerDeployments(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes listGameServerDeployments with error', done => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.listGameServerDeployments = mockSimpleGrpcMethod( - request, - null, - error - ); - client.listGameServerDeployments( - request, - (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - } - ); - }); - }); - describe('getGameServerDeployment', () => { - it('invokes getGameServerDeployment without error', done => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getGameServerDeployment = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getGameServerDeployment(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getGameServerDeployment with error', done => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getGameServerDeployment = mockSimpleGrpcMethod( - request, - null, - error - ); - client.getGameServerDeployment( - request, - (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - } - ); - }); - }); - describe('getGameServerDeploymentRollout', () => { - it('invokes getGameServerDeploymentRollout without error', done => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getGameServerDeploymentRollout = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getGameServerDeploymentRollout( - request, - (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - } - ); - }); - - it('invokes getGameServerDeploymentRollout with error', done => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getGameServerDeploymentRollout = mockSimpleGrpcMethod( - request, - null, - error - ); - client.getGameServerDeploymentRollout( - request, - (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - } - ); - }); - }); - describe('previewGameServerDeploymentRollout', () => { - it('invokes previewGameServerDeploymentRollout without error', done => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest = {}; - request.rollout = {}; - request.rollout.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.previewGameServerDeploymentRollout = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.previewGameServerDeploymentRollout( - request, - (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - } - ); - }); - - it('invokes previewGameServerDeploymentRollout with error', done => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest = {}; - request.rollout = {}; - request.rollout.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.previewGameServerDeploymentRollout = mockSimpleGrpcMethod( - request, - null, - error - ); - client.previewGameServerDeploymentRollout( - request, - (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - } - ); - }); - }); - describe('fetchDeploymentState', () => { - it('invokes fetchDeploymentState without error', done => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.fetchDeploymentState = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.fetchDeploymentState(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes fetchDeploymentState with error', done => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.fetchDeploymentState = mockSimpleGrpcMethod( - request, - null, - error - ); - client.fetchDeploymentState(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('createGameServerDeployment', () => { - it('invokes createGameServerDeployment without error', done => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createGameServerDeployment = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .createGameServerDeployment(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes createGameServerDeployment with error', done => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createGameServerDeployment = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .createGameServerDeployment(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - describe('deleteGameServerDeployment', () => { - it('invokes deleteGameServerDeployment without error', done => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.deleteGameServerDeployment = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .deleteGameServerDeployment(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes deleteGameServerDeployment with error', done => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.deleteGameServerDeployment = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .deleteGameServerDeployment(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - describe('updateGameServerDeployment', () => { - it('invokes updateGameServerDeployment without error', done => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest = {}; - request.gameServerDeployment = {}; - request.gameServerDeployment.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateGameServerDeployment = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .updateGameServerDeployment(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes updateGameServerDeployment with error', done => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest = {}; - request.gameServerDeployment = {}; - request.gameServerDeployment.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateGameServerDeployment = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .updateGameServerDeployment(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - describe('updateGameServerDeploymentRollout', () => { - it('invokes updateGameServerDeploymentRollout without error', done => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest = {}; - request.rollout = {}; - request.rollout.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateGameServerDeploymentRollout = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .updateGameServerDeploymentRollout(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes updateGameServerDeploymentRollout with error', done => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest = {}; - request.rollout = {}; - request.rollout.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateGameServerDeploymentRollout = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .updateGameServerDeploymentRollout(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); -}); diff --git a/packages/google-cloud-gaming/test/gapic-realms_service-v1beta.ts b/packages/google-cloud-gaming/test/gapic-realms_service-v1beta.ts deleted file mode 100644 index c81fa967ae5..00000000000 --- a/packages/google-cloud-gaming/test/gapic-realms_service-v1beta.ts +++ /dev/null @@ -1,484 +0,0 @@ -// 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. ** - -import * as protosTypes from '../protos/protos'; -import * as assert from 'assert'; -import {describe, it} from 'mocha'; -const realmsserviceModule = require('../src'); - -const FAKE_STATUS_CODE = 1; -class FakeError { - name: string; - message: string; - code: number; - constructor(n: number) { - this.name = 'fakeName'; - this.message = 'fake message'; - this.code = n; - } -} -const error = new FakeError(FAKE_STATUS_CODE); -export interface Callback { - (err: FakeError | null, response?: {} | null): void; -} - -export class Operation { - constructor() {} - promise() {} -} -function mockSimpleGrpcMethod( - expectedRequest: {}, - response: {} | null, - error: FakeError | null -) { - return (actualRequest: {}, options: {}, callback: Callback) => { - assert.deepStrictEqual(actualRequest, expectedRequest); - if (error) { - callback(error); - } else if (response) { - callback(null, response); - } else { - callback(null); - } - }; -} -function mockLongRunningGrpcMethod( - expectedRequest: {}, - response: {} | null, - error?: {} | null -) { - return (request: {}) => { - assert.deepStrictEqual(request, expectedRequest); - const mockOperation = { - promise() { - return new Promise((resolve, reject) => { - if (error) { - reject(error); - } else { - resolve([response]); - } - }); - }, - }; - return Promise.resolve([mockOperation]); - }; -} -describe('v1beta.RealmsServiceClient', () => { - 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', () => { - const client = new realmsserviceModule.v1beta.RealmsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.close(); - }); - describe('listRealms', () => { - it('invokes listRealms without error', done => { - const client = new realmsserviceModule.v1beta.RealmsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IListRealmsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.listRealms = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.listRealms(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes listRealms with error', done => { - const client = new realmsserviceModule.v1beta.RealmsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IListRealmsRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.listRealms = mockSimpleGrpcMethod( - request, - null, - error - ); - client.listRealms(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('getRealm', () => { - it('invokes getRealm without error', done => { - const client = new realmsserviceModule.v1beta.RealmsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IGetRealmRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getRealm = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.getRealm(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes getRealm with error', done => { - const client = new realmsserviceModule.v1beta.RealmsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IGetRealmRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.getRealm = mockSimpleGrpcMethod( - request, - null, - error - ); - client.getRealm(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('previewRealmUpdate', () => { - it('invokes previewRealmUpdate without error', done => { - const client = new realmsserviceModule.v1beta.RealmsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest = {}; - request.realm = {}; - request.realm.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.previewRealmUpdate = mockSimpleGrpcMethod( - request, - expectedResponse, - null - ); - client.previewRealmUpdate(request, (err: {}, response: {}) => { - assert.ifError(err); - assert.deepStrictEqual(response, expectedResponse); - done(); - }); - }); - - it('invokes previewRealmUpdate with error', done => { - const client = new realmsserviceModule.v1beta.RealmsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest = {}; - request.realm = {}; - request.realm.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.previewRealmUpdate = mockSimpleGrpcMethod( - request, - null, - error - ); - client.previewRealmUpdate(request, (err: FakeError, response: {}) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - assert(typeof response === 'undefined'); - done(); - }); - }); - }); - describe('createRealm', () => { - it('invokes createRealm without error', done => { - const client = new realmsserviceModule.v1beta.RealmsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.ICreateRealmRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createRealm = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .createRealm(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes createRealm with error', done => { - const client = new realmsserviceModule.v1beta.RealmsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.ICreateRealmRequest = {}; - request.parent = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.createRealm = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .createRealm(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - describe('deleteRealm', () => { - it('invokes deleteRealm without error', done => { - const client = new realmsserviceModule.v1beta.RealmsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IDeleteRealmRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.deleteRealm = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .deleteRealm(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes deleteRealm with error', done => { - const client = new realmsserviceModule.v1beta.RealmsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IDeleteRealmRequest = {}; - request.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.deleteRealm = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .deleteRealm(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); - describe('updateRealm', () => { - it('invokes updateRealm without error', done => { - const client = new realmsserviceModule.v1beta.RealmsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IUpdateRealmRequest = {}; - request.realm = {}; - request.realm.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateRealm = mockLongRunningGrpcMethod( - request, - expectedResponse - ); - client - .updateRealm(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then((responses: [Operation]) => { - assert.deepStrictEqual(responses[0], expectedResponse); - done(); - }) - .catch((err: {}) => { - done(err); - }); - }); - - it('invokes updateRealm with error', done => { - const client = new realmsserviceModule.v1beta.RealmsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - // Initialize client before mocking - client.initialize(); - // Mock request - const request: protosTypes.google.cloud.gaming.v1beta.IUpdateRealmRequest = {}; - request.realm = {}; - request.realm.name = ''; - // Mock response - const expectedResponse = {}; - // Mock gRPC layer - client._innerApiCalls.updateRealm = mockLongRunningGrpcMethod( - request, - null, - error - ); - client - .updateRealm(request) - .then((responses: [Operation]) => { - const operation = responses[0]; - return operation ? operation.promise() : {}; - }) - .then(() => { - assert.fail(); - }) - .catch((err: FakeError) => { - assert(err instanceof FakeError); - assert.strictEqual(err.code, FAKE_STATUS_CODE); - done(); - }); - }); - }); -}); 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..da29ed97ba7 --- /dev/null +++ b/packages/google-cloud-gaming/test/gapic_game_server_clusters_service_v1beta.ts @@ -0,0 +1,1681 @@ +// 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. ** + +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 {protobuf, LROperation} from 'google-gax'; + +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); +} + +describe('v1beta.GameServerClustersServiceClient', () => { + 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', () => { + const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); + + 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('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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerClustersResponse() + ); + client.innerApiCalls.listGameServerClusters = stubSimpleCall( + expectedResponse + ); + const [response] = await client.listGameServerClusters(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listGameServerClusters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerClustersResponse() + ); + client.innerApiCalls.listGameServerClusters = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listGameServerClusters( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1beta.IListGameServerClustersResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listGameServerClusters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listGameServerClusters = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.listGameServerClusters(request); + }, expectedError); + assert( + (client.innerApiCalls.listGameServerClusters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.getGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.getGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getGameServerCluster = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.getGameServerCluster(request); + }, expectedError); + assert( + (client.innerApiCalls.getGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.previewCreateGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.previewCreateGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.previewCreateGameServerCluster = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.previewCreateGameServerCluster(request); + }, expectedError); + assert( + (client.innerApiCalls.previewCreateGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.previewDeleteGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.previewDeleteGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.previewDeleteGameServerCluster = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.previewDeleteGameServerCluster(request); + }, expectedError); + assert( + (client.innerApiCalls.previewDeleteGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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 = {}; + request.gameServerCluster.name = ''; + const expectedHeaderRequestParams = 'game_server_cluster.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.previewUpdateGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.gameServerCluster.name = ''; + const expectedHeaderRequestParams = 'game_server_cluster.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.previewUpdateGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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 = {}; + request.gameServerCluster.name = ''; + const expectedHeaderRequestParams = 'game_server_cluster.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.previewUpdateGameServerCluster = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.previewUpdateGameServerCluster(request); + }, expectedError); + assert( + (client.innerApiCalls.previewUpdateGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.createGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.createGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerCluster = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.createGameServerCluster(request); + }, expectedError); + assert( + (client.innerApiCalls.createGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerCluster = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createGameServerCluster(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.createGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.deleteGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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.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); + assert( + (client.innerApiCalls.deleteGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerCluster = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.deleteGameServerCluster(request); + }, expectedError); + assert( + (client.innerApiCalls.deleteGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerCluster = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteGameServerCluster(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.deleteGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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 = {}; + request.gameServerCluster.name = ''; + const expectedHeaderRequestParams = 'game_server_cluster.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.updateGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.gameServerCluster.name = ''; + const expectedHeaderRequestParams = 'game_server_cluster.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.updateGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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 = {}; + request.gameServerCluster.name = ''; + const expectedHeaderRequestParams = 'game_server_cluster.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerCluster = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.updateGameServerCluster(request); + }, expectedError); + assert( + (client.innerApiCalls.updateGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.gameServerCluster.name = ''; + const expectedHeaderRequestParams = 'game_server_cluster.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerCluster = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateGameServerCluster(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.updateGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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_v1beta.ts b/packages/google-cloud-gaming/test/gapic_game_server_configs_service_v1beta.ts new file mode 100644 index 00000000000..06715d80ed5 --- /dev/null +++ b/packages/google-cloud-gaming/test/gapic_game_server_configs_service_v1beta.ts @@ -0,0 +1,1140 @@ +// 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. ** + +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 {protobuf, LROperation} from 'google-gax'; + +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); +} + +describe('v1beta.GameServerConfigsServiceClient', () => { + 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', () => { + const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); + + 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('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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerConfigsResponse() + ); + client.innerApiCalls.listGameServerConfigs = stubSimpleCall( + expectedResponse + ); + const [response] = await client.listGameServerConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listGameServerConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerConfigsResponse() + ); + client.innerApiCalls.listGameServerConfigs = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listGameServerConfigs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1beta.IListGameServerConfigsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listGameServerConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listGameServerConfigs = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.listGameServerConfigs(request); + }, expectedError); + assert( + (client.innerApiCalls.listGameServerConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.getGameServerConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.getGameServerConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getGameServerConfig = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.getGameServerConfig(request); + }, expectedError); + assert( + (client.innerApiCalls.getGameServerConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.createGameServerConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.createGameServerConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerConfig = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.createGameServerConfig(request); + }, expectedError); + assert( + (client.innerApiCalls.createGameServerConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerConfig = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createGameServerConfig(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.createGameServerConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.deleteGameServerConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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.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); + assert( + (client.innerApiCalls.deleteGameServerConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerConfig = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.deleteGameServerConfig(request); + }, expectedError); + assert( + (client.innerApiCalls.deleteGameServerConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerConfig = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteGameServerConfig(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.deleteGameServerConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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_v1beta.ts b/packages/google-cloud-gaming/test/gapic_game_server_deployments_service_v1beta.ts new file mode 100644 index 00000000000..c7ab8829a18 --- /dev/null +++ b/packages/google-cloud-gaming/test/gapic_game_server_deployments_service_v1beta.ts @@ -0,0 +1,1858 @@ +// 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. ** + +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 {protobuf, LROperation} from 'google-gax'; + +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); +} + +describe('v1beta.GameServerDeploymentsServiceClient', () => { + 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', () => { + const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); + + 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('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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse() + ); + client.innerApiCalls.listGameServerDeployments = stubSimpleCall( + expectedResponse + ); + const [response] = await client.listGameServerDeployments(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listGameServerDeployments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse() + ); + client.innerApiCalls.listGameServerDeployments = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listGameServerDeployments( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listGameServerDeployments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listGameServerDeployments = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.listGameServerDeployments(request); + }, expectedError); + assert( + (client.innerApiCalls.listGameServerDeployments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.getGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.getGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getGameServerDeployment = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.getGameServerDeployment(request); + }, expectedError); + assert( + (client.innerApiCalls.getGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.getGameServerDeploymentRollout as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.getGameServerDeploymentRollout as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getGameServerDeploymentRollout = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.getGameServerDeploymentRollout(request); + }, expectedError); + assert( + (client.innerApiCalls.getGameServerDeploymentRollout as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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 = {}; + request.rollout.name = ''; + const expectedHeaderRequestParams = 'rollout.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.rollout.name = ''; + const expectedHeaderRequestParams = 'rollout.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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 = {}; + request.rollout.name = ''; + const expectedHeaderRequestParams = 'rollout.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.previewGameServerDeploymentRollout = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.previewGameServerDeploymentRollout(request); + }, expectedError); + assert( + (client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.fetchDeploymentState as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.fetchDeploymentState as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchDeploymentState = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.fetchDeploymentState(request); + }, expectedError); + assert( + (client.innerApiCalls.fetchDeploymentState as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.createGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.createGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerDeployment = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.createGameServerDeployment(request); + }, expectedError); + assert( + (client.innerApiCalls.createGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerDeployment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createGameServerDeployment(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.createGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.deleteGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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.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); + assert( + (client.innerApiCalls.deleteGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerDeployment = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.deleteGameServerDeployment(request); + }, expectedError); + assert( + (client.innerApiCalls.deleteGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerDeployment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteGameServerDeployment(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.deleteGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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 = {}; + request.gameServerDeployment.name = ''; + const expectedHeaderRequestParams = 'game_server_deployment.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.updateGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.gameServerDeployment.name = ''; + const expectedHeaderRequestParams = 'game_server_deployment.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.updateGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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 = {}; + request.gameServerDeployment.name = ''; + const expectedHeaderRequestParams = 'game_server_deployment.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerDeployment = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.updateGameServerDeployment(request); + }, expectedError); + assert( + (client.innerApiCalls.updateGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.gameServerDeployment.name = ''; + const expectedHeaderRequestParams = 'game_server_deployment.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerDeployment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateGameServerDeployment(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.updateGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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 = {}; + request.rollout.name = ''; + const expectedHeaderRequestParams = 'rollout.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.rollout.name = ''; + const expectedHeaderRequestParams = 'rollout.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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 = {}; + request.rollout.name = ''; + const expectedHeaderRequestParams = 'rollout.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerDeploymentRollout = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.updateGameServerDeploymentRollout(request); + }, expectedError); + assert( + (client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.rollout.name = ''; + const expectedHeaderRequestParams = 'rollout.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerDeploymentRollout = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateGameServerDeploymentRollout( + request + ); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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_v1beta.ts b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts new file mode 100644 index 00000000000..55f17538b32 --- /dev/null +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts @@ -0,0 +1,1358 @@ +// 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. ** + +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 {protobuf, LROperation} from 'google-gax'; + +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); +} + +describe('v1beta.RealmsServiceClient', () => { + 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', () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + 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('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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListRealmsResponse() + ); + client.innerApiCalls.listRealms = stubSimpleCall(expectedResponse); + const [response] = await client.listRealms(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listRealms as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.gaming.v1beta.ListRealmsResponse() + ); + client.innerApiCalls.listRealms = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listRealms( + request, + ( + err?: Error | null, + result?: protos.google.cloud.gaming.v1beta.IListRealmsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listRealms as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listRealms = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.listRealms(request); + }, expectedError); + assert( + (client.innerApiCalls.listRealms as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.getRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.getRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getRealm = stubSimpleCall(undefined, expectedError); + assert.rejects(async () => { + await client.getRealm(request); + }, expectedError); + assert( + (client.innerApiCalls.getRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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 = {}; + request.realm.name = ''; + const expectedHeaderRequestParams = 'realm.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.previewRealmUpdate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.realm.name = ''; + const expectedHeaderRequestParams = 'realm.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.previewRealmUpdate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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 = {}; + request.realm.name = ''; + const expectedHeaderRequestParams = 'realm.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.previewRealmUpdate = stubSimpleCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.previewRealmUpdate(request); + }, expectedError); + assert( + (client.innerApiCalls.previewRealmUpdate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.createRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.createRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createRealm = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.createRealm(request); + }, expectedError); + assert( + (client.innerApiCalls.createRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createRealm = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createRealm(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.createRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.deleteRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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.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); + assert( + (client.innerApiCalls.deleteRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRealm = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.deleteRealm(request); + }, expectedError); + assert( + (client.innerApiCalls.deleteRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRealm = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteRealm(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.deleteRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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 = {}; + request.realm.name = ''; + const expectedHeaderRequestParams = 'realm.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.updateRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.realm.name = ''; + const expectedHeaderRequestParams = 'realm.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.updateRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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 = {}; + request.realm.name = ''; + const expectedHeaderRequestParams = 'realm.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRealm = stubLongRunningCall( + undefined, + expectedError + ); + assert.rejects(async () => { + await client.updateRealm(request); + }, expectedError); + assert( + (client.innerApiCalls.updateRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.realm.name = ''; + const expectedHeaderRequestParams = 'realm.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRealm = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateRealm(request); + assert.rejects(async () => { + await operation.promise(); + }, expectedError); + assert( + (client.innerApiCalls.updateRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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/webpack.config.js b/packages/google-cloud-gaming/webpack.config.js index 38b76f94355..285a58ef135 100644 --- a/packages/google-cloud-gaming/webpack.config.js +++ b/packages/google-cloud-gaming/webpack.config.js @@ -36,27 +36,27 @@ module.exports = { { test: /\.tsx?$/, use: 'ts-loader', - exclude: /node_modules/ + exclude: /node_modules/, }, { test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]grpc/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]retry-request/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]gtoken/, - use: 'null-loader' + use: 'null-loader', }, ], }, From 7f4c485dc0821dd815e7953735892a3349b60858 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 31 Mar 2020 18:36:14 -0700 Subject: [PATCH 018/180] build: set AUTOSYNTH_MULTIPLE_COMMITS=true for context aware commits (#39) --- packages/google-cloud-gaming/synth.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/google-cloud-gaming/synth.py b/packages/google-cloud-gaming/synth.py index 50f327b5bd9..df8f9a9f7e5 100644 --- a/packages/google-cloud-gaming/synth.py +++ b/packages/google-cloud-gaming/synth.py @@ -17,6 +17,9 @@ import subprocess import logging logging.basicConfig(level=logging.DEBUG) + +AUTOSYNTH_MULTIPLE_COMMITS = True + # run the gapic generator gapic = gcp.GAPICMicrogenerator() versions = ['v1beta1'] From d28cfab6e575aedb5056c46346ace7c9c0e00303 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 1 Apr 2020 23:35:40 +0200 Subject: [PATCH 019/180] chore(deps): update dependency @types/sinon to v9 (#40) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@types/sinon](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | devDependencies | major | [`^7.5.2` -> `^9.0.0`](https://renovatebot.com/diffs/npm/@types%2fsinon/7.5.2/9.0.0) | --- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index f4b362cd61c..f61e00618d4 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -31,7 +31,7 @@ "devDependencies": { "@types/mocha": "^7.0.0", "@types/node": "^12.0.0", - "@types/sinon": "^7.5.2", + "@types/sinon": "^9.0.0", "c8": "^7.0.0", "eslint": "^6.8.0", "eslint-config-prettier": "^6.10.0", From edb17132c4e7fef3fea3fba2f71bbbd6046e2615 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 2 Apr 2020 15:14:13 -0700 Subject: [PATCH 020/180] refactor: changes child_type to type field (#42) --- .../google/cloud/gaming/v1beta/common.proto | 3 ++- .../gaming/v1beta/game_server_clusters.proto | 22 +++++-------------- .../v1beta/game_server_clusters_service.proto | 4 ++-- .../gaming/v1beta/game_server_configs.proto | 8 +++---- .../v1beta/game_server_configs_service.proto | 4 ++-- .../v1beta/game_server_deployments.proto | 8 +++---- .../game_server_deployments_service.proto | 9 ++------ .../google/cloud/gaming/v1beta/realms.proto | 8 +++---- .../cloud/gaming/v1beta/realms_service.proto | 4 ++-- .../google-cloud-gaming/protos/protos.json | 22 +++++++++---------- .../game_server_deployments_service_client.ts | 5 ----- packages/google-cloud-gaming/synth.metadata | 19 +++++++++++++++- 12 files changed, 56 insertions(+), 60 deletions(-) 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 index 027272cf309..1db6b77cfa4 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; 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 index fd67a112b2c..62ce7ef9cba 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -24,7 +25,6 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListGameServerClustersRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/GameServerCluster" + type: "gameservices.googleapis.com/GameServerCluster" } ]; @@ -90,7 +90,7 @@ message CreateGameServerClusterRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/GameServerCluster" + type: "gameservices.googleapis.com/GameServerCluster" } ]; @@ -105,12 +105,7 @@ message CreateGameServerClusterRequest { 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" - } - ]; + string parent = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The ID of the Game Server Cluster resource to be created. string game_server_cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; @@ -148,12 +143,7 @@ message DeleteGameServerClusterRequest { 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" - } - ]; + string name = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. The target timestamp to compute the preview. google.protobuf.Timestamp preview_time = 2 [(google.api.field_behavior) = OPTIONAL]; 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 index 2d81c438273..462e42dde47 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -22,7 +23,6 @@ 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"; 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 index ea0820bd79d..ac57c5c3a19 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -23,7 +24,6 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListGameServerConfigsRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/GameServerConfig" + type: "gameservices.googleapis.com/GameServerConfig" } ]; @@ -91,7 +91,7 @@ message CreateGameServerConfigRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/GameServerConfig" + type: "gameservices.googleapis.com/GameServerConfig" } ]; 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 index 29e886c50df..89dd582307a 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -22,7 +23,6 @@ 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"; 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 index 2e87e386c85..d0682520900 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -24,7 +25,6 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListGameServerDeploymentsRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/GameServerDeployment" + type: "gameservices.googleapis.com/GameServerDeployment" } ]; @@ -105,7 +105,7 @@ message CreateGameServerDeploymentRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/GameServerDeployment" + type: "gameservices.googleapis.com/GameServerDeployment" } ]; 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 index ccacfbacd5a..ccb0c5055f4 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -22,7 +23,6 @@ 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"; @@ -95,11 +95,6 @@ service GameServerDeploymentsService { } // 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" 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 index c1fa9982f2f..38281aa6789 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -24,7 +25,6 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListRealmsRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/Realm" + type: "gameservices.googleapis.com/Realm" } ]; @@ -90,7 +90,7 @@ message CreateRealmRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/Realm" + type: "gameservices.googleapis.com/Realm" } ]; 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 index 4c87cac3d36..b7dfaa07cc3 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -22,7 +23,6 @@ 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"; diff --git a/packages/google-cloud-gaming/protos/protos.json b/packages/google-cloud-gaming/protos/protos.json index 7d73f19966c..5a0173d1665 100644 --- a/packages/google-cloud-gaming/protos/protos.json +++ b/packages/google-cloud-gaming/protos/protos.json @@ -306,7 +306,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" } }, "pageSize": { @@ -376,7 +376,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" } }, "gameServerClusterId": { @@ -401,8 +401,7 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" + "(google.api.field_behavior)": "REQUIRED" } }, "gameServerClusterId": { @@ -458,8 +457,7 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" + "(google.api.field_behavior)": "REQUIRED" } }, "previewTime": { @@ -697,7 +695,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerConfig" + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerConfig" } }, "pageSize": { @@ -767,7 +765,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerConfig" + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerConfig" } }, "configId": { @@ -935,7 +933,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerDeployment" + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerDeployment" } }, "pageSize": { @@ -1017,7 +1015,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerDeployment" + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerDeployment" } }, "deploymentId": { @@ -1366,7 +1364,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/Realm" + "(google.api.resource_reference).type": "gameservices.googleapis.com/Realm" } }, "pageSize": { @@ -1436,7 +1434,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/Realm" + "(google.api.resource_reference).type": "gameservices.googleapis.com/Realm" } }, "realmId": { 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 index 718b0d64672..8f0e5e35073 100644 --- 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 @@ -1207,11 +1207,6 @@ export class GameServerDeploymentsServiceClient { ): void; /** * 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. diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 1ae61381671..1cfc1eaa866 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -1,5 +1,22 @@ { - "updateTime": "2020-03-31T19:38:20.766291Z", + "updateTime": "2020-04-02T11:28:17.377420Z", + "sources": [ + { + "git": { + "name": "googleapis-private", + "remote": "https://github.com/googleapis/googleapis-private.git", + "sha": "e6378caa596533251006a9eb318f3f9e71984f2b", + "internalRef": "301441701" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "99820243d348191bc9c634f2b48ddf65096285ed" + } + } + ], "destinations": [ { "client": { From ab659a023f52fcb964abbc3d96cab7793ed4634c Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sun, 5 Apr 2020 12:46:48 -0700 Subject: [PATCH 021/180] chore: remove duplicate mocha config (#44) --- packages/google-cloud-gaming/.mocharc.json | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 packages/google-cloud-gaming/.mocharc.json diff --git a/packages/google-cloud-gaming/.mocharc.json b/packages/google-cloud-gaming/.mocharc.json deleted file mode 100644 index 670c5e2c24b..00000000000 --- a/packages/google-cloud-gaming/.mocharc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} From 4f3407962da5b1c7a396e376d9714166d40b057e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 7 Apr 2020 00:12:14 -0700 Subject: [PATCH 022/180] fix: export explicit version from protos.js (#43) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/1630485f-7526-4afd-9c13-b5660664d6a2/targets --- packages/google-cloud-gaming/protos/protos.js | 2 +- packages/google-cloud-gaming/synth.metadata | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/protos/protos.js b/packages/google-cloud-gaming/protos/protos.js index 3f1f832821c..f96a63fd101 100644 --- a/packages/google-cloud-gaming/protos/protos.js +++ b/packages/google-cloud-gaming/protos/protos.js @@ -28,7 +28,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); + var $root = $protobuf.roots._google_cloud_game_servers_1_1_0_protos || ($protobuf.roots._google_cloud_game_servers_1_1_0_protos = {}); $root.google = (function() { diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 1cfc1eaa866..e158cffda74 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2020-04-02T11:28:17.377420Z", + "updateTime": "2020-04-03T11:41:38.050756Z", "sources": [ { "git": { From 73580b566a9705aa3c172783edd5590f41d3bc9c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 8 Apr 2020 14:53:01 -0700 Subject: [PATCH 023/180] test: await assert.reject (#45) --- packages/google-cloud-gaming/.jsdoc.js | 2 +- packages/google-cloud-gaming/.mocharc.json | 5 ++++ packages/google-cloud-gaming/.prettierrc.js | 2 +- packages/google-cloud-gaming/synth.metadata | 10 ++++--- ...pic_game_server_clusters_service_v1beta.ts | 22 ++++++++-------- ...apic_game_server_configs_service_v1beta.ts | 12 ++++----- ..._game_server_deployments_service_v1beta.ts | 26 +++++++++---------- .../test/gapic_realms_service_v1beta.ts | 18 ++++++------- 8 files changed, 52 insertions(+), 45 deletions(-) create mode 100644 packages/google-cloud-gaming/.mocharc.json diff --git a/packages/google-cloud-gaming/.jsdoc.js b/packages/google-cloud-gaming/.jsdoc.js index 88fca114a13..3054ecec4a7 100644 --- a/packages/google-cloud-gaming/.jsdoc.js +++ b/packages/google-cloud-gaming/.jsdoc.js @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2019 Google, LLC.', + copyright: 'Copyright 2020 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/game-servers', 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/.prettierrc.js b/packages/google-cloud-gaming/.prettierrc.js index 08cba3775be..d1b95106f4c 100644 --- a/packages/google-cloud-gaming/.prettierrc.js +++ b/packages/google-cloud-gaming/.prettierrc.js @@ -4,7 +4,7 @@ // 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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index e158cffda74..5de34d710ea 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -1,19 +1,21 @@ { - "updateTime": "2020-04-03T11:41:38.050756Z", + "updateTime": "2020-04-07T12:40:41.496571Z", "sources": [ { "git": { "name": "googleapis-private", "remote": "https://github.com/googleapis/googleapis-private.git", - "sha": "e6378caa596533251006a9eb318f3f9e71984f2b", - "internalRef": "301441701" + "sha": "ddac0ff9513bd89b53aa6895c65a7c3272626583", + "internalRef": "304945322", + "log": "ddac0ff9513bd89b53aa6895c65a7c3272626583\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 304945322\n\n" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "99820243d348191bc9c634f2b48ddf65096285ed" + "sha": "1df68ed6735ddce6797d0f83641a731c3c3f75b4", + "log": "1df68ed6735ddce6797d0f83641a731c3c3f75b4\nfix: apache license URL (#468)\n\n\nf4a59efa54808c4b958263de87bc666ce41e415f\nfeat: Add discogapic support for GAPICBazel generation (#459)\n\n* feat: Add discogapic support for GAPICBazel generation\n\n* reformat with black\n\n* Rename source repository variable\n\nCo-authored-by: Jeffrey Rennie \n" } } ], 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 index da29ed97ba7..94680700b05 100644 --- 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 @@ -290,7 +290,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listGameServerClusters(request); }, expectedError); assert( @@ -412,7 +412,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getGameServerCluster(request); }, expectedError); assert( @@ -534,7 +534,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.previewCreateGameServerCluster(request); }, expectedError); assert( @@ -656,7 +656,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.previewDeleteGameServerCluster(request); }, expectedError); assert( @@ -781,7 +781,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.previewUpdateGameServerCluster(request); }, expectedError); assert( @@ -911,7 +911,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createGameServerCluster(request); }, expectedError); assert( @@ -948,7 +948,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { expectedError ); const [operation] = await client.createGameServerCluster(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -1078,7 +1078,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.deleteGameServerCluster(request); }, expectedError); assert( @@ -1115,7 +1115,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { expectedError ); const [operation] = await client.deleteGameServerCluster(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -1248,7 +1248,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateGameServerCluster(request); }, expectedError); assert( @@ -1286,7 +1286,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { expectedError ); const [operation] = await client.updateGameServerCluster(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( 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 index 06715d80ed5..11b4f7ab0bc 100644 --- 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 @@ -289,7 +289,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listGameServerConfigs(request); }, expectedError); assert( @@ -411,7 +411,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getGameServerConfig(request); }, expectedError); assert( @@ -541,7 +541,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createGameServerConfig(request); }, expectedError); assert( @@ -578,7 +578,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { expectedError ); const [operation] = await client.createGameServerConfig(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -708,7 +708,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.deleteGameServerConfig(request); }, expectedError); assert( @@ -745,7 +745,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { expectedError ); const [operation] = await client.deleteGameServerConfig(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( 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 index c7ab8829a18..37ddc46fae8 100644 --- 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 @@ -290,7 +290,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listGameServerDeployments(request); }, expectedError); assert( @@ -412,7 +412,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getGameServerDeployment(request); }, expectedError); assert( @@ -534,7 +534,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getGameServerDeploymentRollout(request); }, expectedError); assert( @@ -661,7 +661,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.previewGameServerDeploymentRollout(request); }, expectedError); assert( @@ -783,7 +783,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.fetchDeploymentState(request); }, expectedError); assert( @@ -913,7 +913,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createGameServerDeployment(request); }, expectedError); assert( @@ -950,7 +950,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { expectedError ); const [operation] = await client.createGameServerDeployment(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -1080,7 +1080,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.deleteGameServerDeployment(request); }, expectedError); assert( @@ -1117,7 +1117,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { expectedError ); const [operation] = await client.deleteGameServerDeployment(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -1250,7 +1250,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateGameServerDeployment(request); }, expectedError); assert( @@ -1288,7 +1288,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { expectedError ); const [operation] = await client.updateGameServerDeployment(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -1423,7 +1423,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateGameServerDeploymentRollout(request); }, expectedError); assert( @@ -1463,7 +1463,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const [operation] = await client.updateGameServerDeploymentRollout( request ); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( diff --git a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts index 55f17538b32..0db9de80f93 100644 --- a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts @@ -268,7 +268,7 @@ describe('v1beta.RealmsServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.listRealms(request); }, expectedError); assert( @@ -379,7 +379,7 @@ describe('v1beta.RealmsServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getRealm = stubSimpleCall(undefined, expectedError); - assert.rejects(async () => { + await assert.rejects(async () => { await client.getRealm(request); }, expectedError); assert( @@ -498,7 +498,7 @@ describe('v1beta.RealmsServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.previewRealmUpdate(request); }, expectedError); assert( @@ -620,7 +620,7 @@ describe('v1beta.RealmsServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.createRealm(request); }, expectedError); assert( @@ -655,7 +655,7 @@ describe('v1beta.RealmsServiceClient', () => { expectedError ); const [operation] = await client.createRealm(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -777,7 +777,7 @@ describe('v1beta.RealmsServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.deleteRealm(request); }, expectedError); assert( @@ -812,7 +812,7 @@ describe('v1beta.RealmsServiceClient', () => { expectedError ); const [operation] = await client.deleteRealm(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( @@ -937,7 +937,7 @@ describe('v1beta.RealmsServiceClient', () => { undefined, expectedError ); - assert.rejects(async () => { + await assert.rejects(async () => { await client.updateRealm(request); }, expectedError); assert( @@ -973,7 +973,7 @@ describe('v1beta.RealmsServiceClient', () => { expectedError ); const [operation] = await client.updateRealm(request); - assert.rejects(async () => { + await assert.rejects(async () => { await operation.promise(); }, expectedError); assert( From 46b3a71a9ea2057c8a06a197ab569b33169ec152 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Apr 2020 20:56:20 +0200 Subject: [PATCH 024/180] chore(deps): update dependency gts to v2.0.0 (#46) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [gts](https://togithub.com/google/gts) | devDependencies | patch | [`2.0.0-alpha.9` -> `2.0.0`](https://renovatebot.com/diffs/npm/gts/2.0.0-alpha.9/2.0.0) | --- ### Release Notes
google/gts ### [`v2.0.0`](https://togithub.com/google/gts/blob/master/CHANGELOG.md#​200-httpswwwgithubcomgooglegtscomparev112v200-2020-04-02) [Compare Source](https://togithub.com/google/gts/compare/39a2705e51b4b6329a70f91f8293a2d7a363bf5d...v2.0.0) ##### ⚠ BREAKING CHANGES ⚠ This is a major rewrite of the tool. Based on community guidance, we've switched from using [tslint](https://palantir.github.io/tslint/) to [eslint](https://eslint.org/). _Please read all of the steps below to upgrade_. ##### Configuring `eslint` With the shift to `eslint`, `gts` now will format and lint JavaScript _as well_ as TypeScript. Upgrading will require a number of manual steps. To format JavaScript and TypeScript, you can run: $ npx gts fix To specify only TypeScript: $ npx gts fix '**/*.ts' ##### Delete `tslint.json` This file is no longer used, and can lead to confusion. ##### Create a `.eslintrc.json` Now that we're using eslint, you need to extend the eslint configuration baked into the module. Create a new file named `.eslintrc.json`, and paste the following: ```js { "extends": "./node_modules/gts" } ``` ##### Create a `.eslintignore` The `.eslintignore` file lets you ignore specific directories. This tool now lints and formats JavaScript, so it's _really_ important to ignore your build directory! Here is an example of a `.eslintignore` file: **/node_modules build/ ##### Rule changes The underlying linter was changed, so naturally there are going to be a variety of rule changes along the way. To see the full list, check out [.eslintrc.json](https://togithub.com/google/gts/blob/master/.eslintrc.json). ##### Require Node.js 10.x and up Node.js 8.x is now end of life - this module now requires Ndoe.js 10.x and up. ##### Features - add the eol-last rule ([#​425](https://www.github.com/google/gts/issues/425)) ([50ebd4d](https://www.github.com/google/gts/commit/50ebd4dbaf063615f4c025f567ca28076a734223)) - allow eslintrc to run over tsx files ([#​469](https://www.github.com/google/gts/issues/469)) ([a21db94](https://www.github.com/google/gts/commit/a21db94601def563952d677cb0980a12b6730f4c)) - disable global rule for checking TODO comments ([#​459](https://www.github.com/google/gts/issues/459)) ([96aa84a](https://www.github.com/google/gts/commit/96aa84a0a42181046daa248750cc8fef0c320619)) - override require-atomic-updates ([#​468](https://www.github.com/google/gts/issues/468)) ([8105c93](https://www.github.com/google/gts/commit/8105c9334ee5104b05f6b1b2f150e51419637262)) - prefer single quotes if possible ([#​475](https://www.github.com/google/gts/issues/475)) ([39a2705](https://www.github.com/google/gts/commit/39a2705e51b4b6329a70f91f8293a2d7a363bf5d)) - use eslint instead of tslint ([#​400](https://www.github.com/google/gts/issues/400)) ([b3096fb](https://www.github.com/google/gts/commit/b3096fbd5076d302d93c2307bf627e12c423e726)) ##### Bug Fixes - use .prettierrc.js ([#​437](https://www.github.com/google/gts/issues/437)) ([06efa84](https://www.github.com/google/gts/commit/06efa8444cdf1064b64f3e8d61ebd04f45d90b4c)) - **deps:** update dependency chalk to v4 ([#​477](https://www.github.com/google/gts/issues/477)) ([061d64e](https://www.github.com/google/gts/commit/061d64e29d37b93ce55228937cc100e05ddef352)) - **deps:** update dependency eslint-plugin-node to v11 ([#​426](https://www.github.com/google/gts/issues/426)) ([a394b7c](https://www.github.com/google/gts/commit/a394b7c1f80437f25017ca5c500b968ebb789ece)) - **deps:** update dependency execa to v4 ([#​427](https://www.github.com/google/gts/issues/427)) ([f42ef36](https://www.github.com/google/gts/commit/f42ef36709251553342e655e287e889df72ee3e3)) - **deps:** update dependency prettier to v2 ([#​464](https://www.github.com/google/gts/issues/464)) ([20ef43d](https://www.github.com/google/gts/commit/20ef43d566df17d3c93949ef7db3b72ee9123ca3)) - disable no-use-before-define ([#​431](https://www.github.com/google/gts/issues/431)) ([dea2c22](https://www.github.com/google/gts/commit/dea2c223d1d3a60a1786aa820eebb93be27016a7)) - **deps:** update dependency update-notifier to v4 ([#​403](https://www.github.com/google/gts/issues/403)) ([57393b7](https://www.github.com/google/gts/commit/57393b74c6cf299e8ae09311f0382226b8baa3e3)) - **deps:** upgrade to meow 6.x ([#​423](https://www.github.com/google/gts/issues/423)) ([8f93d00](https://www.github.com/google/gts/commit/8f93d0049337a832d9a22b6ae4e86fd41140ec56)) - align back to the google style guide ([#​440](https://www.github.com/google/gts/issues/440)) ([8bd78c4](https://www.github.com/google/gts/commit/8bd78c4c78526a72400f618a95a987d2a7c1a8db)) - disable empty-function check ([#​467](https://www.github.com/google/gts/issues/467)) ([6455d7a](https://www.github.com/google/gts/commit/6455d7a9d227320d3ffe1b00c9c739b846f339a8)) - drop support for node 8 ([#​422](https://www.github.com/google/gts/issues/422)) ([888c686](https://www.github.com/google/gts/commit/888c68692079065f38ce66ec84472f1f3311a050)) - emit .prettierrc.js with init ([#​462](https://www.github.com/google/gts/issues/462)) ([b114614](https://www.github.com/google/gts/commit/b114614d22ab5560d2d1dd5cb6695968cc80027b)) - enable trailing comma ([#​470](https://www.github.com/google/gts/issues/470)) ([6518f58](https://www.github.com/google/gts/commit/6518f5843d3093e3beb7d3371b56d9aecedf3924)) - include _.tsx and _.jsx in default fix command ([#​473](https://www.github.com/google/gts/issues/473)) ([0509780](https://www.github.com/google/gts/commit/050978005ad089d9b3b5d8895b25ea1175d75db2)) ##### [1.1.2](https://www.github.com/google/gts/compare/v1.1.1...v1.1.2) (2019-11-20) ##### Bug Fixes - **deps:** update to newest prettier (with support for optional chain) ([#​396](https://www.github.com/google/gts/issues/396)) ([ce8ad06](https://www.github.com/google/gts/commit/ce8ad06c8489c44a9e2ed5292382637b3ebb7601)) ##### [1.1.1](https://www.github.com/google/gts/compare/v1.1.0...v1.1.1) (2019-11-11) ##### Bug Fixes - **deps:** update dependency chalk to v3 ([#​389](https://www.github.com/google/gts/issues/389)) ([1ce0f45](https://www.github.com/google/gts/commit/1ce0f450677e143a27efc39def617d13c66503e8)) - **deps:** update dependency inquirer to v7 ([#​377](https://www.github.com/google/gts/issues/377)) ([bf2c349](https://www.github.com/google/gts/commit/bf2c349b2208ac63e551542599ac9cd27b461338)) - **deps:** update dependency rimraf to v3 ([#​374](https://www.github.com/google/gts/issues/374)) ([2058eaa](https://www.github.com/google/gts/commit/2058eaa682f4baae978b469fd708d1f866e7da74)) - **deps:** update dependency write-file-atomic to v3 ([#​353](https://www.github.com/google/gts/issues/353)) ([59e6aa8](https://www.github.com/google/gts/commit/59e6aa8580a2f8e9457d2d2b6fa9e18e86347592))
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index f61e00618d4..a8555364f05 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -37,7 +37,7 @@ "eslint-config-prettier": "^6.10.0", "eslint-plugin-node": "^11.0.0", "eslint-plugin-prettier": "^3.1.2", - "gts": "2.0.0-alpha.9", + "gts": "2.0.0", "jsdoc": "^3.5.5", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", From c647ce1f7c5535abfd348a1034411388977c9ac0 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Fri, 10 Apr 2020 18:50:40 -0700 Subject: [PATCH 025/180] fix: remove eslint, update gax, fix generated protos, run the generator (#47) Run the latest version of the generator, update google-gax, update gts, and remove direct dependencies on eslint. --- packages/google-cloud-gaming/package.json | 14 +++---- .../google/cloud/gaming/v1beta/common.proto | 3 +- .../gaming/v1beta/game_server_clusters.proto | 22 ++++++++--- .../v1beta/game_server_clusters_service.proto | 4 +- .../gaming/v1beta/game_server_configs.proto | 8 ++-- .../v1beta/game_server_configs_service.proto | 4 +- .../v1beta/game_server_deployments.proto | 8 ++-- .../game_server_deployments_service.proto | 9 ++++- .../google/cloud/gaming/v1beta/realms.proto | 8 ++-- .../cloud/gaming/v1beta/realms_service.proto | 4 +- .../google-cloud-gaming/protos/protos.json | 38 ++++++++++++------- .../game_server_deployments_service_client.ts | 5 +++ packages/google-cloud-gaming/synth.metadata | 15 ++------ packages/google-cloud-gaming/synth.py | 2 +- 14 files changed, 80 insertions(+), 64 deletions(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index a8555364f05..e9b6ff81534 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -16,28 +16,24 @@ "compile-protos": "compileProtos src", "docs": "jsdoc -c .jsdoc.js", "docs-test": "linkinator docs", - "fix": "gts fix && eslint samples --fix", - "lint": "gts check && eslint samples", + "fix": "gts fix", + "lint": "gts fix", "predocs-test": "npm run docs", "prepare": "npm run compile-protos && npm run compile", "system-test": "c8 mocha build/system-test", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "test": "c8 mocha build/test", - "prelint": "cd samples; npm link ../; npm i" + "prelint": "cd samples; npm link ../; npm install" }, "dependencies": { - "google-gax": "^2.0.1" + "google-gax": "^2.1.0" }, "devDependencies": { "@types/mocha": "^7.0.0", "@types/node": "^12.0.0", "@types/sinon": "^9.0.0", "c8": "^7.0.0", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.0", - "eslint-plugin-node": "^11.0.0", - "eslint-plugin-prettier": "^3.1.2", - "gts": "2.0.0", + "gts": "^2.0.0", "jsdoc": "^3.5.5", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", 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 index 1db6b77cfa4..027272cf309 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; 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 index 62ce7ef9cba..fd67a112b2c 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -25,6 +24,7 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListGameServerClustersRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerCluster" + child_type: "gameservices.googleapis.com/GameServerCluster" } ]; @@ -90,7 +90,7 @@ message CreateGameServerClusterRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerCluster" + child_type: "gameservices.googleapis.com/GameServerCluster" } ]; @@ -105,7 +105,12 @@ message CreateGameServerClusterRequest { message PreviewCreateGameServerClusterRequest { // Required. The parent resource name. Uses the form: // `projects/{project}/locations/{location}/realms/{realm}`. - string parent = 1 [(google.api.field_behavior) = REQUIRED]; + 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]; @@ -143,7 +148,12 @@ message DeleteGameServerClusterRequest { 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]; + 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]; 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 index 462e42dde47..2d81c438273 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -23,6 +22,7 @@ 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"; 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 index ac57c5c3a19..ea0820bd79d 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -24,6 +23,7 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListGameServerConfigsRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerConfig" + child_type: "gameservices.googleapis.com/GameServerConfig" } ]; @@ -91,7 +91,7 @@ message CreateGameServerConfigRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerConfig" + child_type: "gameservices.googleapis.com/GameServerConfig" } ]; 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 index 89dd582307a..29e886c50df 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -23,6 +22,7 @@ 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"; 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 index d0682520900..2e87e386c85 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -25,6 +24,7 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListGameServerDeploymentsRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerDeployment" + child_type: "gameservices.googleapis.com/GameServerDeployment" } ]; @@ -105,7 +105,7 @@ message CreateGameServerDeploymentRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerDeployment" + child_type: "gameservices.googleapis.com/GameServerDeployment" } ]; 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 index ccb0c5055f4..ccacfbacd5a 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -23,6 +22,7 @@ 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"; @@ -95,6 +95,11 @@ service GameServerDeploymentsService { } // 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" 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 index 38281aa6789..c1fa9982f2f 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -25,6 +24,7 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListRealmsRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/Realm" + child_type: "gameservices.googleapis.com/Realm" } ]; @@ -90,7 +90,7 @@ message CreateRealmRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/Realm" + child_type: "gameservices.googleapis.com/Realm" } ]; 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 index b7dfaa07cc3..4c87cac3d36 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -23,6 +22,7 @@ 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"; diff --git a/packages/google-cloud-gaming/protos/protos.json b/packages/google-cloud-gaming/protos/protos.json index 5a0173d1665..81af95e0ff0 100644 --- a/packages/google-cloud-gaming/protos/protos.json +++ b/packages/google-cloud-gaming/protos/protos.json @@ -306,7 +306,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" } }, "pageSize": { @@ -376,7 +376,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" } }, "gameServerClusterId": { @@ -401,7 +401,8 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" } }, "gameServerClusterId": { @@ -457,7 +458,8 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" } }, "previewTime": { @@ -695,7 +697,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerConfig" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerConfig" } }, "pageSize": { @@ -765,7 +767,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerConfig" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerConfig" } }, "configId": { @@ -933,7 +935,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerDeployment" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerDeployment" } }, "pageSize": { @@ -1015,7 +1017,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerDeployment" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerDeployment" } }, "deploymentId": { @@ -1364,7 +1366,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/Realm" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/Realm" } }, "pageSize": { @@ -1434,7 +1436,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/Realm" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/Realm" } }, "realmId": { @@ -2791,26 +2793,32 @@ "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.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.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.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" } }, "CancelOperation": { @@ -2818,7 +2826,8 @@ "responseType": "google.protobuf.Empty", "options": { "(google.api.http).post": "/v1/{name=operations/**}:cancel", - "(google.api.http).body": "*" + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" } }, "WaitOperation": { @@ -2944,6 +2953,7 @@ }, "rpc": { "options": { + "cc_enable_arenas": true, "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", "java_multiple_files": true, "java_outer_classname": "StatusProto", 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 index 8f0e5e35073..718b0d64672 100644 --- 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 @@ -1207,6 +1207,11 @@ export class GameServerDeploymentsServiceClient { ): void; /** * 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. diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 5de34d710ea..6949de15b96 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -1,21 +1,12 @@ { - "updateTime": "2020-04-07T12:40:41.496571Z", + "updateTime": "2020-04-11T00:17:46.129553Z", "sources": [ - { - "git": { - "name": "googleapis-private", - "remote": "https://github.com/googleapis/googleapis-private.git", - "sha": "ddac0ff9513bd89b53aa6895c65a7c3272626583", - "internalRef": "304945322", - "log": "ddac0ff9513bd89b53aa6895c65a7c3272626583\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 304945322\n\n" - } - }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1df68ed6735ddce6797d0f83641a731c3c3f75b4", - "log": "1df68ed6735ddce6797d0f83641a731c3c3f75b4\nfix: apache license URL (#468)\n\n\nf4a59efa54808c4b958263de87bc666ce41e415f\nfeat: Add discogapic support for GAPICBazel generation (#459)\n\n* feat: Add discogapic support for GAPICBazel generation\n\n* reformat with black\n\n* Rename source repository variable\n\nCo-authored-by: Jeffrey Rennie \n" + "sha": "6f32150677c9784f3c3a7e1949472bd29c9d72c5", + "log": "6f32150677c9784f3c3a7e1949472bd29c9d72c5\nfix: installs test_utils from its common repo (#480)\n\n\n74ce986d3b5431eb66985e9a00c4eb45295a4020\nfix: stop recording update_time in synth.metadata (#478)\n\n\n7f8e62aa3edd225f76347a16f92e400661fdfb52\nchore(java): release-please only updates non maven versions in README (#476)\n\nPrevent release-please and synthtool from fighting over the released library version. Synthtool updates the install snippets from the samples pom.xml files so the bots fight if they are temporarily out of sync after a release.\nc7e0e517d7f46f77bebd27da2e5afcaa6eee7e25\nbuild(java): fix nightly integration test config to run integrations (#465)\n\nThis was only running the units.\nbd69a2aa7b70875f3c988e269706b22fefbef40e\nbuild(java): fix retry_with_backoff when -e option set (#475)\n\n\nd9b173c427bfa0c6cca818233562e7e8841a357c\nfix: record version of working repo in synth.metadata (#473)\n\nPartial revert of b37cf74d12e9a42b9de9e61a4f26133d7cd9c168.\nf73a541770d95a609e5be6bf6b3b220d17cefcbe\nfeat(discogapic): allow local discovery-artifact-manager (#474)\n\n\n8cf0f5d93a70c3dcb0b4999d3152c46d4d9264bf\ndoc: describe the Autosynth & Synthtool protocol (#472)\n\n* doc: describe the Autosynth & Synthtool protocol\n\n* Accommodate review comments.\n980baaa738a1ad8fa02b4fdbd56be075ee77ece5\nfix: pin sphinx to <3.0.0 as new version causes new error (#471)\n\nThe error `toctree contains reference to document changlelog that doesn't have a title: no link will be generated` occurs as of 3.0.0. Pinning to 2.x until we address the docs build issue.\n\nTowards #470\n\nI did this manually for python-datastore https://github.com/googleapis/python-datastore/pull/22\n928b2998ac5023e7c7e254ab935f9ef022455aad\nchore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.0.15 (#466)\n\nCo-authored-by: Jeffrey Rennie \n188f1b1d53181f739b98f8aa5d40cfe99eb90c47\nfix: allow local and external deps to be specified (#469)\n\nModify noxfile.py to allow local and external dependencies for\nsystem tests to be specified.\n" } } ], diff --git a/packages/google-cloud-gaming/synth.py b/packages/google-cloud-gaming/synth.py index df8f9a9f7e5..2170dab0695 100644 --- a/packages/google-cloud-gaming/synth.py +++ b/packages/google-cloud-gaming/synth.py @@ -39,5 +39,5 @@ s.copy(templates, excludes=[]) # Node.js specific cleanup subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'fix']) +subprocess.run(['npm', 'run', 'lint']) subprocess.run(['npx', 'compileProtos', 'src']) From f290c9c02b0d536a0e2f895d6221f1aa254ddcf8 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Sat, 11 Apr 2020 19:16:41 -0700 Subject: [PATCH 026/180] build: remove unused codecov config (#49) --- packages/google-cloud-gaming/codecov.yaml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 packages/google-cloud-gaming/codecov.yaml diff --git a/packages/google-cloud-gaming/codecov.yaml b/packages/google-cloud-gaming/codecov.yaml deleted file mode 100644 index 5724ea9478d..00000000000 --- a/packages/google-cloud-gaming/codecov.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -codecov: - ci: - - source.cloud.google.com From 28e708722f0eebb50527ba89bff9ce4886d7993e Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 13 Apr 2020 10:17:57 -0700 Subject: [PATCH 027/180] chore: minor proto updates (#50) --- .../google/cloud/gaming/v1beta/common.proto | 3 ++- .../gaming/v1beta/game_server_clusters.proto | 22 +++++-------------- .../v1beta/game_server_clusters_service.proto | 4 ++-- .../gaming/v1beta/game_server_configs.proto | 8 +++---- .../v1beta/game_server_configs_service.proto | 4 ++-- .../v1beta/game_server_deployments.proto | 8 +++---- .../game_server_deployments_service.proto | 9 ++------ .../google/cloud/gaming/v1beta/realms.proto | 8 +++---- .../cloud/gaming/v1beta/realms_service.proto | 4 ++-- .../google-cloud-gaming/protos/protos.json | 22 +++++++++---------- .../game_server_deployments_service_client.ts | 5 ----- packages/google-cloud-gaming/synth.metadata | 19 +++++++++++++--- 12 files changed, 54 insertions(+), 62 deletions(-) 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 index 027272cf309..1db6b77cfa4 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; 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 index fd67a112b2c..62ce7ef9cba 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -24,7 +25,6 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListGameServerClustersRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/GameServerCluster" + type: "gameservices.googleapis.com/GameServerCluster" } ]; @@ -90,7 +90,7 @@ message CreateGameServerClusterRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/GameServerCluster" + type: "gameservices.googleapis.com/GameServerCluster" } ]; @@ -105,12 +105,7 @@ message CreateGameServerClusterRequest { 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" - } - ]; + string parent = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The ID of the Game Server Cluster resource to be created. string game_server_cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; @@ -148,12 +143,7 @@ message DeleteGameServerClusterRequest { 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" - } - ]; + string name = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. The target timestamp to compute the preview. google.protobuf.Timestamp preview_time = 2 [(google.api.field_behavior) = OPTIONAL]; 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 index 2d81c438273..462e42dde47 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -22,7 +23,6 @@ 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"; 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 index ea0820bd79d..ac57c5c3a19 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -23,7 +24,6 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListGameServerConfigsRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/GameServerConfig" + type: "gameservices.googleapis.com/GameServerConfig" } ]; @@ -91,7 +91,7 @@ message CreateGameServerConfigRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/GameServerConfig" + type: "gameservices.googleapis.com/GameServerConfig" } ]; 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 index 29e886c50df..89dd582307a 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -22,7 +23,6 @@ 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"; 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 index 2e87e386c85..d0682520900 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -24,7 +25,6 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListGameServerDeploymentsRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/GameServerDeployment" + type: "gameservices.googleapis.com/GameServerDeployment" } ]; @@ -105,7 +105,7 @@ message CreateGameServerDeploymentRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/GameServerDeployment" + type: "gameservices.googleapis.com/GameServerDeployment" } ]; 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 index ccacfbacd5a..ccb0c5055f4 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -22,7 +23,6 @@ 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"; @@ -95,11 +95,6 @@ service GameServerDeploymentsService { } // 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" 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 index c1fa9982f2f..38281aa6789 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -24,7 +25,6 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListRealmsRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/Realm" + type: "gameservices.googleapis.com/Realm" } ]; @@ -90,7 +90,7 @@ message CreateRealmRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/Realm" + type: "gameservices.googleapis.com/Realm" } ]; 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 index 4c87cac3d36..b7dfaa07cc3 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -22,7 +23,6 @@ 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"; diff --git a/packages/google-cloud-gaming/protos/protos.json b/packages/google-cloud-gaming/protos/protos.json index 81af95e0ff0..bfc2265f969 100644 --- a/packages/google-cloud-gaming/protos/protos.json +++ b/packages/google-cloud-gaming/protos/protos.json @@ -306,7 +306,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" } }, "pageSize": { @@ -376,7 +376,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" } }, "gameServerClusterId": { @@ -401,8 +401,7 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" + "(google.api.field_behavior)": "REQUIRED" } }, "gameServerClusterId": { @@ -458,8 +457,7 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" + "(google.api.field_behavior)": "REQUIRED" } }, "previewTime": { @@ -697,7 +695,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerConfig" + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerConfig" } }, "pageSize": { @@ -767,7 +765,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerConfig" + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerConfig" } }, "configId": { @@ -935,7 +933,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerDeployment" + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerDeployment" } }, "pageSize": { @@ -1017,7 +1015,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerDeployment" + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerDeployment" } }, "deploymentId": { @@ -1366,7 +1364,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/Realm" + "(google.api.resource_reference).type": "gameservices.googleapis.com/Realm" } }, "pageSize": { @@ -1436,7 +1434,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/Realm" + "(google.api.resource_reference).type": "gameservices.googleapis.com/Realm" } }, "realmId": { 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 index 718b0d64672..8f0e5e35073 100644 --- 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 @@ -1207,11 +1207,6 @@ export class GameServerDeploymentsServiceClient { ): void; /** * 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. diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 6949de15b96..af4f3cf9343 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -1,12 +1,25 @@ { - "updateTime": "2020-04-11T00:17:46.129553Z", "sources": [ + { + "git": { + "name": ".", + "remote": "https://github.com/googleapis/nodejs-game-servers.git", + "sha": "c75bb2de6ef48c26d5d90892a906b45dcf91755c" + } + }, + { + "git": { + "name": "googleapis-private", + "remote": "https://github.com/googleapis/googleapis-private.git", + "sha": "ddac0ff9513bd89b53aa6895c65a7c3272626583", + "internalRef": "304945322" + } + }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "6f32150677c9784f3c3a7e1949472bd29c9d72c5", - "log": "6f32150677c9784f3c3a7e1949472bd29c9d72c5\nfix: installs test_utils from its common repo (#480)\n\n\n74ce986d3b5431eb66985e9a00c4eb45295a4020\nfix: stop recording update_time in synth.metadata (#478)\n\n\n7f8e62aa3edd225f76347a16f92e400661fdfb52\nchore(java): release-please only updates non maven versions in README (#476)\n\nPrevent release-please and synthtool from fighting over the released library version. Synthtool updates the install snippets from the samples pom.xml files so the bots fight if they are temporarily out of sync after a release.\nc7e0e517d7f46f77bebd27da2e5afcaa6eee7e25\nbuild(java): fix nightly integration test config to run integrations (#465)\n\nThis was only running the units.\nbd69a2aa7b70875f3c988e269706b22fefbef40e\nbuild(java): fix retry_with_backoff when -e option set (#475)\n\n\nd9b173c427bfa0c6cca818233562e7e8841a357c\nfix: record version of working repo in synth.metadata (#473)\n\nPartial revert of b37cf74d12e9a42b9de9e61a4f26133d7cd9c168.\nf73a541770d95a609e5be6bf6b3b220d17cefcbe\nfeat(discogapic): allow local discovery-artifact-manager (#474)\n\n\n8cf0f5d93a70c3dcb0b4999d3152c46d4d9264bf\ndoc: describe the Autosynth & Synthtool protocol (#472)\n\n* doc: describe the Autosynth & Synthtool protocol\n\n* Accommodate review comments.\n980baaa738a1ad8fa02b4fdbd56be075ee77ece5\nfix: pin sphinx to <3.0.0 as new version causes new error (#471)\n\nThe error `toctree contains reference to document changlelog that doesn't have a title: no link will be generated` occurs as of 3.0.0. Pinning to 2.x until we address the docs build issue.\n\nTowards #470\n\nI did this manually for python-datastore https://github.com/googleapis/python-datastore/pull/22\n928b2998ac5023e7c7e254ab935f9ef022455aad\nchore(deps): update dependency com.google.cloud.samples:shared-configuration to v1.0.15 (#466)\n\nCo-authored-by: Jeffrey Rennie \n188f1b1d53181f739b98f8aa5d40cfe99eb90c47\nfix: allow local and external deps to be specified (#469)\n\nModify noxfile.py to allow local and external dependencies for\nsystem tests to be specified.\n" + "sha": "6f32150677c9784f3c3a7e1949472bd29c9d72c5" } } ], From 377b9edbdb7625eb0890882f1ac83fddf10b3aa0 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 13 Apr 2020 14:54:26 -0700 Subject: [PATCH 028/180] chore: update lint ignore files (#51) --- packages/google-cloud-gaming/.eslintignore | 3 ++- packages/google-cloud-gaming/.prettierignore | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-gaming/.eslintignore b/packages/google-cloud-gaming/.eslintignore index 09b31fe735a..9340ad9b86d 100644 --- a/packages/google-cloud-gaming/.eslintignore +++ b/packages/google-cloud-gaming/.eslintignore @@ -1,5 +1,6 @@ **/node_modules -src/**/doc/* +**/coverage +test/fixtures build/ docs/ protos/ diff --git a/packages/google-cloud-gaming/.prettierignore b/packages/google-cloud-gaming/.prettierignore index f6fac98b0a8..9340ad9b86d 100644 --- a/packages/google-cloud-gaming/.prettierignore +++ b/packages/google-cloud-gaming/.prettierignore @@ -1,3 +1,6 @@ -node_modules/* -samples/node_modules/* -src/**/doc/* +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ From 16ea865680014914ea26c46317bb7c449aeb6eda Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Mon, 13 Apr 2020 19:28:57 -0700 Subject: [PATCH 029/180] chore: remove tslint.json (#52) --- packages/google-cloud-gaming/tslint.json | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 packages/google-cloud-gaming/tslint.json diff --git a/packages/google-cloud-gaming/tslint.json b/packages/google-cloud-gaming/tslint.json deleted file mode 100644 index 617dc975bae..00000000000 --- a/packages/google-cloud-gaming/tslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "gts/tslint.json" -} From dbca3246bd98be30aa97fc66e01531f6dd77d3c3 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Tue, 14 Apr 2020 09:55:55 -0700 Subject: [PATCH 030/180] chore: remove unused dev packages (#53) --- packages/google-cloud-gaming/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index e9b6ff81534..b76c00f1b11 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -41,7 +41,6 @@ "mocha": "^7.0.0", "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", - "prettier": "^1.19.1", "sinon": "^9.0.1", "ts-loader": "^6.2.1", "typescript": "^3.8.3", From f654f6bfa85ed0c1d95cd125133353d0919402cf Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 15 Apr 2020 17:31:01 +0200 Subject: [PATCH 031/180] chore(deps): update dependency ts-loader to v7 (#54) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [ts-loader](https://togithub.com/TypeStrong/ts-loader) | devDependencies | major | [`^6.2.1` -> `^7.0.0`](https://renovatebot.com/diffs/npm/ts-loader/6.2.2/7.0.0) | --- ### Release Notes
TypeStrong/ts-loader ### [`v7.0.0`](https://togithub.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md#v700) [Compare Source](https://togithub.com/TypeStrong/ts-loader/compare/v6.2.2...v7.0.0) - [Project reference support enhancements](https://togithub.com/TypeStrong/ts-loader/pull/1076) - thanks [@​sheetalkamat](https://togithub.com/sheetalkamat)! - Following the end of life of Node 8, `ts-loader` no longer supports Node 8 **BREAKING CHANGE**
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index b76c00f1b11..acd0e313044 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -42,7 +42,7 @@ "null-loader": "^3.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", - "ts-loader": "^6.2.1", + "ts-loader": "^7.0.0", "typescript": "^3.8.3", "webpack": "^4.41.2", "webpack-cli": "^3.3.10" From 1fa182de6bac62a39c28ee1da7ed5c0ef4b63d6c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 15 Apr 2020 18:30:34 +0200 Subject: [PATCH 032/180] chore(deps): update dependency null-loader to v4 (#56) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [null-loader](https://togithub.com/webpack-contrib/null-loader) | devDependencies | major | [`^3.0.0` -> `^4.0.0`](https://renovatebot.com/diffs/npm/null-loader/3.0.0/4.0.0) | --- ### Release Notes
webpack-contrib/null-loader ### [`v4.0.0`](https://togithub.com/webpack-contrib/null-loader/blob/master/CHANGELOG.md#​400-httpsgithubcomwebpack-contribnull-loadercomparev300v400-2020-04-15) [Compare Source](https://togithub.com/webpack-contrib/null-loader/compare/v3.0.0...v4.0.0) ##### Bug Fixes - support `webpack@5` ##### ⚠ BREAKING CHANGES - minimum required Nodejs version is `10.13`
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index acd0e313044..fa72ddc8715 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -39,7 +39,7 @@ "jsdoc-region-tag": "^1.0.2", "linkinator": "^2.0.3", "mocha": "^7.0.0", - "null-loader": "^3.0.0", + "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", "ts-loader": "^7.0.0", From 86639d194d0c379396327bfcf065e427355477c9 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Wed, 15 Apr 2020 10:30:08 -0700 Subject: [PATCH 033/180] chore: run fix instead of lint in synthfile (#57) --- packages/google-cloud-gaming/synth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/synth.py b/packages/google-cloud-gaming/synth.py index 2170dab0695..df8f9a9f7e5 100644 --- a/packages/google-cloud-gaming/synth.py +++ b/packages/google-cloud-gaming/synth.py @@ -39,5 +39,5 @@ s.copy(templates, excludes=[]) # Node.js specific cleanup subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'lint']) +subprocess.run(['npm', 'run', 'fix']) subprocess.run(['npx', 'compileProtos', 'src']) From a4f785c4e561305bc7c29339a6f57e7f69c72d7f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 27 Apr 2020 10:36:01 -0700 Subject: [PATCH 034/180] build: generator updates and new coverage approach (#59) --- packages/google-cloud-gaming/protos/protos.js | 606 +++++++++--------- .../game_server_clusters_service_client.ts | 388 ++++++++--- .../game_server_configs_service_client.ts | 351 +++++++--- .../game_server_deployments_service_client.ts | 397 +++++++++--- .../src/v1beta/realms_service_client.ts | 350 +++++++--- packages/google-cloud-gaming/synth.metadata | 8 +- .../system-test/install.ts | 4 +- ...pic_game_server_clusters_service_v1beta.ts | 523 +++++++++++---- ...apic_game_server_configs_service_v1beta.ts | 523 +++++++++++---- ..._game_server_deployments_service_v1beta.ts | 527 +++++++++++---- .../test/gapic_realms_service_v1beta.ts | 469 ++++++++++---- 11 files changed, 2992 insertions(+), 1154 deletions(-) diff --git a/packages/google-cloud-gaming/protos/protos.js b/packages/google-cloud-gaming/protos/protos.js index f96a63fd101..9a1d4c3b0bb 100644 --- a/packages/google-cloud-gaming/protos/protos.js +++ b/packages/google-cloud-gaming/protos/protos.js @@ -196,24 +196,24 @@ OperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.createTime != null && message.hasOwnProperty("createTime")) + 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 && message.hasOwnProperty("endTime")) + 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 && message.hasOwnProperty("target")) + if (message.target != null && Object.hasOwnProperty.call(message, "target")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); - if (message.verb != null && message.hasOwnProperty("verb")) + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + 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 && message.hasOwnProperty("operationStatus")) + 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(); @@ -560,11 +560,11 @@ OperationStatus.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.done != null && message.hasOwnProperty("done")) + if (message.done != null && Object.hasOwnProperty.call(message, "done")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.done); - if (message.errorCode != null && message.hasOwnProperty("errorCode")) + if (message.errorCode != null && Object.hasOwnProperty.call(message, "errorCode")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.errorCode); - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.errorMessage); return writer; }; @@ -741,7 +741,7 @@ /** * ErrorCode enum. * @name google.cloud.gaming.v1beta.OperationStatus.ErrorCode - * @enum {string} + * @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 @@ -816,7 +816,7 @@ LabelSelector.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.labels != null && message.hasOwnProperty("labels")) + 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; @@ -1253,13 +1253,13 @@ Schedule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.startTime != null && message.hasOwnProperty("startTime")) + 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 && message.hasOwnProperty("endTime")) + 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 && message.hasOwnProperty("cronJobDuration")) + 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 && message.hasOwnProperty("cronSpec")) + if (message.cronSpec != null && Object.hasOwnProperty.call(message, "cronSpec")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.cronSpec); return writer; }; @@ -1504,9 +1504,9 @@ SpecSource.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gameServerConfigName != null && message.hasOwnProperty("gameServerConfigName")) + if (message.gameServerConfigName != null && Object.hasOwnProperty.call(message, "gameServerConfigName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.gameServerConfigName); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); return writer; }; @@ -1724,9 +1724,9 @@ TargetDetails.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gameServerClusterName != null && message.hasOwnProperty("gameServerClusterName")) + if (message.gameServerClusterName != null && Object.hasOwnProperty.call(message, "gameServerClusterName")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.gameServerClusterName); - if (message.gameServerDeploymentName != null && message.hasOwnProperty("gameServerDeploymentName")) + 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) @@ -1965,9 +1965,9 @@ TargetFleetDetails.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.fleet != null && message.hasOwnProperty("fleet")) + 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 && message.hasOwnProperty("autoscaler")) + 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; }; @@ -2182,9 +2182,9 @@ TargetFleet.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.specSource != null && message.hasOwnProperty("specSource")) + 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; }; @@ -2397,9 +2397,9 @@ TargetFleetAutoscaler.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.specSource != null && message.hasOwnProperty("specSource")) + 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; }; @@ -2826,9 +2826,9 @@ DeployedFleetDetails.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deployedFleet != null && message.hasOwnProperty("deployedFleet")) + 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 && message.hasOwnProperty("deployedAutoscaler")) + 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; }; @@ -3061,13 +3061,13 @@ DeployedFleet.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.fleet != null && message.hasOwnProperty("fleet")) + if (message.fleet != null && Object.hasOwnProperty.call(message, "fleet")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.fleet); - if (message.fleetSpec != null && message.hasOwnProperty("fleetSpec")) + if (message.fleetSpec != null && Object.hasOwnProperty.call(message, "fleetSpec")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.fleetSpec); - if (message.specSource != null && message.hasOwnProperty("specSource")) + 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 && message.hasOwnProperty("status")) + 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; }; @@ -3322,13 +3322,13 @@ DeployedFleetStatus.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.readyReplicas != null && message.hasOwnProperty("readyReplicas")) + if (message.readyReplicas != null && Object.hasOwnProperty.call(message, "readyReplicas")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.readyReplicas); - if (message.allocatedReplicas != null && message.hasOwnProperty("allocatedReplicas")) + if (message.allocatedReplicas != null && Object.hasOwnProperty.call(message, "allocatedReplicas")) writer.uint32(/* id 2, wireType 0 =*/16).int64(message.allocatedReplicas); - if (message.reservedReplicas != null && message.hasOwnProperty("reservedReplicas")) + if (message.reservedReplicas != null && Object.hasOwnProperty.call(message, "reservedReplicas")) writer.uint32(/* id 3, wireType 0 =*/24).int64(message.reservedReplicas); - if (message.replicas != null && message.hasOwnProperty("replicas")) + if (message.replicas != null && Object.hasOwnProperty.call(message, "replicas")) writer.uint32(/* id 4, wireType 0 =*/32).int64(message.replicas); return writer; }; @@ -3626,11 +3626,11 @@ DeployedFleetAutoscaler.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.autoscaler != null && message.hasOwnProperty("autoscaler")) + if (message.autoscaler != null && Object.hasOwnProperty.call(message, "autoscaler")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.autoscaler); - if (message.fleetAutoscalerSpec != null && message.hasOwnProperty("fleetAutoscalerSpec")) + if (message.fleetAutoscalerSpec != null && Object.hasOwnProperty.call(message, "fleetAutoscalerSpec")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.fleetAutoscalerSpec); - if (message.specSource != null && message.hasOwnProperty("specSource")) + 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; }; @@ -3884,15 +3884,15 @@ ListGameServerClustersRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; @@ -4147,7 +4147,7 @@ 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 && message.hasOwnProperty("nextPageToken")) + 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) @@ -4394,7 +4394,7 @@ GetGameServerClusterRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -4599,11 +4599,11 @@ CreateGameServerClusterRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.gameServerClusterId != null && message.hasOwnProperty("gameServerClusterId")) + if (message.gameServerClusterId != null && Object.hasOwnProperty.call(message, "gameServerClusterId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.gameServerClusterId); - if (message.gameServerCluster != null && message.hasOwnProperty("gameServerCluster")) + 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; }; @@ -4845,13 +4845,13 @@ PreviewCreateGameServerClusterRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.gameServerClusterId != null && message.hasOwnProperty("gameServerClusterId")) + if (message.gameServerClusterId != null && Object.hasOwnProperty.call(message, "gameServerClusterId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.gameServerClusterId); - if (message.gameServerCluster != null && message.hasOwnProperty("gameServerCluster")) + 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 && message.hasOwnProperty("previewTime")) + 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; }; @@ -5091,9 +5091,9 @@ PreviewCreateGameServerClusterResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); - if (message.targetState != null && message.hasOwnProperty("targetState")) + 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; }; @@ -5297,7 +5297,7 @@ DeleteGameServerClusterRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -5493,9 +5493,9 @@ PreviewDeleteGameServerClusterRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.previewTime != null && message.hasOwnProperty("previewTime")) + 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; }; @@ -5708,9 +5708,9 @@ PreviewDeleteGameServerClusterResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); - if (message.targetState != null && message.hasOwnProperty("targetState")) + 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; }; @@ -5923,9 +5923,9 @@ UpdateGameServerClusterRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gameServerCluster != null && message.hasOwnProperty("gameServerCluster")) + 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 && message.hasOwnProperty("updateMask")) + 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; }; @@ -6152,11 +6152,11 @@ PreviewUpdateGameServerClusterRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gameServerCluster != null && message.hasOwnProperty("gameServerCluster")) + 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 && message.hasOwnProperty("updateMask")) + 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 && message.hasOwnProperty("previewTime")) + 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; }; @@ -6390,9 +6390,9 @@ PreviewUpdateGameServerClusterResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); - if (message.targetState != null && message.hasOwnProperty("targetState")) + 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; }; @@ -6619,9 +6619,9 @@ GameServerClusterConnectionInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.namespace != null && message.hasOwnProperty("namespace")) + if (message.namespace != null && Object.hasOwnProperty.call(message, "namespace")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.namespace); - if (message.gkeClusterReference != null && message.hasOwnProperty("gkeClusterReference")) + 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; }; @@ -6830,7 +6830,7 @@ GkeClusterReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.cluster != null && message.hasOwnProperty("cluster")) + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.cluster); return writer; }; @@ -7072,20 +7072,20 @@ GameServerCluster.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.createTime != null && message.hasOwnProperty("createTime")) + 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 && message.hasOwnProperty("updateTime")) + 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 && message.hasOwnProperty("labels")) + 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 && message.hasOwnProperty("connectionInfo")) + 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 && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); return writer; }; @@ -7709,15 +7709,15 @@ ListGameServerConfigsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; @@ -7972,7 +7972,7 @@ 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 && message.hasOwnProperty("nextPageToken")) + 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) @@ -8219,7 +8219,7 @@ GetGameServerConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -8424,11 +8424,11 @@ CreateGameServerConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.configId != null && message.hasOwnProperty("configId")) + if (message.configId != null && Object.hasOwnProperty.call(message, "configId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.configId); - if (message.gameServerConfig != null && message.hasOwnProperty("gameServerConfig")) + 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; }; @@ -8643,7 +8643,7 @@ DeleteGameServerConfigRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -8859,9 +8859,9 @@ ScalingConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.fleetAutoscalerSpec != null && message.hasOwnProperty("fleetAutoscalerSpec")) + 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) @@ -9137,9 +9137,9 @@ FleetConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.fleetSpec != null && message.hasOwnProperty("fleetSpec")) + if (message.fleetSpec != null && Object.hasOwnProperty.call(message, "fleetSpec")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.fleetSpec); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); return writer; }; @@ -9395,13 +9395,13 @@ GameServerConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.createTime != null && message.hasOwnProperty("createTime")) + 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 && message.hasOwnProperty("updateTime")) + 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 && message.hasOwnProperty("labels")) + 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) @@ -9410,7 +9410,7 @@ 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 && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); return writer; }; @@ -9937,15 +9937,15 @@ ListGameServerDeploymentsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; @@ -10200,7 +10200,7 @@ 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 && message.hasOwnProperty("nextPageToken")) + 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) @@ -10447,7 +10447,7 @@ GetGameServerDeploymentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -10634,7 +10634,7 @@ GetGameServerDeploymentRolloutRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -10839,11 +10839,11 @@ CreateGameServerDeploymentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.deploymentId != null && message.hasOwnProperty("deploymentId")) + if (message.deploymentId != null && Object.hasOwnProperty.call(message, "deploymentId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.deploymentId); - if (message.gameServerDeployment != null && message.hasOwnProperty("gameServerDeployment")) + 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; }; @@ -11058,7 +11058,7 @@ DeleteGameServerDeploymentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -11254,9 +11254,9 @@ UpdateGameServerDeploymentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.gameServerDeployment != null && message.hasOwnProperty("gameServerDeployment")) + 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 && message.hasOwnProperty("updateMask")) + 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; }; @@ -11474,9 +11474,9 @@ UpdateGameServerDeploymentRolloutRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.rollout != null && message.hasOwnProperty("rollout")) + 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 && message.hasOwnProperty("updateMask")) + 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; }; @@ -11685,7 +11685,7 @@ FetchDeploymentStateRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -12126,7 +12126,7 @@ DeployedClusterState.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.cluster != null && message.hasOwnProperty("cluster")) + 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) @@ -12396,18 +12396,18 @@ GameServerDeployment.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.createTime != null && message.hasOwnProperty("createTime")) + 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 && message.hasOwnProperty("updateTime")) + 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 && message.hasOwnProperty("labels")) + 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 && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.description); return writer; }; @@ -12714,9 +12714,9 @@ GameServerConfigOverride.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.realmsSelector != null && message.hasOwnProperty("realmsSelector")) + 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 && message.hasOwnProperty("configVersion")) + if (message.configVersion != null && Object.hasOwnProperty.call(message, "configVersion")) writer.uint32(/* id 100, wireType 2 =*/802).string(message.configVersion); return writer; }; @@ -12974,18 +12974,18 @@ GameServerDeploymentRollout.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.createTime != null && message.hasOwnProperty("createTime")) + 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 && message.hasOwnProperty("updateTime")) + 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 && message.hasOwnProperty("defaultGameServerConfig")) + 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 && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.etag); return writer; }; @@ -13276,11 +13276,11 @@ PreviewGameServerDeploymentRolloutRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.rollout != null && message.hasOwnProperty("rollout")) + 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 && message.hasOwnProperty("updateMask")) + 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 && message.hasOwnProperty("previewTime")) + 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; }; @@ -13527,9 +13527,9 @@ 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 && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); - if (message.targetState != null && message.hasOwnProperty("targetState")) + 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; }; @@ -14127,15 +14127,15 @@ ListRealmsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; @@ -14390,7 +14390,7 @@ 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 && message.hasOwnProperty("nextPageToken")) + 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) @@ -14637,7 +14637,7 @@ GetRealmRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -14842,11 +14842,11 @@ CreateRealmRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && message.hasOwnProperty("parent")) + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.realmId != null && message.hasOwnProperty("realmId")) + if (message.realmId != null && Object.hasOwnProperty.call(message, "realmId")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.realmId); - if (message.realm != null && message.hasOwnProperty("realm")) + 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; }; @@ -15061,7 +15061,7 @@ DeleteRealmRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -15257,9 +15257,9 @@ UpdateRealmRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.realm != null && message.hasOwnProperty("realm")) + 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 && message.hasOwnProperty("updateMask")) + 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; }; @@ -15486,11 +15486,11 @@ PreviewRealmUpdateRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.realm != null && message.hasOwnProperty("realm")) + 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 && message.hasOwnProperty("updateMask")) + 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 && message.hasOwnProperty("previewTime")) + 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; }; @@ -15724,9 +15724,9 @@ PreviewRealmUpdateResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.etag); - if (message.targetState != null && message.hasOwnProperty("targetState")) + 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; }; @@ -15985,20 +15985,20 @@ Realm.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.createTime != null && message.hasOwnProperty("createTime")) + 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 && message.hasOwnProperty("updateTime")) + 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 && message.hasOwnProperty("labels")) + 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 && message.hasOwnProperty("timeZone")) + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.timeZone); - if (message.etag != null && message.hasOwnProperty("etag")) + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.etag); - if (message.description != null && message.hasOwnProperty("description")) + if (message.description != null && Object.hasOwnProperty.call(message, "description")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.description); return writer; }; @@ -16480,7 +16480,7 @@ /** * FieldBehavior enum. * @name google.api.FieldBehavior - * @enum {string} + * @enum {number} * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value * @property {number} OPTIONAL=1 OPTIONAL value * @property {number} REQUIRED=2 REQUIRED value @@ -16568,7 +16568,7 @@ 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 && message.hasOwnProperty("fullyDecodeReservedExpansion")) + if (message.fullyDecodeReservedExpansion != null && Object.hasOwnProperty.call(message, "fullyDecodeReservedExpansion")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.fullyDecodeReservedExpansion); return writer; }; @@ -16882,26 +16882,26 @@ HttpRule.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.selector != null && message.hasOwnProperty("selector")) + if (message.selector != null && Object.hasOwnProperty.call(message, "selector")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.selector); - if (message.get != null && message.hasOwnProperty("get")) + if (message.get != null && Object.hasOwnProperty.call(message, "get")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.get); - if (message.put != null && message.hasOwnProperty("put")) + if (message.put != null && Object.hasOwnProperty.call(message, "put")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.put); - if (message.post != null && message.hasOwnProperty("post")) + if (message.post != null && Object.hasOwnProperty.call(message, "post")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.post); - if (message["delete"] != null && message.hasOwnProperty("delete")) + if (message["delete"] != null && Object.hasOwnProperty.call(message, "delete")) writer.uint32(/* id 5, wireType 2 =*/42).string(message["delete"]); - if (message.patch != null && message.hasOwnProperty("patch")) + if (message.patch != null && Object.hasOwnProperty.call(message, "patch")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.patch); - if (message.body != null && message.hasOwnProperty("body")) + if (message.body != null && Object.hasOwnProperty.call(message, "body")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.body); - if (message.custom != null && message.hasOwnProperty("custom")) + 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 && message.hasOwnProperty("responseBody")) + if (message.responseBody != null && Object.hasOwnProperty.call(message, "responseBody")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.responseBody); return writer; }; @@ -17258,9 +17258,9 @@ CustomHttpPattern.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && message.hasOwnProperty("kind")) + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.kind); - if (message.path != null && message.hasOwnProperty("path")) + if (message.path != null && Object.hasOwnProperty.call(message, "path")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.path); return writer; }; @@ -17505,18 +17505,18 @@ ResourceDescriptor.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) + 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 && message.hasOwnProperty("nameField")) + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && message.hasOwnProperty("history")) + if (message.history != null && Object.hasOwnProperty.call(message, "history")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && message.hasOwnProperty("plural")) + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && message.hasOwnProperty("singular")) + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); return writer; }; @@ -17736,7 +17736,7 @@ /** * History enum. * @name google.api.ResourceDescriptor.History - * @enum {string} + * @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 @@ -17817,9 +17817,9 @@ ResourceReference.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.childType != null && message.hasOwnProperty("childType")) + if (message.childType != null && Object.hasOwnProperty.call(message, "childType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.childType); return writer; }; @@ -18344,9 +18344,9 @@ FileDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && message.hasOwnProperty("package")) + 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) @@ -18363,9 +18363,9 @@ 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 && message.hasOwnProperty("options")) + 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 && message.hasOwnProperty("sourceCodeInfo")) + 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) @@ -18373,7 +18373,7 @@ 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 && message.hasOwnProperty("syntax")) + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); return writer; }; @@ -18911,7 +18911,7 @@ DescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + 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) @@ -18928,7 +18928,7 @@ 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 && message.hasOwnProperty("options")) + 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) @@ -19393,11 +19393,11 @@ ExtensionRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && message.hasOwnProperty("options")) + 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; }; @@ -19621,9 +19621,9 @@ ReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -20114,25 +20114,25 @@ FieldDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && message.hasOwnProperty("extendee")) + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && message.hasOwnProperty("label")) + if (message.label != null && Object.hasOwnProperty.call(message, "label")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && message.hasOwnProperty("type")) + if (message.type != null && Object.hasOwnProperty.call(message, "type")) writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && message.hasOwnProperty("typeName")) + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && message.hasOwnProperty("options")) + 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 && message.hasOwnProperty("oneofIndex")) + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); return writer; }; @@ -20479,7 +20479,7 @@ /** * Type enum. * @name google.protobuf.FieldDescriptorProto.Type - * @enum {string} + * @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 @@ -20525,7 +20525,7 @@ /** * Label enum. * @name google.protobuf.FieldDescriptorProto.Label - * @enum {string} + * @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 @@ -20606,9 +20606,9 @@ OneofDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && message.hasOwnProperty("options")) + 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; }; @@ -20851,12 +20851,12 @@ EnumDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + 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 && message.hasOwnProperty("options")) + 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) @@ -21159,9 +21159,9 @@ EnumReservedRange.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.start != null && message.hasOwnProperty("start")) + if (message.start != null && Object.hasOwnProperty.call(message, "start")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); return writer; }; @@ -21381,11 +21381,11 @@ EnumValueDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && message.hasOwnProperty("number")) + if (message.number != null && Object.hasOwnProperty.call(message, "number")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && message.hasOwnProperty("options")) + 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; }; @@ -21619,12 +21619,12 @@ ServiceDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + 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 && message.hasOwnProperty("options")) + 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; }; @@ -21904,17 +21904,17 @@ MethodDescriptorProto.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && message.hasOwnProperty("inputType")) + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && message.hasOwnProperty("outputType")) + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && message.hasOwnProperty("options")) + 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 && message.hasOwnProperty("clientStreaming")) + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); return writer; }; @@ -22353,45 +22353,45 @@ FileOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + 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) @@ -22818,7 +22818,7 @@ /** * OptimizeMode enum. * @name google.protobuf.FileOptions.OptimizeMode - * @enum {string} + * @enum {number} * @property {number} SPEED=1 SPEED value * @property {number} CODE_SIZE=2 CODE_SIZE value * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value @@ -22936,18 +22936,18 @@ MessageOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + 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 && message.hasOwnProperty(".google.api.resource")) + 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; }; @@ -23289,17 +23289,17 @@ FieldOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.ctype != null && message.hasOwnProperty("ctype")) + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && message.hasOwnProperty("packed")) + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && message.hasOwnProperty("lazy")) + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && message.hasOwnProperty("jstype")) + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && message.hasOwnProperty("weak")) + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) @@ -23310,7 +23310,7 @@ writer.int32(message[".google.api.fieldBehavior"][i]); writer.ldelim(); } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + 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; }; @@ -23646,7 +23646,7 @@ /** * CType enum. * @name google.protobuf.FieldOptions.CType - * @enum {string} + * @enum {number} * @property {number} STRING=0 STRING value * @property {number} CORD=1 CORD value * @property {number} STRING_PIECE=2 STRING_PIECE value @@ -23662,7 +23662,7 @@ /** * JSType enum. * @name google.protobuf.FieldOptions.JSType - * @enum {string} + * @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 @@ -23961,9 +23961,9 @@ EnumOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + 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) @@ -24206,7 +24206,7 @@ EnumValueOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + 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) @@ -24455,14 +24455,14 @@ ServiceOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + 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 && message.hasOwnProperty(".google.api.defaultHost")) + 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 && message.hasOwnProperty(".google.api.oauthScopes")) + 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; }; @@ -24750,19 +24750,19 @@ MethodOptions.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + 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 && message.hasOwnProperty(".google.longrunning.operationInfo")) + 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 && message.hasOwnProperty(".google.api.http")) + 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; }; @@ -25012,7 +25012,7 @@ /** * IdempotencyLevel enum. * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {string} + * @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 @@ -25142,17 +25142,17 @@ 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 && message.hasOwnProperty("identifierValue")) + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); return writer; }; @@ -25929,9 +25929,9 @@ writer.int32(message.span[i]); writer.ldelim(); } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + 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) @@ -26462,11 +26462,11 @@ writer.int32(message.path[i]); writer.ldelim(); } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && message.hasOwnProperty("begin")) + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && message.hasOwnProperty("end")) + if (message.end != null && Object.hasOwnProperty.call(message, "end")) writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); return writer; }; @@ -26719,9 +26719,9 @@ Duration.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && message.hasOwnProperty("seconds")) + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("nanos")) + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; @@ -26943,9 +26943,9 @@ Timestamp.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.seconds != null && message.hasOwnProperty("seconds")) + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); - if (message.nanos != null && message.hasOwnProperty("nanos")) + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; @@ -27370,9 +27370,9 @@ Any.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type_url != null && message.hasOwnProperty("type_url")) + 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 && message.hasOwnProperty("value")) + if (message.value != null && Object.hasOwnProperty.call(message, "value")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); return writer; }; @@ -28002,15 +28002,15 @@ Operation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.metadata != null && message.hasOwnProperty("metadata")) + 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 && message.hasOwnProperty("done")) + if (message.done != null && Object.hasOwnProperty.call(message, "done")) writer.uint32(/* id 3, wireType 0 =*/24).bool(message.done); - if (message.error != null && message.hasOwnProperty("error")) + 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 && message.hasOwnProperty("response")) + 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; }; @@ -28270,7 +28270,7 @@ GetOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -28484,13 +28484,13 @@ ListOperationsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.filter != null && message.hasOwnProperty("filter")) + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.filter); - if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 4, wireType 2 =*/34).string(message.name); return writer; }; @@ -28724,7 +28724,7 @@ 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 && message.hasOwnProperty("nextPageToken")) + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; @@ -28942,7 +28942,7 @@ CancelOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -29129,7 +29129,7 @@ DeleteOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; @@ -29325,9 +29325,9 @@ WaitOperationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && message.hasOwnProperty("name")) + if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.timeout != null && message.hasOwnProperty("timeout")) + 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; }; @@ -29540,9 +29540,9 @@ OperationInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.responseType != null && message.hasOwnProperty("responseType")) + if (message.responseType != null && Object.hasOwnProperty.call(message, "responseType")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseType); - if (message.metadataType != null && message.hasOwnProperty("metadataType")) + if (message.metadataType != null && Object.hasOwnProperty.call(message, "metadataType")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.metadataType); return writer; }; @@ -29772,9 +29772,9 @@ Status.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.code != null && message.hasOwnProperty("code")) + if (message.code != null && Object.hasOwnProperty.call(message, "code")) writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); - if (message.message != null && message.hasOwnProperty("message")) + 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) 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 index 94a3c009259..ec1487ebe9c 100644 --- 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 @@ -23,9 +23,13 @@ import { Descriptors, ClientOptions, LROperation, + PaginationCallback, + GaxCall, } from 'google-gax'; import * as path from 'path'; +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import * as gapicConfig from './game_server_clusters_service_client_config.json'; @@ -174,6 +178,17 @@ export class GameServerClustersServiceClient { ), }; + // 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' + ), + }; + // 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. @@ -373,102 +388,6 @@ export class GameServerClustersServiceClient { // ------------------- // -- Service calls -- // ------------------- - listGameServerClusters( - request: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.gaming.v1beta.IListGameServerClustersResponse, - ( - | protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest - | undefined - ), - {} | undefined - ] - >; - listGameServerClusters( - request: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.gaming.v1beta.IListGameServerClustersResponse, - | protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest - | null - | undefined, - {} | null | undefined - > - ): void; - listGameServerClusters( - request: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, - callback: Callback< - protos.google.cloud.gaming.v1beta.IListGameServerClustersResponse, - | protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Lists Game Server Clusters in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ListGameServerClustersResponse]{@link google.cloud.gaming.v1beta.ListGameServerClustersResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - listGameServerClusters( - request: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.cloud.gaming.v1beta.IListGameServerClustersResponse, - | protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.gaming.v1beta.IListGameServerClustersResponse, - | protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.gaming.v1beta.IListGameServerClustersResponse, - ( - | protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest - | undefined - ), - {} | undefined - ] - > | void { - request = request || {}; - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listGameServerClusters( - request, - options, - callback - ); - } getGameServerCluster( request: protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, options?: gax.CallOptions @@ -508,6 +427,10 @@ export class GameServerClustersServiceClient { * * @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. @@ -601,6 +524,15 @@ export class GameServerClustersServiceClient { * * @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. @@ -697,6 +629,11 @@ export class GameServerClustersServiceClient { * * @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. @@ -793,6 +730,18 @@ export class GameServerClustersServiceClient { * * @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. @@ -892,6 +841,13 @@ export class GameServerClustersServiceClient { * * @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. @@ -992,6 +948,9 @@ export class GameServerClustersServiceClient { * * @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. @@ -1092,6 +1051,16 @@ export class GameServerClustersServiceClient { * * @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. @@ -1151,6 +1120,233 @@ export class GameServerClustersServiceClient { callback ); } + listGameServerClusters( + request: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + options?: gax.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: gax.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; + /** + * 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, 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.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 support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [GameServerCluster]{@link google.cloud.gaming.v1beta.GameServerCluster} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListGameServerClustersRequest]{@link google.cloud.gaming.v1beta.ListGameServerClustersRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListGameServerClustersResponse]{@link google.cloud.gaming.v1beta.ListGameServerClustersResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listGameServerClusters( + request: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listGameServerClusters( + request, + options, + callback + ); + } + + /** + * Equivalent to {@link listGameServerClusters}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listGameServerClusters} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @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, 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.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. + */ + listGameServerClustersStream( + request?: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listGameServerClusters.createStream( + this.innerApiCalls.listGameServerClusters as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to {@link listGameServerClusters}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.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, 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.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 conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listGameServerClustersAsync( + request?: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listGameServerClusters.asyncIterate( + this.innerApiCalls['listGameServerClusters'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } // -------------------- // -- Path templates -- // -------------------- 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 index a15f97ab699..b0c7e612982 100644 --- 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 @@ -23,9 +23,13 @@ import { Descriptors, ClientOptions, LROperation, + PaginationCallback, + GaxCall, } from 'google-gax'; import * as path from 'path'; +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import * as gapicConfig from './game_server_configs_service_client_config.json'; @@ -173,6 +177,17 @@ export class GameServerConfigsServiceClient { ), }; + // 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' + ), + }; + // 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. @@ -353,99 +368,6 @@ export class GameServerConfigsServiceClient { // ------------------- // -- Service calls -- // ------------------- - listGameServerConfigs( - request: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.gaming.v1beta.IListGameServerConfigsResponse, - ( - | protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest - | undefined - ), - {} | undefined - ] - >; - listGameServerConfigs( - request: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.gaming.v1beta.IListGameServerConfigsResponse, - | protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest - | null - | undefined, - {} | null | undefined - > - ): void; - listGameServerConfigs( - request: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, - callback: Callback< - protos.google.cloud.gaming.v1beta.IListGameServerConfigsResponse, - | protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Lists Game Server Configs in a given project, Location, and Game Server - * Deployment. - * - * @param {Object} request - * The request object that will be sent. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ListGameServerConfigsResponse]{@link google.cloud.gaming.v1beta.ListGameServerConfigsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - listGameServerConfigs( - request: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.cloud.gaming.v1beta.IListGameServerConfigsResponse, - | protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.gaming.v1beta.IListGameServerConfigsResponse, - | protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.gaming.v1beta.IListGameServerConfigsResponse, - ( - | protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest - | undefined - ), - {} | undefined - ] - > | void { - request = request || {}; - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listGameServerConfigs(request, options, callback); - } getGameServerConfig( request: protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, options?: gax.CallOptions @@ -482,6 +404,10 @@ export class GameServerConfigsServiceClient { * * @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. @@ -576,6 +502,14 @@ export class GameServerConfigsServiceClient { * * @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. @@ -677,6 +611,10 @@ export class GameServerConfigsServiceClient { * * @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. @@ -736,6 +674,233 @@ export class GameServerConfigsServiceClient { callback ); } + listGameServerConfigs( + request: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + options?: gax.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: gax.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; + /** + * 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 support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [GameServerConfig]{@link google.cloud.gaming.v1beta.GameServerConfig} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListGameServerConfigsRequest]{@link google.cloud.gaming.v1beta.ListGameServerConfigsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListGameServerConfigsResponse]{@link google.cloud.gaming.v1beta.ListGameServerConfigsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listGameServerConfigs( + request: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listGameServerConfigs(request, options, callback); + } + + /** + * Equivalent to {@link listGameServerConfigs}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listGameServerConfigs} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @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. + */ + listGameServerConfigsStream( + request?: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listGameServerConfigs.createStream( + this.innerApiCalls.listGameServerConfigs as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to {@link listGameServerConfigs}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.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 conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listGameServerConfigsAsync( + request?: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listGameServerConfigs.asyncIterate( + this.innerApiCalls['listGameServerConfigs'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } // -------------------- // -- Path templates -- // -------------------- 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 index 8f0e5e35073..36c8bc66d2c 100644 --- 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 @@ -23,9 +23,13 @@ import { Descriptors, ClientOptions, LROperation, + PaginationCallback, + GaxCall, } from 'google-gax'; import * as path from 'path'; +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import * as gapicConfig from './game_server_deployments_service_client_config.json'; @@ -174,6 +178,17 @@ export class GameServerDeploymentsServiceClient { ), }; + // 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' + ), + }; + // 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. @@ -389,102 +404,6 @@ export class GameServerDeploymentsServiceClient { // ------------------- // -- Service calls -- // ------------------- - listGameServerDeployments( - request: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, - ( - | protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest - | undefined - ), - {} | undefined - ] - >; - listGameServerDeployments( - request: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, - | protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest - | null - | undefined, - {} | null | undefined - > - ): void; - listGameServerDeployments( - request: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, - callback: Callback< - protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, - | protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest - | null - | undefined, - {} | null | undefined - > - ): void; - /** - * Lists Game Server Deployments in a given project and Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ListGameServerDeploymentsResponse]{@link google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - listGameServerDeployments( - request: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, - | protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, - | protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest - | null - | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse, - ( - | protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest - | undefined - ), - {} | undefined - ] - > | void { - request = request || {}; - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listGameServerDeployments( - request, - options, - callback - ); - } getGameServerDeployment( request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, options?: gax.CallOptions @@ -524,6 +443,10 @@ export class GameServerDeploymentsServiceClient { * * @param {Object} request * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Game Server Deployment 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. @@ -620,6 +543,10 @@ export class GameServerDeploymentsServiceClient { * * @param {Object} request * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Game Server Deployment 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. @@ -717,6 +644,19 @@ export class GameServerDeploymentsServiceClient { * * @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. @@ -815,6 +755,10 @@ export class GameServerDeploymentsServiceClient { * * @param {Object} request * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Game Server Deployment. 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. @@ -910,6 +854,13 @@ export class GameServerDeploymentsServiceClient { * * @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 Deployment resource to be created. + * @param {google.cloud.gaming.v1beta.GameServerDeployment} request.gameServerDeployment + * Required. The Game Server Deployment 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. @@ -1010,6 +961,10 @@ export class GameServerDeploymentsServiceClient { * * @param {Object} request * The request object that will be sent. + * @param {string} request.name + * Required. The name of the Game Server Deployment 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. @@ -1110,6 +1065,16 @@ export class GameServerDeploymentsServiceClient { * * @param {Object} request * The request object that will be sent. + * @param {google.cloud.gaming.v1beta.GameServerDeployment} request.gameServerDeployment + * Required. The Game Server Deployment 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. @@ -1210,6 +1175,16 @@ export class GameServerDeploymentsServiceClient { * * @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 + * 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. @@ -1269,6 +1244,236 @@ export class GameServerDeploymentsServiceClient { callback ); } + listGameServerDeployments( + request: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + options?: gax.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: gax.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; + /** + * 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, 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.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 support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [GameServerDeployment]{@link google.cloud.gaming.v1beta.GameServerDeployment} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListGameServerDeploymentsRequest]{@link google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListGameServerDeploymentsResponse]{@link google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listGameServerDeployments( + request: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listGameServerDeployments( + request, + options, + callback + ); + } + + /** + * Equivalent to {@link listGameServerDeployments}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listGameServerDeployments} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @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.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. + */ + listGameServerDeploymentsStream( + request?: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listGameServerDeployments.createStream( + this.innerApiCalls.listGameServerDeployments as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to {@link listGameServerDeployments}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.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.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 conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listGameServerDeploymentsAsync( + request?: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listGameServerDeployments.asyncIterate( + this.innerApiCalls['listGameServerDeployments'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } // -------------------- // -- Path templates -- // -------------------- diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index 019117ca424..4f779d419d2 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -23,9 +23,13 @@ import { Descriptors, ClientOptions, LROperation, + PaginationCallback, + GaxCall, } from 'google-gax'; import * as path from 'path'; +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import * as gapicConfig from './realms_service_client_config.json'; @@ -172,6 +176,17 @@ export class RealmsServiceClient { ), }; + // 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' + ), + }; + // 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. @@ -356,86 +371,6 @@ export class RealmsServiceClient { // ------------------- // -- Service calls -- // ------------------- - listRealms( - request: protos.google.cloud.gaming.v1beta.IListRealmsRequest, - options?: gax.CallOptions - ): Promise< - [ - protos.google.cloud.gaming.v1beta.IListRealmsResponse, - protos.google.cloud.gaming.v1beta.IListRealmsRequest | undefined, - {} | undefined - ] - >; - listRealms( - request: protos.google.cloud.gaming.v1beta.IListRealmsRequest, - options: gax.CallOptions, - callback: Callback< - protos.google.cloud.gaming.v1beta.IListRealmsResponse, - protos.google.cloud.gaming.v1beta.IListRealmsRequest | null | undefined, - {} | null | undefined - > - ): void; - listRealms( - request: protos.google.cloud.gaming.v1beta.IListRealmsRequest, - callback: Callback< - protos.google.cloud.gaming.v1beta.IListRealmsResponse, - protos.google.cloud.gaming.v1beta.IListRealmsRequest | null | undefined, - {} | null | undefined - > - ): void; - /** - * Lists Realms in a given project and Location. - * - * @param {Object} request - * The request object that will be sent. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ListRealmsResponse]{@link google.cloud.gaming.v1beta.ListRealmsResponse}. - * The promise has a method named "cancel" which cancels the ongoing API call. - */ - listRealms( - request: protos.google.cloud.gaming.v1beta.IListRealmsRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.cloud.gaming.v1beta.IListRealmsResponse, - | protos.google.cloud.gaming.v1beta.IListRealmsRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - protos.google.cloud.gaming.v1beta.IListRealmsResponse, - protos.google.cloud.gaming.v1beta.IListRealmsRequest | null | undefined, - {} | null | undefined - > - ): Promise< - [ - protos.google.cloud.gaming.v1beta.IListRealmsResponse, - protos.google.cloud.gaming.v1beta.IListRealmsRequest | undefined, - {} | undefined - ] - > | void { - request = request || {}; - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listRealms(request, options, callback); - } getRealm( request: protos.google.cloud.gaming.v1beta.IGetRealmRequest, options?: gax.CallOptions @@ -468,6 +403,9 @@ export class RealmsServiceClient { * * @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. @@ -550,6 +488,18 @@ export class RealmsServiceClient { * * @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. @@ -642,6 +592,13 @@ export class RealmsServiceClient { * * @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. @@ -738,6 +695,9 @@ export class RealmsServiceClient { * * @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. @@ -834,6 +794,16 @@ export class RealmsServiceClient { * * @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. @@ -889,6 +859,226 @@ export class RealmsServiceClient { this.initialize(); return this.innerApiCalls.updateRealm(request, options, callback); } + listRealms( + request: protos.google.cloud.gaming.v1beta.IListRealmsRequest, + options?: gax.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: gax.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; + /** + * 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 support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Realm]{@link google.cloud.gaming.v1beta.Realm} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListRealmsRequest]{@link google.cloud.gaming.v1beta.ListRealmsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListRealmsResponse]{@link google.cloud.gaming.v1beta.ListRealmsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listRealms( + request: protos.google.cloud.gaming.v1beta.IListRealmsRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listRealms(request, options, callback); + } + + /** + * Equivalent to {@link listRealms}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listRealms} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @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. + */ + listRealmsStream( + request?: protos.google.cloud.gaming.v1beta.IListRealmsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listRealms.createStream( + this.innerApiCalls.listRealms as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to {@link listRealms}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.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 conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listRealmsAsync( + request?: protos.google.cloud.gaming.v1beta.IListRealmsRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listRealms.asyncIterate( + this.innerApiCalls['listRealms'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } // -------------------- // -- Path templates -- // -------------------- diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index af4f3cf9343..95c895c5c6b 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,22 +4,22 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "c75bb2de6ef48c26d5d90892a906b45dcf91755c" + "sha": "3a212f3ec74f063938d7556beeedf4ff4f329486" } }, { "git": { "name": "googleapis-private", "remote": "https://github.com/googleapis/googleapis-private.git", - "sha": "ddac0ff9513bd89b53aa6895c65a7c3272626583", - "internalRef": "304945322" + "sha": "b0a4e5484d8df4a183664fcb1894921401893242", + "internalRef": "306746093" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "6f32150677c9784f3c3a7e1949472bd29c9d72c5" + "sha": "19465d3ec5e5acdb01521d8f3bddd311bcbee28d" } } ], diff --git a/packages/google-cloud-gaming/system-test/install.ts b/packages/google-cloud-gaming/system-test/install.ts index c4d80e9c0c8..4c1ba3eb79a 100644 --- a/packages/google-cloud-gaming/system-test/install.ts +++ b/packages/google-cloud-gaming/system-test/install.ts @@ -21,7 +21,7 @@ import {readFileSync} from 'fs'; import {describe, it} from 'mocha'; describe('typescript consumer tests', () => { - it('should have correct type signature for typescript users', async function() { + it('should have correct type signature for typescript users', async function () { this.timeout(300000); const options = { packageDir: process.cwd(), // path to your module. @@ -35,7 +35,7 @@ describe('typescript consumer tests', () => { await packNTest(options); // will throw upon error. }); - it('should have correct type signature for javascript users', async function() { + it('should have correct type signature for javascript users', async function () { this.timeout(300000); const options = { packageDir: process.cwd(), // path to your module. 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 index 94680700b05..c9a3a0c6232 100644 --- 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 @@ -23,6 +23,8 @@ import {SinonStub} from 'sinon'; import {describe, it} from 'mocha'; import * as gameserverclustersserviceModule from '../src'; +import {PassThrough} from 'stream'; + import {protobuf, LROperation} from 'google-gax'; function generateSampleMessage(instance: T) { @@ -82,6 +84,67 @@ function stubLongRunningCallWithCallback( : 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', () => { it('has servicePath', () => { const servicePath = @@ -179,128 +242,6 @@ describe('v1beta.GameServerClustersServiceClient', () => { assert.strictEqual(result, fakeProjectId); }); - 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() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.gaming.v1beta.ListGameServerClustersResponse() - ); - client.innerApiCalls.listGameServerClusters = stubSimpleCall( - expectedResponse - ); - const [response] = await client.listGameServerClusters(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGameServerClusters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - 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() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.gaming.v1beta.ListGameServerClustersResponse() - ); - client.innerApiCalls.listGameServerClusters = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.listGameServerClusters( - request, - ( - err?: Error | null, - result?: protos.google.cloud.gaming.v1beta.IListGameServerClustersResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGameServerClusters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); - - 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() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listGameServerClusters = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.listGameServerClusters(request); - }, expectedError); - assert( - (client.innerApiCalls.listGameServerClusters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - }); - describe('getGameServerCluster', () => { it('invokes getGameServerCluster without error', async () => { const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( @@ -1297,6 +1238,344 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); }); + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.listGameServerClusters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.listGameServerClusters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listGameServerClusters = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.listGameServerClusters(request); + }, expectedError); + assert( + (client.innerApiCalls.listGameServerClusters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listGameServerClusters + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listGameServerClusters + .createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listGameServerClusters, request) + ); + assert.strictEqual( + (client.descriptors.page.listGameServerClusters + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listGameServerClusters + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listGameServerClusters + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + describe('Path templates', () => { describe('gameServerCluster', () => { const fakePath = '/rendered/path/gameServerCluster'; 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 index 11b4f7ab0bc..603859db9de 100644 --- 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 @@ -23,6 +23,8 @@ import {SinonStub} from 'sinon'; import {describe, it} from 'mocha'; import * as gameserverconfigsserviceModule from '../src'; +import {PassThrough} from 'stream'; + import {protobuf, LROperation} from 'google-gax'; function generateSampleMessage(instance: T) { @@ -82,6 +84,67 @@ function stubLongRunningCallWithCallback( : 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', () => { it('has servicePath', () => { const servicePath = @@ -178,128 +241,6 @@ describe('v1beta.GameServerConfigsServiceClient', () => { assert.strictEqual(result, fakeProjectId); }); - 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() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.gaming.v1beta.ListGameServerConfigsResponse() - ); - client.innerApiCalls.listGameServerConfigs = stubSimpleCall( - expectedResponse - ); - const [response] = await client.listGameServerConfigs(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGameServerConfigs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - 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() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.gaming.v1beta.ListGameServerConfigsResponse() - ); - client.innerApiCalls.listGameServerConfigs = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.listGameServerConfigs( - request, - ( - err?: Error | null, - result?: protos.google.cloud.gaming.v1beta.IListGameServerConfigsResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGameServerConfigs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); - - 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() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listGameServerConfigs = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.listGameServerConfigs(request); - }, expectedError); - assert( - (client.innerApiCalls.listGameServerConfigs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - }); - describe('getGameServerConfig', () => { it('invokes getGameServerConfig without error', async () => { const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( @@ -756,6 +697,344 @@ describe('v1beta.GameServerConfigsServiceClient', () => { }); }); + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.listGameServerConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.listGameServerConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listGameServerConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.listGameServerConfigs(request); + }, expectedError); + assert( + (client.innerApiCalls.listGameServerConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listGameServerConfigs + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listGameServerConfigs + .createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listGameServerConfigs, request) + ); + assert.strictEqual( + (client.descriptors.page.listGameServerConfigs + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listGameServerConfigs + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listGameServerConfigs + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + describe('Path templates', () => { describe('gameServerCluster', () => { const fakePath = '/rendered/path/gameServerCluster'; 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 index 37ddc46fae8..0edc89819a9 100644 --- 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 @@ -23,6 +23,8 @@ import {SinonStub} from 'sinon'; import {describe, it} from 'mocha'; import * as gameserverdeploymentsserviceModule from '../src'; +import {PassThrough} from 'stream'; + import {protobuf, LROperation} from 'google-gax'; function generateSampleMessage(instance: T) { @@ -82,6 +84,67 @@ function stubLongRunningCallWithCallback( : 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', () => { it('has servicePath', () => { const servicePath = @@ -179,128 +242,6 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { assert.strictEqual(result, fakeProjectId); }); - 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() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse() - ); - client.innerApiCalls.listGameServerDeployments = stubSimpleCall( - expectedResponse - ); - const [response] = await client.listGameServerDeployments(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGameServerDeployments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - 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() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse() - ); - client.innerApiCalls.listGameServerDeployments = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.listGameServerDeployments( - request, - ( - err?: Error | null, - result?: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGameServerDeployments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); - - 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() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listGameServerDeployments = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.listGameServerDeployments(request); - }, expectedError); - assert( - (client.innerApiCalls.listGameServerDeployments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - }); - describe('getGameServerDeployment', () => { it('invokes getGameServerDeployment without error', async () => { const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( @@ -1474,6 +1415,348 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); }); + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.listGameServerDeployments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.listGameServerDeployments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listGameServerDeployments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.listGameServerDeployments(request); + }, expectedError); + assert( + (client.innerApiCalls.listGameServerDeployments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listGameServerDeployments + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listGameServerDeployments + .createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listGameServerDeployments, request) + ); + assert.strictEqual( + (client.descriptors.page.listGameServerDeployments + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listGameServerDeployments + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listGameServerDeployments + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + describe('Path templates', () => { describe('gameServerCluster', () => { const fakePath = '/rendered/path/gameServerCluster'; diff --git a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts index 0db9de80f93..cbe9b35b5e4 100644 --- a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts @@ -23,6 +23,8 @@ import {SinonStub} from 'sinon'; import {describe, it} from 'mocha'; import * as realmsserviceModule from '../src'; +import {PassThrough} from 'stream'; + import {protobuf, LROperation} from 'google-gax'; function generateSampleMessage(instance: T) { @@ -82,6 +84,67 @@ function stubLongRunningCallWithCallback( : 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', () => { it('has servicePath', () => { const servicePath = @@ -165,120 +228,6 @@ describe('v1beta.RealmsServiceClient', () => { assert.strictEqual(result, fakeProjectId); }); - 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() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.gaming.v1beta.ListRealmsResponse() - ); - client.innerApiCalls.listRealms = stubSimpleCall(expectedResponse); - const [response] = await client.listRealms(request); - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listRealms as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - - 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() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.gaming.v1beta.ListRealmsResponse() - ); - client.innerApiCalls.listRealms = stubSimpleCallWithCallback( - expectedResponse - ); - const promise = new Promise((resolve, reject) => { - client.listRealms( - request, - ( - err?: Error | null, - result?: protos.google.cloud.gaming.v1beta.IListRealmsResponse | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - } - ); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listRealms as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); - }); - - 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() - ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listRealms = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(async () => { - await client.listRealms(request); - }, expectedError); - assert( - (client.innerApiCalls.listRealms as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); - }); - }); - describe('getRealm', () => { it('invokes getRealm without error', async () => { const client = new realmsserviceModule.v1beta.RealmsServiceClient({ @@ -984,6 +933,298 @@ describe('v1beta.RealmsServiceClient', () => { }); }); + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.listRealms as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.listRealms as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listRealms = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.listRealms(request); + }, expectedError); + assert( + (client.innerApiCalls.listRealms as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listRealms.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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(async () => { + await promise; + }, expectedError); + assert( + (client.descriptors.page.listRealms.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRealms, request) + ); + assert.strictEqual( + (client.descriptors.page.listRealms.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listRealms.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listRealms.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + describe('Path templates', () => { describe('gameServerCluster', () => { const fakePath = '/rendered/path/gameServerCluster'; From b87f31c574cfd96d6414e32b0c0cb0905d5367ed Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 1 May 2020 06:54:18 +0200 Subject: [PATCH 035/180] chore(deps): update dependency uuid to v8 (#63) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [uuid](https://togithub.com/uuidjs/uuid) | devDependencies | major | [`^7.0.1` -> `^8.0.0`](https://renovatebot.com/diffs/npm/uuid/7.0.3/8.0.0) | --- ### Release Notes
uuidjs/uuid ### [`v8.0.0`](https://togithub.com/uuidjs/uuid/blob/master/CHANGELOG.md#​800-httpsgithubcomuuidjsuuidcomparev703v800-2020-04-29) [Compare Source](https://togithub.com/uuidjs/uuid/compare/v7.0.3...v8.0.0) ##### ⚠ BREAKING CHANGES - For native ECMAScript Module (ESM) usage in Node.js only named exports are exposed, there is no more default export. ```diff -import uuid from 'uuid'; -console.log(uuid.v4()); // -> 'cd6c3b08-0adc-4f4b-a6ef-36087a1c9869' +import { v4 as uuidv4 } from 'uuid'; +uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' ``` - Deep requiring specific algorithms of this library like `require('uuid/v4')`, which has been deprecated in `uuid@7`, is no longer supported. Instead use the named exports that this module exports. For ECMAScript Modules (ESM): ```diff -import uuidv4 from 'uuid/v4'; +import { v4 as uuidv4 } from 'uuid'; uuidv4(); ``` For CommonJS: ```diff -const uuidv4 = require('uuid/v4'); +const { v4: uuidv4 } = require('uuid'); uuidv4(); ``` ##### Features - native Node.js ES Modules (wrapper approach) ([#​423](https://togithub.com/uuidjs/uuid/issues/423)) ([2d9f590](https://togithub.com/uuidjs/uuid/commit/2d9f590ad9701d692625c07ed62f0a0f91227991)), closes [#​245](https://togithub.com/uuidjs/uuid/issues/245) [#​419](https://togithub.com/uuidjs/uuid/issues/419) [#​342](https://togithub.com/uuidjs/uuid/issues/342) - remove deep requires ([#​426](https://togithub.com/uuidjs/uuid/issues/426)) ([daf72b8](https://togithub.com/uuidjs/uuid/commit/daf72b84ceb20272a81bb5fbddb05dd95922cbba)) ##### Bug Fixes - add CommonJS syntax example to README quickstart section ([#​417](https://togithub.com/uuidjs/uuid/issues/417)) ([e0ec840](https://togithub.com/uuidjs/uuid/commit/e0ec8402c7ad44b7ef0453036c612f5db513fda0)) ##### [7.0.3](https://togithub.com/uuidjs/uuid/compare/v7.0.2...v7.0.3) (2020-03-31) ##### Bug Fixes - make deep require deprecation warning work in browsers ([#​409](https://togithub.com/uuidjs/uuid/issues/409)) ([4b71107](https://togithub.com/uuidjs/uuid/commit/4b71107d8c0d2ef56861ede6403fc9dc35a1e6bf)), closes [#​408](https://togithub.com/uuidjs/uuid/issues/408) ##### [7.0.2](https://togithub.com/uuidjs/uuid/compare/v7.0.1...v7.0.2) (2020-03-04) ##### Bug Fixes - make access to msCrypto consistent ([#​393](https://togithub.com/uuidjs/uuid/issues/393)) ([8bf2a20](https://togithub.com/uuidjs/uuid/commit/8bf2a20f3565df743da7215eebdbada9d2df118c)) - simplify link in deprecation warning ([#​391](https://togithub.com/uuidjs/uuid/issues/391)) ([bb2c8e4](https://togithub.com/uuidjs/uuid/commit/bb2c8e4e9f4c5f9c1eaaf3ea59710c633cd90cb7)) - update links to match content in readme ([#​386](https://togithub.com/uuidjs/uuid/issues/386)) ([44f2f86](https://togithub.com/uuidjs/uuid/commit/44f2f86e9d2bbf14ee5f0f00f72a3db1292666d4)) ##### [7.0.1](https://togithub.com/uuidjs/uuid/compare/v7.0.0...v7.0.1) (2020-02-25) ##### Bug Fixes - clean up esm builds for node and browser ([#​383](https://togithub.com/uuidjs/uuid/issues/383)) ([59e6a49](https://togithub.com/uuidjs/uuid/commit/59e6a49e7ce7b3e8fb0f3ee52b9daae72af467dc)) - provide browser versions independent from module system ([#​380](https://togithub.com/uuidjs/uuid/issues/380)) ([4344a22](https://togithub.com/uuidjs/uuid/commit/4344a22e7aed33be8627eeaaf05360f256a21753)), closes [#​378](https://togithub.com/uuidjs/uuid/issues/378)
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index b738ce91b0d..4743b60f84f 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -19,6 +19,6 @@ "c8": "^7.0.0", "chai": "^4.2.0", "mocha": "^7.0.0", - "uuid": "^7.0.1" + "uuid": "^8.0.0" } } From d7adfc765edd544fe87614dbfa4de975b731089a Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 5 May 2020 17:26:49 -0700 Subject: [PATCH 036/180] chore: update npm scripts and synth.py (#60) Update npm scripts: add clean, prelint, prefix; make sure that lint and fix are set properly. Use post-process feature of synthtool. Co-authored-by: Justin Beckwith --- packages/google-cloud-gaming/package.json | 5 +++-- packages/google-cloud-gaming/synth.py | 7 ++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index fa72ddc8715..6b4a688b64d 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -17,13 +17,14 @@ "docs": "jsdoc -c .jsdoc.js", "docs-test": "linkinator docs", "fix": "gts fix", - "lint": "gts fix", + "lint": "gts check", "predocs-test": "npm run docs", "prepare": "npm run compile-protos && npm run compile", "system-test": "c8 mocha build/system-test", "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "test": "c8 mocha build/test", - "prelint": "cd samples; npm link ../; npm install" + "prelint": "cd samples; npm link ../; npm install", + "precompile": "gts clean" }, "dependencies": { "google-gax": "^2.1.0" diff --git a/packages/google-cloud-gaming/synth.py b/packages/google-cloud-gaming/synth.py index df8f9a9f7e5..8ef89f941dd 100644 --- a/packages/google-cloud-gaming/synth.py +++ b/packages/google-cloud-gaming/synth.py @@ -14,7 +14,7 @@ """This script is used to synthesize generated parts of this library.""" import synthtool as s import synthtool.gcp as gcp -import subprocess +import synthtool.languages.node as node import logging logging.basicConfig(level=logging.DEBUG) @@ -37,7 +37,4 @@ common_templates = gcp.CommonTemplates() templates = common_templates.node_library(source_location='build/src') s.copy(templates, excludes=[]) -# Node.js specific cleanup -subprocess.run(['npm', 'install']) -subprocess.run(['npm', 'run', 'fix']) -subprocess.run(['npx', 'compileProtos', 'src']) +node.postprocess_gapic_library() From 9ecfcb516c93e4f1b09a5cc8f3f2ba6d0ba68fea Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Tue, 5 May 2020 18:35:09 -0700 Subject: [PATCH 037/180] feat: check status of long running operation by its name (#65) For each client method returning a long running operation, a separate method to check its status is added. Added methods: `checkCreateGameServerClusterProgress`, `checkCreateGameServerConfigProgress`, `checkCreateGameServerDeploymentProgress`, `checkCreateRealmProgress`, `checkDeleteGameServerClusterProgress`, `checkDeleteGameServerConfigProgress`, `checkDeleteGameServerDeploymentProgress`, `checkDeleteRealmProgress`, `checkUpdateGameServerClusterProgress`, `checkUpdateGameServerDeploymentProgress`, `checkUpdateGameServerDeploymentRolloutProgress`, `checkUpdateRealmProgress`. --- packages/google-cloud-gaming/README.md | 4 + .../google/cloud/gaming/v1beta/common.proto | 3 +- .../gaming/v1beta/game_server_clusters.proto | 22 +- .../v1beta/game_server_clusters_service.proto | 4 +- .../gaming/v1beta/game_server_configs.proto | 8 +- .../v1beta/game_server_configs_service.proto | 4 +- .../v1beta/game_server_deployments.proto | 8 +- .../game_server_deployments_service.proto | 9 +- .../google/cloud/gaming/v1beta/realms.proto | 8 +- .../cloud/gaming/v1beta/realms_service.proto | 4 +- .../google-cloud-gaming/protos/protos.json | 22 +- .../google-cloud-gaming/samples/README.md | 72 +++++ .../game_server_clusters_service_client.ts | 110 +++++++- .../game_server_configs_service_client.ts | 74 ++++- .../game_server_deployments_service_client.ts | 151 +++++++++- .../src/v1beta/realms_service_client.ts | 110 +++++++- packages/google-cloud-gaming/synth.metadata | 14 +- ...pic_game_server_clusters_service_v1beta.ts | 206 +++++++++++--- ...apic_game_server_configs_service_v1beta.ts | 129 +++++++-- ..._game_server_deployments_service_v1beta.ts | 262 +++++++++++++++--- .../test/gapic_realms_service_v1beta.ts | 156 ++++++++--- 21 files changed, 1194 insertions(+), 186 deletions(-) diff --git a/packages/google-cloud-gaming/README.md b/packages/google-cloud-gaming/README.md index fccb71d1cf6..03400819ee6 100644 --- a/packages/google-cloud-gaming/README.md +++ b/packages/google-cloud-gaming/README.md @@ -99,9 +99,13 @@ has instructions for running the samples. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | +| Create_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_cluster.js,samples/README.md) | | Create_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_realm.js,samples/README.md) | +| Delete_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_cluster.js,samples/README.md) | | Delete_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_realm.js,samples/README.md) | +| Get_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_cluster.js,samples/README.md) | | Get_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_realm.js,samples/README.md) | +| List_clusters | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_clusters.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_clusters.js,samples/README.md) | | List_realms | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_realms.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_realms.js,samples/README.md) | | Create Game Server Realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | 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 index 1db6b77cfa4..027272cf309 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; 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 index 62ce7ef9cba..fd67a112b2c 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -25,6 +24,7 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListGameServerClustersRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerCluster" + child_type: "gameservices.googleapis.com/GameServerCluster" } ]; @@ -90,7 +90,7 @@ message CreateGameServerClusterRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerCluster" + child_type: "gameservices.googleapis.com/GameServerCluster" } ]; @@ -105,7 +105,12 @@ message CreateGameServerClusterRequest { message PreviewCreateGameServerClusterRequest { // Required. The parent resource name. Uses the form: // `projects/{project}/locations/{location}/realms/{realm}`. - string parent = 1 [(google.api.field_behavior) = REQUIRED]; + 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]; @@ -143,7 +148,12 @@ message DeleteGameServerClusterRequest { 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]; + 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]; 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 index 462e42dde47..2d81c438273 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -23,6 +22,7 @@ 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"; 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 index ac57c5c3a19..ea0820bd79d 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -24,6 +23,7 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListGameServerConfigsRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerConfig" + child_type: "gameservices.googleapis.com/GameServerConfig" } ]; @@ -91,7 +91,7 @@ message CreateGameServerConfigRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerConfig" + child_type: "gameservices.googleapis.com/GameServerConfig" } ]; 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 index 89dd582307a..29e886c50df 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -23,6 +22,7 @@ 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"; 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 index d0682520900..2e87e386c85 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -25,6 +24,7 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListGameServerDeploymentsRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerDeployment" + child_type: "gameservices.googleapis.com/GameServerDeployment" } ]; @@ -105,7 +105,7 @@ message CreateGameServerDeploymentRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerDeployment" + child_type: "gameservices.googleapis.com/GameServerDeployment" } ]; 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 index ccb0c5055f4..ccacfbacd5a 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -23,6 +22,7 @@ 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"; @@ -95,6 +95,11 @@ service GameServerDeploymentsService { } // 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" 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 index 38281aa6789..c1fa9982f2f 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -25,6 +24,7 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListRealmsRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/Realm" + child_type: "gameservices.googleapis.com/Realm" } ]; @@ -90,7 +90,7 @@ message CreateRealmRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/Realm" + child_type: "gameservices.googleapis.com/Realm" } ]; 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 index b7dfaa07cc3..4c87cac3d36 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -23,6 +22,7 @@ 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"; diff --git a/packages/google-cloud-gaming/protos/protos.json b/packages/google-cloud-gaming/protos/protos.json index bfc2265f969..81af95e0ff0 100644 --- a/packages/google-cloud-gaming/protos/protos.json +++ b/packages/google-cloud-gaming/protos/protos.json @@ -306,7 +306,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" } }, "pageSize": { @@ -376,7 +376,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" } }, "gameServerClusterId": { @@ -401,7 +401,8 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" } }, "gameServerClusterId": { @@ -457,7 +458,8 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" } }, "previewTime": { @@ -695,7 +697,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerConfig" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerConfig" } }, "pageSize": { @@ -765,7 +767,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerConfig" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerConfig" } }, "configId": { @@ -933,7 +935,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerDeployment" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerDeployment" } }, "pageSize": { @@ -1015,7 +1017,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerDeployment" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerDeployment" } }, "deploymentId": { @@ -1364,7 +1366,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/Realm" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/Realm" } }, "pageSize": { @@ -1434,7 +1436,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/Realm" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/Realm" } }, "realmId": { diff --git a/packages/google-cloud-gaming/samples/README.md b/packages/google-cloud-gaming/samples/README.md index ea7144fb660..f6806b8e41c 100644 --- a/packages/google-cloud-gaming/samples/README.md +++ b/packages/google-cloud-gaming/samples/README.md @@ -12,9 +12,13 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Create_cluster](#create_cluster) * [Create_realm](#create_realm) + * [Delete_cluster](#delete_cluster) * [Delete_realm](#delete_realm) + * [Get_cluster](#get_cluster) * [Get_realm](#get_realm) + * [List_clusters](#list_clusters) * [List_realms](#list_realms) * [Create Game Server Realm](#create-game-server-realm) @@ -33,6 +37,23 @@ Before running the samples, make sure you've followed the steps outlined in +### Create_cluster + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_cluster.js,samples/README.md) + +__Usage:__ + + +`node samples/create_cluster.js` + + +----- + + + + ### Create_realm View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_realm.js). @@ -50,6 +71,23 @@ __Usage:__ +### Delete_cluster + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_cluster.js,samples/README.md) + +__Usage:__ + + +`node samples/delete_cluster.js` + + +----- + + + + ### Delete_realm View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_realm.js). @@ -67,6 +105,23 @@ __Usage:__ +### Get_cluster + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_cluster.js,samples/README.md) + +__Usage:__ + + +`node samples/get_cluster.js` + + +----- + + + + ### Get_realm View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_realm.js). @@ -84,6 +139,23 @@ __Usage:__ +### List_clusters + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_clusters.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_clusters.js,samples/README.md) + +__Usage:__ + + +`node samples/list_clusters.js` + + +----- + + + + ### List_realms View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_realms.js). 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 index ec1487ebe9c..304cb65174f 100644 --- 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 @@ -32,7 +32,7 @@ import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import * as gapicConfig from './game_server_clusters_service_client_config.json'; - +import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -907,6 +907,42 @@ export class GameServerClustersServiceClient { callback ); } + /** + * Check the status of the long running operation returned by the createGameServerCluster() method. + * @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. + * + * @example: + * const decodedOperation = await checkCreateGameServerClusterProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkCreateGameServerClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1beta.GameServerCluster, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.createGameServerCluster, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1beta.GameServerCluster, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } deleteGameServerCluster( request: protos.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, options?: gax.CallOptions @@ -1010,6 +1046,42 @@ export class GameServerClustersServiceClient { callback ); } + /** + * Check the status of the long running operation returned by the deleteGameServerCluster() method. + * @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. + * + * @example: + * const decodedOperation = await checkDeleteGameServerClusterProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkDeleteGameServerClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1beta.GameServerCluster, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.deleteGameServerCluster, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1beta.GameServerCluster, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } updateGameServerCluster( request: protos.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, options?: gax.CallOptions @@ -1120,6 +1192,42 @@ export class GameServerClustersServiceClient { callback ); } + /** + * Check the status of the long running operation returned by the updateGameServerCluster() method. + * @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. + * + * @example: + * const decodedOperation = await checkUpdateGameServerClusterProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkUpdateGameServerClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1beta.GameServerCluster, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.updateGameServerCluster, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1beta.GameServerCluster, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } listGameServerClusters( request: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, options?: gax.CallOptions 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 index b0c7e612982..1f031f25610 100644 --- 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 @@ -32,7 +32,7 @@ import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import * as gapicConfig from './game_server_configs_service_client_config.json'; - +import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -569,6 +569,42 @@ export class GameServerConfigsServiceClient { callback ); } + /** + * Check the status of the long running operation returned by the createGameServerConfig() method. + * @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. + * + * @example: + * const decodedOperation = await checkCreateGameServerConfigProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkCreateGameServerConfigProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1beta.GameServerConfig, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.createGameServerConfig, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1beta.GameServerConfig, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } deleteGameServerConfig( request: protos.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, options?: gax.CallOptions @@ -674,6 +710,42 @@ export class GameServerConfigsServiceClient { callback ); } + /** + * Check the status of the long running operation returned by the deleteGameServerConfig() method. + * @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. + * + * @example: + * const decodedOperation = await checkDeleteGameServerConfigProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkDeleteGameServerConfigProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1beta.GameServerConfig, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.deleteGameServerConfig, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1beta.GameServerConfig, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } listGameServerConfigs( request: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, options?: gax.CallOptions 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 index 36c8bc66d2c..4e2d96a22a2 100644 --- 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 @@ -32,7 +32,7 @@ import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import * as gapicConfig from './game_server_deployments_service_client_config.json'; - +import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -920,6 +920,42 @@ export class GameServerDeploymentsServiceClient { callback ); } + /** + * Check the status of the long running operation returned by the createGameServerDeployment() method. + * @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. + * + * @example: + * const decodedOperation = await checkCreateGameServerDeploymentProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkCreateGameServerDeploymentProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1beta.GameServerDeployment, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.createGameServerDeployment, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1beta.GameServerDeployment, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } deleteGameServerDeployment( request: protos.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, options?: gax.CallOptions @@ -1024,6 +1060,42 @@ export class GameServerDeploymentsServiceClient { callback ); } + /** + * Check the status of the long running operation returned by the deleteGameServerDeployment() method. + * @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. + * + * @example: + * const decodedOperation = await checkDeleteGameServerDeploymentProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkDeleteGameServerDeploymentProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1beta.GameServerDeployment, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.deleteGameServerDeployment, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1beta.GameServerDeployment, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } updateGameServerDeployment( request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, options?: gax.CallOptions @@ -1134,6 +1206,42 @@ export class GameServerDeploymentsServiceClient { callback ); } + /** + * Check the status of the long running operation returned by the updateGameServerDeployment() method. + * @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. + * + * @example: + * const decodedOperation = await checkUpdateGameServerDeploymentProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkUpdateGameServerDeploymentProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1beta.GameServerDeployment, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.updateGameServerDeployment, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1beta.GameServerDeployment, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } updateGameServerDeploymentRollout( request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, options?: gax.CallOptions @@ -1172,6 +1280,11 @@ export class GameServerDeploymentsServiceClient { ): void; /** * 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. @@ -1244,6 +1357,42 @@ export class GameServerDeploymentsServiceClient { callback ); } + /** + * Check the status of the long running operation returned by the updateGameServerDeploymentRollout() method. + * @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. + * + * @example: + * const decodedOperation = await checkUpdateGameServerDeploymentRolloutProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkUpdateGameServerDeploymentRolloutProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1beta.GameServerDeployment, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.updateGameServerDeploymentRollout, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1beta.GameServerDeployment, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } listGameServerDeployments( request: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, options?: gax.CallOptions diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index 4f779d419d2..3fa2004b1a8 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -32,7 +32,7 @@ import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import * as gapicConfig from './realms_service_client_config.json'; - +import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -654,6 +654,42 @@ export class RealmsServiceClient { this.initialize(); return this.innerApiCalls.createRealm(request, options, callback); } + /** + * Check the status of the long running operation returned by the createRealm() method. + * @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. + * + * @example: + * const decodedOperation = await checkCreateRealmProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkCreateRealmProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1beta.Realm, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.createRealm, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1beta.Realm, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } deleteRealm( request: protos.google.cloud.gaming.v1beta.IDeleteRealmRequest, options?: gax.CallOptions @@ -753,6 +789,42 @@ export class RealmsServiceClient { this.initialize(); return this.innerApiCalls.deleteRealm(request, options, callback); } + /** + * Check the status of the long running operation returned by the deleteRealm() method. + * @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. + * + * @example: + * const decodedOperation = await checkDeleteRealmProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkDeleteRealmProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1beta.Realm, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.deleteRealm, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1beta.Realm, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } updateRealm( request: protos.google.cloud.gaming.v1beta.IUpdateRealmRequest, options?: gax.CallOptions @@ -859,6 +931,42 @@ export class RealmsServiceClient { this.initialize(); return this.innerApiCalls.updateRealm(request, options, callback); } + /** + * Check the status of the long running operation returned by the updateRealm() method. + * @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. + * + * @example: + * const decodedOperation = await checkUpdateRealmProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkUpdateRealmProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1beta.Realm, + protos.google.cloud.gaming.v1beta.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.updateRealm, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1beta.Realm, + protos.google.cloud.gaming.v1beta.OperationMetadata + >; + } listRealms( request: protos.google.cloud.gaming.v1beta.IListRealmsRequest, options?: gax.CallOptions diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 95c895c5c6b..44418dc1209 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -3,23 +3,15 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "3a212f3ec74f063938d7556beeedf4ff4f329486" - } - }, - { - "git": { - "name": "googleapis-private", - "remote": "https://github.com/googleapis/googleapis-private.git", - "sha": "b0a4e5484d8df4a183664fcb1894921401893242", - "internalRef": "306746093" + "remote": "git@github.com:googleapis/nodejs-game-servers.git", + "sha": "17444635c2adb6beff688844f80460259ef62b92" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "19465d3ec5e5acdb01521d8f3bddd311bcbee28d" + "sha": "ab883569eb0257bbf16a6d825fd018b3adde3912" } } ], 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 index c9a3a0c6232..b1161d90f32 100644 --- 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 @@ -25,7 +25,7 @@ import * as gameserverclustersserviceModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LROperation} from 'google-gax'; +import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { const filledObject = (instance.constructor as typeof protobuf.Message).toObject( @@ -353,9 +353,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.getGameServerCluster(request); - }, expectedError); + await assert.rejects(client.getGameServerCluster(request), expectedError); assert( (client.innerApiCalls.getGameServerCluster as SinonStub) .getCall(0) @@ -475,9 +473,10 @@ describe('v1beta.GameServerClustersServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.previewCreateGameServerCluster(request); - }, expectedError); + await assert.rejects( + client.previewCreateGameServerCluster(request), + expectedError + ); assert( (client.innerApiCalls.previewCreateGameServerCluster as SinonStub) .getCall(0) @@ -597,9 +596,10 @@ describe('v1beta.GameServerClustersServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.previewDeleteGameServerCluster(request); - }, expectedError); + await assert.rejects( + client.previewDeleteGameServerCluster(request), + expectedError + ); assert( (client.innerApiCalls.previewDeleteGameServerCluster as SinonStub) .getCall(0) @@ -722,9 +722,10 @@ describe('v1beta.GameServerClustersServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.previewUpdateGameServerCluster(request); - }, expectedError); + await assert.rejects( + client.previewUpdateGameServerCluster(request), + expectedError + ); assert( (client.innerApiCalls.previewUpdateGameServerCluster as SinonStub) .getCall(0) @@ -852,9 +853,10 @@ describe('v1beta.GameServerClustersServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.createGameServerCluster(request); - }, expectedError); + await assert.rejects( + client.createGameServerCluster(request), + expectedError + ); assert( (client.innerApiCalls.createGameServerCluster as SinonStub) .getCall(0) @@ -889,15 +891,58 @@ describe('v1beta.GameServerClustersServiceClient', () => { expectedError ); const [operation] = await client.createGameServerCluster(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.createGameServerCluster as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + 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', () => { @@ -1019,9 +1064,10 @@ describe('v1beta.GameServerClustersServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.deleteGameServerCluster(request); - }, expectedError); + await assert.rejects( + client.deleteGameServerCluster(request), + expectedError + ); assert( (client.innerApiCalls.deleteGameServerCluster as SinonStub) .getCall(0) @@ -1056,15 +1102,58 @@ describe('v1beta.GameServerClustersServiceClient', () => { expectedError ); const [operation] = await client.deleteGameServerCluster(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.deleteGameServerCluster as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + 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', () => { @@ -1189,9 +1278,10 @@ describe('v1beta.GameServerClustersServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.updateGameServerCluster(request); - }, expectedError); + await assert.rejects( + client.updateGameServerCluster(request), + expectedError + ); assert( (client.innerApiCalls.updateGameServerCluster as SinonStub) .getCall(0) @@ -1227,15 +1317,58 @@ describe('v1beta.GameServerClustersServiceClient', () => { expectedError ); const [operation] = await client.updateGameServerCluster(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.updateGameServerCluster as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + 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', () => { @@ -1367,9 +1500,10 @@ describe('v1beta.GameServerClustersServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.listGameServerClusters(request); - }, expectedError); + await assert.rejects( + client.listGameServerClusters(request), + expectedError + ); assert( (client.innerApiCalls.listGameServerClusters as SinonStub) .getCall(0) @@ -1471,9 +1605,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.listGameServerClusters .createStream as SinonStub) 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 index 603859db9de..fdf20c0248a 100644 --- 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 @@ -25,7 +25,7 @@ import * as gameserverconfigsserviceModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LROperation} from 'google-gax'; +import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { const filledObject = (instance.constructor as typeof protobuf.Message).toObject( @@ -352,9 +352,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.getGameServerConfig(request); - }, expectedError); + await assert.rejects(client.getGameServerConfig(request), expectedError); assert( (client.innerApiCalls.getGameServerConfig as SinonStub) .getCall(0) @@ -482,9 +480,10 @@ describe('v1beta.GameServerConfigsServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.createGameServerConfig(request); - }, expectedError); + await assert.rejects( + client.createGameServerConfig(request), + expectedError + ); assert( (client.innerApiCalls.createGameServerConfig as SinonStub) .getCall(0) @@ -519,15 +518,58 @@ describe('v1beta.GameServerConfigsServiceClient', () => { expectedError ); const [operation] = await client.createGameServerConfig(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.createGameServerConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + 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', () => { @@ -649,9 +691,10 @@ describe('v1beta.GameServerConfigsServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.deleteGameServerConfig(request); - }, expectedError); + await assert.rejects( + client.deleteGameServerConfig(request), + expectedError + ); assert( (client.innerApiCalls.deleteGameServerConfig as SinonStub) .getCall(0) @@ -686,15 +729,58 @@ describe('v1beta.GameServerConfigsServiceClient', () => { expectedError ); const [operation] = await client.deleteGameServerConfig(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.deleteGameServerConfig as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + 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', () => { @@ -826,9 +912,10 @@ describe('v1beta.GameServerConfigsServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.listGameServerConfigs(request); - }, expectedError); + await assert.rejects( + client.listGameServerConfigs(request), + expectedError + ); assert( (client.innerApiCalls.listGameServerConfigs as SinonStub) .getCall(0) @@ -930,9 +1017,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.listGameServerConfigs .createStream as SinonStub) 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 index 0edc89819a9..8e17f7577d4 100644 --- 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 @@ -25,7 +25,7 @@ import * as gameserverdeploymentsserviceModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LROperation} from 'google-gax'; +import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { const filledObject = (instance.constructor as typeof protobuf.Message).toObject( @@ -353,9 +353,10 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.getGameServerDeployment(request); - }, expectedError); + await assert.rejects( + client.getGameServerDeployment(request), + expectedError + ); assert( (client.innerApiCalls.getGameServerDeployment as SinonStub) .getCall(0) @@ -475,9 +476,10 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.getGameServerDeploymentRollout(request); - }, expectedError); + await assert.rejects( + client.getGameServerDeploymentRollout(request), + expectedError + ); assert( (client.innerApiCalls.getGameServerDeploymentRollout as SinonStub) .getCall(0) @@ -602,9 +604,10 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.previewGameServerDeploymentRollout(request); - }, expectedError); + await assert.rejects( + client.previewGameServerDeploymentRollout(request), + expectedError + ); assert( (client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub) .getCall(0) @@ -724,9 +727,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.fetchDeploymentState(request); - }, expectedError); + await assert.rejects(client.fetchDeploymentState(request), expectedError); assert( (client.innerApiCalls.fetchDeploymentState as SinonStub) .getCall(0) @@ -854,9 +855,10 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.createGameServerDeployment(request); - }, expectedError); + await assert.rejects( + client.createGameServerDeployment(request), + expectedError + ); assert( (client.innerApiCalls.createGameServerDeployment as SinonStub) .getCall(0) @@ -891,15 +893,58 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { expectedError ); const [operation] = await client.createGameServerDeployment(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.createGameServerDeployment as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + 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', () => { @@ -1021,9 +1066,10 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.deleteGameServerDeployment(request); - }, expectedError); + await assert.rejects( + client.deleteGameServerDeployment(request), + expectedError + ); assert( (client.innerApiCalls.deleteGameServerDeployment as SinonStub) .getCall(0) @@ -1058,15 +1104,58 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { expectedError ); const [operation] = await client.deleteGameServerDeployment(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.deleteGameServerDeployment as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + 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', () => { @@ -1191,9 +1280,10 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.updateGameServerDeployment(request); - }, expectedError); + await assert.rejects( + client.updateGameServerDeployment(request), + expectedError + ); assert( (client.innerApiCalls.updateGameServerDeployment as SinonStub) .getCall(0) @@ -1229,15 +1319,58 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { expectedError ); const [operation] = await client.updateGameServerDeployment(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.updateGameServerDeployment as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + 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', () => { @@ -1364,9 +1497,10 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.updateGameServerDeploymentRollout(request); - }, expectedError); + await assert.rejects( + client.updateGameServerDeploymentRollout(request), + expectedError + ); assert( (client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub) .getCall(0) @@ -1404,15 +1538,58 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const [operation] = await client.updateGameServerDeploymentRollout( request ); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + 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', () => { @@ -1544,9 +1721,10 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.listGameServerDeployments(request); - }, expectedError); + await assert.rejects( + client.listGameServerDeployments(request), + expectedError + ); assert( (client.innerApiCalls.listGameServerDeployments as SinonStub) .getCall(0) @@ -1652,9 +1830,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.listGameServerDeployments .createStream as SinonStub) diff --git a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts index cbe9b35b5e4..ca654d35369 100644 --- a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts @@ -25,7 +25,7 @@ import * as realmsserviceModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LROperation} from 'google-gax'; +import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { const filledObject = (instance.constructor as typeof protobuf.Message).toObject( @@ -328,9 +328,7 @@ describe('v1beta.RealmsServiceClient', () => { }; const expectedError = new Error('expected'); client.innerApiCalls.getRealm = stubSimpleCall(undefined, expectedError); - await assert.rejects(async () => { - await client.getRealm(request); - }, expectedError); + await assert.rejects(client.getRealm(request), expectedError); assert( (client.innerApiCalls.getRealm as SinonStub) .getCall(0) @@ -447,9 +445,7 @@ describe('v1beta.RealmsServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.previewRealmUpdate(request); - }, expectedError); + await assert.rejects(client.previewRealmUpdate(request), expectedError); assert( (client.innerApiCalls.previewRealmUpdate as SinonStub) .getCall(0) @@ -569,9 +565,7 @@ describe('v1beta.RealmsServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.createRealm(request); - }, expectedError); + await assert.rejects(client.createRealm(request), expectedError); assert( (client.innerApiCalls.createRealm as SinonStub) .getCall(0) @@ -604,15 +598,51 @@ describe('v1beta.RealmsServiceClient', () => { expectedError ); const [operation] = await client.createRealm(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.createRealm as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + 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', () => { @@ -726,9 +756,7 @@ describe('v1beta.RealmsServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.deleteRealm(request); - }, expectedError); + await assert.rejects(client.deleteRealm(request), expectedError); assert( (client.innerApiCalls.deleteRealm as SinonStub) .getCall(0) @@ -761,15 +789,51 @@ describe('v1beta.RealmsServiceClient', () => { expectedError ); const [operation] = await client.deleteRealm(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.deleteRealm as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + 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', () => { @@ -886,9 +950,7 @@ describe('v1beta.RealmsServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.updateRealm(request); - }, expectedError); + await assert.rejects(client.updateRealm(request), expectedError); assert( (client.innerApiCalls.updateRealm as SinonStub) .getCall(0) @@ -922,15 +984,51 @@ describe('v1beta.RealmsServiceClient', () => { expectedError ); const [operation] = await client.updateRealm(request); - await assert.rejects(async () => { - await operation.promise(); - }, expectedError); + await assert.rejects(operation.promise(), expectedError); assert( (client.innerApiCalls.updateRealm as SinonStub) .getCall(0) .calledWith(request, expectedOptions, undefined) ); }); + + 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', () => { @@ -1040,9 +1138,7 @@ describe('v1beta.RealmsServiceClient', () => { undefined, expectedError ); - await assert.rejects(async () => { - await client.listRealms(request); - }, expectedError); + await assert.rejects(client.listRealms(request), expectedError); assert( (client.innerApiCalls.listRealms as SinonStub) .getCall(0) @@ -1132,9 +1228,7 @@ describe('v1beta.RealmsServiceClient', () => { reject(err); }); }); - await assert.rejects(async () => { - await promise; - }, expectedError); + await assert.rejects(promise, expectedError); assert( (client.descriptors.page.listRealms.createStream as SinonStub) .getCall(0) From 9af5c178ab95d512ba0cb98da709d46f7c6de057 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 8 May 2020 11:26:15 -0700 Subject: [PATCH 038/180] build: do not fail builds on codecov errors (#528) (#67) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/13e8b547-7af0-436b-b85e-2c1942f8f36a/targets Source-Link: https://github.com/googleapis/synthtool/commit/be74d3e532faa47eb59f1a0eaebde0860d1d8ab4 --- .../google/cloud/gaming/v1beta/common.proto | 3 ++- .../gaming/v1beta/game_server_clusters.proto | 22 +++++-------------- .../v1beta/game_server_clusters_service.proto | 4 ++-- .../gaming/v1beta/game_server_configs.proto | 8 +++---- .../v1beta/game_server_configs_service.proto | 4 ++-- .../v1beta/game_server_deployments.proto | 8 +++---- .../game_server_deployments_service.proto | 9 ++------ .../google/cloud/gaming/v1beta/realms.proto | 8 +++---- .../cloud/gaming/v1beta/realms_service.proto | 4 ++-- .../google-cloud-gaming/protos/protos.json | 22 +++++++++---------- .../game_server_deployments_service_client.ts | 5 ----- packages/google-cloud-gaming/synth.metadata | 14 +++++++++--- 12 files changed, 49 insertions(+), 62 deletions(-) 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 index 027272cf309..1db6b77cfa4 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; 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 index fd67a112b2c..62ce7ef9cba 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -24,7 +25,6 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListGameServerClustersRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/GameServerCluster" + type: "gameservices.googleapis.com/GameServerCluster" } ]; @@ -90,7 +90,7 @@ message CreateGameServerClusterRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/GameServerCluster" + type: "gameservices.googleapis.com/GameServerCluster" } ]; @@ -105,12 +105,7 @@ message CreateGameServerClusterRequest { 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" - } - ]; + string parent = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The ID of the Game Server Cluster resource to be created. string game_server_cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; @@ -148,12 +143,7 @@ message DeleteGameServerClusterRequest { 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" - } - ]; + string name = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. The target timestamp to compute the preview. google.protobuf.Timestamp preview_time = 2 [(google.api.field_behavior) = OPTIONAL]; 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 index 2d81c438273..462e42dde47 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -22,7 +23,6 @@ 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"; 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 index ea0820bd79d..ac57c5c3a19 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -23,7 +24,6 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListGameServerConfigsRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/GameServerConfig" + type: "gameservices.googleapis.com/GameServerConfig" } ]; @@ -91,7 +91,7 @@ message CreateGameServerConfigRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/GameServerConfig" + type: "gameservices.googleapis.com/GameServerConfig" } ]; 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 index 29e886c50df..89dd582307a 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -22,7 +23,6 @@ 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"; 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 index 2e87e386c85..d0682520900 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -24,7 +25,6 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListGameServerDeploymentsRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/GameServerDeployment" + type: "gameservices.googleapis.com/GameServerDeployment" } ]; @@ -105,7 +105,7 @@ message CreateGameServerDeploymentRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/GameServerDeployment" + type: "gameservices.googleapis.com/GameServerDeployment" } ]; 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 index ccacfbacd5a..ccb0c5055f4 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -22,7 +23,6 @@ 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"; @@ -95,11 +95,6 @@ service GameServerDeploymentsService { } // 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" 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 index c1fa9982f2f..38281aa6789 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -24,7 +25,6 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListRealmsRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/Realm" + type: "gameservices.googleapis.com/Realm" } ]; @@ -90,7 +90,7 @@ message CreateRealmRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - child_type: "gameservices.googleapis.com/Realm" + type: "gameservices.googleapis.com/Realm" } ]; 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 index 4c87cac3d36..b7dfaa07cc3 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2019 Google LLC. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -11,6 +11,7 @@ // WITHOUT 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"; @@ -22,7 +23,6 @@ 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"; diff --git a/packages/google-cloud-gaming/protos/protos.json b/packages/google-cloud-gaming/protos/protos.json index 81af95e0ff0..bfc2265f969 100644 --- a/packages/google-cloud-gaming/protos/protos.json +++ b/packages/google-cloud-gaming/protos/protos.json @@ -306,7 +306,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" } }, "pageSize": { @@ -376,7 +376,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" } }, "gameServerClusterId": { @@ -401,8 +401,7 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" + "(google.api.field_behavior)": "REQUIRED" } }, "gameServerClusterId": { @@ -458,8 +457,7 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" + "(google.api.field_behavior)": "REQUIRED" } }, "previewTime": { @@ -697,7 +695,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerConfig" + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerConfig" } }, "pageSize": { @@ -767,7 +765,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerConfig" + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerConfig" } }, "configId": { @@ -935,7 +933,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerDeployment" + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerDeployment" } }, "pageSize": { @@ -1017,7 +1015,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerDeployment" + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerDeployment" } }, "deploymentId": { @@ -1366,7 +1364,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/Realm" + "(google.api.resource_reference).type": "gameservices.googleapis.com/Realm" } }, "pageSize": { @@ -1436,7 +1434,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "gameservices.googleapis.com/Realm" + "(google.api.resource_reference).type": "gameservices.googleapis.com/Realm" } }, "realmId": { 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 index 4e2d96a22a2..f2b0f236e52 100644 --- 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 @@ -1280,11 +1280,6 @@ export class GameServerDeploymentsServiceClient { ): void; /** * 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. diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 44418dc1209..4b39a145131 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -3,15 +3,23 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-game-servers.git", - "sha": "17444635c2adb6beff688844f80460259ef62b92" + "remote": "https://github.com/googleapis/nodejs-game-servers.git", + "sha": "39008750a6024b0893bee88f39f2a6ad9fc87889" + } + }, + { + "git": { + "name": "googleapis-private", + "remote": "https://github.com/googleapis/googleapis-private.git", + "sha": "dfbc67c8c1f91957abe96da943d90fe8101addf1", + "internalRef": "309845930" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ab883569eb0257bbf16a6d825fd018b3adde3912" + "sha": "be74d3e532faa47eb59f1a0eaebde0860d1d8ab4" } } ], From 0236920c6acb844e51b111ed4b360ac19e3ad9de Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 3 Jun 2020 17:38:16 -0700 Subject: [PATCH 039/180] build: update protos.js (#68) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/041f5df7-f5d3-4b2a-9ede-0752bf41c185/targets --- .../google-cloud-gaming/protos/protos.d.ts | 6 +++++ packages/google-cloud-gaming/protos/protos.js | 26 +++++++++++++++++-- .../google-cloud-gaming/protos/protos.json | 6 ++++- packages/google-cloud-gaming/synth.metadata | 2 +- 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-gaming/protos/protos.d.ts b/packages/google-cloud-gaming/protos/protos.d.ts index 901cccd8fef..159c5deddc8 100644 --- a/packages/google-cloud-gaming/protos/protos.d.ts +++ b/packages/google-cloud-gaming/protos/protos.d.ts @@ -8388,6 +8388,9 @@ export namespace google { /** FieldDescriptorProto options */ options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); } /** Represents a FieldDescriptorProto. */ @@ -8429,6 +8432,9 @@ export namespace google { /** 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 diff --git a/packages/google-cloud-gaming/protos/protos.js b/packages/google-cloud-gaming/protos/protos.js index 9a1d4c3b0bb..b73d617bd2d 100644 --- a/packages/google-cloud-gaming/protos/protos.js +++ b/packages/google-cloud-gaming/protos/protos.js @@ -19993,6 +19993,7 @@ * @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 */ /** @@ -20090,6 +20091,14 @@ */ 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 @@ -20134,6 +20143,8 @@ 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; }; @@ -20198,6 +20209,9 @@ 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; @@ -20292,6 +20306,9 @@ if (error) return "options." + error; } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; return null; }; @@ -20414,6 +20431,8 @@ 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; }; @@ -20441,6 +20460,7 @@ object.options = null; object.oneofIndex = 0; object.jsonName = ""; + object.proto3Optional = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -20462,6 +20482,8 @@ 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; }; @@ -22255,7 +22277,7 @@ * @memberof google.protobuf.FileOptions * @instance */ - FileOptions.prototype.ccEnableArenas = false; + FileOptions.prototype.ccEnableArenas = true; /** * FileOptions objcClassPrefix. @@ -22741,7 +22763,7 @@ object.javaGenerateEqualsAndHash = false; object.deprecated = false; object.javaStringCheckUtf8 = false; - object.ccEnableArenas = false; + object.ccEnableArenas = true; object.objcClassPrefix = ""; object.csharpNamespace = ""; object.swiftPrefix = ""; diff --git a/packages/google-cloud-gaming/protos/protos.json b/packages/google-cloud-gaming/protos/protos.json index bfc2265f969..acc63edae5f 100644 --- a/packages/google-cloud-gaming/protos/protos.json +++ b/packages/google-cloud-gaming/protos/protos.json @@ -2056,6 +2056,10 @@ "options": { "type": "FieldOptions", "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 } }, "nested": { @@ -2291,7 +2295,7 @@ "type": "bool", "id": 31, "options": { - "default": false + "default": true } }, "objcClassPrefix": { diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 4b39a145131..083898d5dcf 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "39008750a6024b0893bee88f39f2a6ad9fc87889" + "sha": "23c7ac0da5d79c8d3f0069f519e848221c420407" } }, { From 9465fb6e9a021d9755a50b57d3b9044d5c69419c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 4 Jun 2020 11:05:54 -0700 Subject: [PATCH 040/180] chore: release 2.0.0 (#38) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-gaming/CHANGELOG.md | 20 +++++++++++++++++++ packages/google-cloud-gaming/package.json | 2 +- .../google-cloud-gaming/samples/package.json | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index ae358dd2da6..a163916719d 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 6b4a688b64d..212507b64b9 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "1.1.0", + "version": "2.0.0", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index 4743b60f84f..e6a9411fa71 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^1.1.0" + "@google-cloud/game-servers": "^2.0.0" }, "devDependencies": { "c8": "^7.0.0", From 5443a00fa749a5d0e6b860c3f8d82bbc00654554 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 11 Jun 2020 17:46:07 +0200 Subject: [PATCH 041/180] chore(deps): update dependency mocha to v8 (#72) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [mocha](https://mochajs.org/) ([source](https://togithub.com/mochajs/mocha)) | devDependencies | major | [`^7.0.0` -> `^8.0.0`](https://renovatebot.com/diffs/npm/mocha/7.2.0/8.0.1) | --- ### Release Notes
mochajs/mocha ### [`v8.0.1`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​801--2020-06-10) [Compare Source](https://togithub.com/mochajs/mocha/compare/v8.0.0...v8.0.1) The obligatory patch after a major. #### :bug: Fixes - [#​4328](https://togithub.com/mochajs/mocha/issues/4328): Fix `--parallel` when combined with `--watch` ([**@​boneskull**](https://togithub.com/boneskull)) ### [`v8.0.0`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​800--2020-06-10) [Compare Source](https://togithub.com/mochajs/mocha/compare/v7.2.0...v8.0.0) In this major release, Mocha adds the ability to _run tests in parallel_. Better late than never! Please note the **breaking changes** detailed below. Let's welcome [**@​giltayar**](https://togithub.com/giltayar) and [**@​nicojs**](https://togithub.com/nicojs) to the maintenance team! #### :boom: Breaking Changes - [#​4164](https://togithub.com/mochajs/mocha/issues/4164): **Mocha v8.0.0 now requires Node.js v10.0.0 or newer.** Mocha no longer supports the Node.js v8.x line ("Carbon"), which entered End-of-Life at the end of 2019 ([**@​UlisesGascon**](https://togithub.com/UlisesGascon)) - [#​4175](https://togithub.com/mochajs/mocha/issues/4175): Having been deprecated with a warning since v7.0.0, **`mocha.opts` is no longer supported** ([**@​juergba**](https://togithub.com/juergba)) :sparkles: **WORKAROUND:** Replace `mocha.opts` with a [configuration file](https://mochajs.org/#configuring-mocha-nodejs). - [#​4260](https://togithub.com/mochajs/mocha/issues/4260): Remove `enableTimeout()` (`this.enableTimeout()`) from the context object ([**@​craigtaub**](https://togithub.com/craigtaub)) :sparkles: **WORKAROUND:** Replace usage of `this.enableTimeout(false)` in your tests with `this.timeout(0)`. - [#​4315](https://togithub.com/mochajs/mocha/issues/4315): The `spec` option no longer supports a comma-delimited list of files ([**@​juergba**](https://togithub.com/juergba)) :sparkles: **WORKAROUND**: Use an array instead (e.g., `"spec": "foo.js,bar.js"` becomes `"spec": ["foo.js", "bar.js"]`). - [#​4309](https://togithub.com/mochajs/mocha/issues/4309): Drop support for Node.js v13.x line, which is now End-of-Life ([**@​juergba**](https://togithub.com/juergba)) - [#​4282](https://togithub.com/mochajs/mocha/issues/4282): `--forbid-only` will throw an error even if exclusive tests are avoided via `--grep` or other means ([**@​arvidOtt**](https://togithub.com/arvidOtt)) - [#​4223](https://togithub.com/mochajs/mocha/issues/4223): The context object's `skip()` (`this.skip()`) in a "before all" (`before()`) hook will no longer execute subsequent sibling hooks, in addition to hooks in child suites ([**@​juergba**](https://togithub.com/juergba)) - [#​4178](https://togithub.com/mochajs/mocha/issues/4178): Remove previously soft-deprecated APIs ([**@​wnghdcjfe**](https://togithub.com/wnghdcjfe)): - `Mocha.prototype.ignoreLeaks()` - `Mocha.prototype.useColors()` - `Mocha.prototype.useInlineDiffs()` - `Mocha.prototype.hideDiff()` #### :tada: Enhancements - [#​4245](https://togithub.com/mochajs/mocha/issues/4245): Add ability to run tests in parallel for Node.js (see [docs](https://mochajs.org/#parallel-tests)) ([**@​boneskull**](https://togithub.com/boneskull)) :exclamation: See also [#​4244](https://togithub.com/mochajs/mocha/issues/4244); [Root Hook Plugins (docs)](https://mochajs.org/#root-hook-plugins) -- _root hooks must be defined via Root Hook Plugins to work in parallel mode_ - [#​4304](https://togithub.com/mochajs/mocha/issues/4304): `--require` now works with ES modules ([**@​JacobLey**](https://togithub.com/JacobLey)) - [#​4299](https://togithub.com/mochajs/mocha/issues/4299): In some circumstances, Mocha can run ES modules under Node.js v10 -- _use at your own risk!_ ([**@​giltayar**](https://togithub.com/giltayar)) #### :book: Documentation - [#​4246](https://togithub.com/mochajs/mocha/issues/4246): Add documentation for parallel mode and Root Hook plugins ([**@​boneskull**](https://togithub.com/boneskull)) #### :bug: Fixes (All bug fixes in Mocha v8.0.0 are also breaking changes, and are listed above)
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 212507b64b9..2407fa42b03 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -39,7 +39,7 @@ "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", "linkinator": "^2.0.3", - "mocha": "^7.0.0", + "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index e6a9411fa71..b24d1d469b4 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -18,7 +18,7 @@ "devDependencies": { "c8": "^7.0.0", "chai": "^4.2.0", - "mocha": "^7.0.0", + "mocha": "^8.0.0", "uuid": "^8.0.0" } } From e132f6b01ceda58e5c54cc3a10672beea5dc3310 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 12 Jun 2020 10:38:07 -0700 Subject: [PATCH 042/180] build: ts target updated to es2018 (#70) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/94b5c3f0-0503-436d-9be8-c1804aaa194c/targets - [ ] To automatically regenerate this PR, check this box. --- packages/google-cloud-gaming/protos/protos.js | 2 +- .../src/v1beta/game_server_clusters_service_client.ts | 7 +++++++ .../src/v1beta/game_server_configs_service_client.ts | 7 +++++++ .../src/v1beta/game_server_deployments_service_client.ts | 7 +++++++ .../src/v1beta/realms_service_client.ts | 7 +++++++ packages/google-cloud-gaming/synth.metadata | 2 +- packages/google-cloud-gaming/tsconfig.json | 2 +- 7 files changed, 31 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-gaming/protos/protos.js b/packages/google-cloud-gaming/protos/protos.js index b73d617bd2d..570d830a389 100644 --- a/packages/google-cloud-gaming/protos/protos.js +++ b/packages/google-cloud-gaming/protos/protos.js @@ -28,7 +28,7 @@ var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; // Exported root namespace - var $root = $protobuf.roots._google_cloud_game_servers_1_1_0_protos || ($protobuf.roots._google_cloud_game_servers_1_1_0_protos = {}); + var $root = $protobuf.roots._google_cloud_game_servers_protos || ($protobuf.roots._google_cloud_game_servers_protos = {}); $root.google = (function() { 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 index 304cb65174f..6a493a5aa62 100644 --- 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 @@ -103,6 +103,13 @@ export class GameServerClustersServiceClient { } opts.servicePath = opts.servicePath || servicePath; opts.port = opts.port || port; + + // users can override the config from client side, like retry codes name. + // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 + // The way to override client config for Showcase API: + // + // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} + // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; const isBrowser = typeof window !== 'undefined'; 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 index 1f031f25610..6e813414e54 100644 --- 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 @@ -102,6 +102,13 @@ export class GameServerConfigsServiceClient { } opts.servicePath = opts.servicePath || servicePath; opts.port = opts.port || port; + + // users can override the config from client side, like retry codes name. + // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 + // The way to override client config for Showcase API: + // + // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} + // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; const isBrowser = typeof window !== 'undefined'; 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 index f2b0f236e52..fb9fdf28529 100644 --- 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 @@ -103,6 +103,13 @@ export class GameServerDeploymentsServiceClient { } opts.servicePath = opts.servicePath || servicePath; opts.port = opts.port || port; + + // users can override the config from client side, like retry codes name. + // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 + // The way to override client config for Showcase API: + // + // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} + // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; const isBrowser = typeof window !== 'undefined'; diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index 3fa2004b1a8..c4ae67ca520 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -102,6 +102,13 @@ export class RealmsServiceClient { } opts.servicePath = opts.servicePath || servicePath; opts.port = opts.port || port; + + // users can override the config from client side, like retry codes name. + // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 + // The way to override client config for Showcase API: + // + // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} + // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; const isBrowser = typeof window !== 'undefined'; diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 083898d5dcf..b036ccb9fea 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "23c7ac0da5d79c8d3f0069f519e848221c420407" + "sha": "f72d636da39868449f3abdf8371beaceb693f7d0" } }, { diff --git a/packages/google-cloud-gaming/tsconfig.json b/packages/google-cloud-gaming/tsconfig.json index 613d35597b5..c78f1c884ef 100644 --- a/packages/google-cloud-gaming/tsconfig.json +++ b/packages/google-cloud-gaming/tsconfig.json @@ -5,7 +5,7 @@ "outDir": "build", "resolveJsonModule": true, "lib": [ - "es2016", + "es2018", "dom" ] }, From d9b7d927d06a98906522c3ae7120544a7c142499 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 15 Jun 2020 11:18:06 -0700 Subject: [PATCH 043/180] fix: proper fallback option handling (#74) * changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. * feat(secrets): begin migration to secret manager from keystore Source-Author: Benjamin E. Coe Source-Date: Mon Jun 8 09:51:11 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 1c92077459db3dc50741e878f98b08c6261181e0 Source-Link: https://github.com/googleapis/synthtool/commit/1c92077459db3dc50741e878f98b08c6261181e0 * chore(nodejs_templates): add script logging to node_library populate-secrets.sh Co-authored-by: Benjamin E. Coe Source-Author: BenWhitehead Source-Date: Wed Jun 10 22:24:28 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: e7034945fbdc0e79d3c57f6e299e5c90b0f11469 Source-Link: https://github.com/googleapis/synthtool/commit/e7034945fbdc0e79d3c57f6e299e5c90b0f11469 --- .../v1beta/game_server_clusters_service_client.ts | 13 +++++-------- .../v1beta/game_server_configs_service_client.ts | 13 +++++-------- .../game_server_deployments_service_client.ts | 13 +++++-------- .../src/v1beta/realms_service_client.ts | 13 +++++-------- packages/google-cloud-gaming/synth.metadata | 4 ++-- 5 files changed, 22 insertions(+), 34 deletions(-) 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 index 6a493a5aa62..ee23cce256f 100644 --- 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 @@ -112,14 +112,11 @@ export class GameServerClustersServiceClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the GameServerClustersServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. 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 index 6e813414e54..9a32804b303 100644 --- 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 @@ -111,14 +111,11 @@ export class GameServerConfigsServiceClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the GameServerConfigsServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. 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 index fb9fdf28529..817bba9659b 100644 --- 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 @@ -112,14 +112,11 @@ export class GameServerDeploymentsServiceClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the GameServerDeploymentsServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the 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 index c4ae67ca520..5d4c1b50a42 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -111,14 +111,11 @@ export class RealmsServiceClient { // const showcaseClient = new showcaseClient({ projectId, customConfig }); opts.clientConfig = opts.clientConfig || {}; - const isBrowser = typeof window !== 'undefined'; - if (isBrowser) { - opts.fallback = true; - } - // If we are in browser, we are already using fallback because of the - // "browser" field in package.json. - // But if we were explicitly requested to use fallback, let's do it now. - this._gaxModule = !isBrowser && opts.fallback ? gax.fallback : gax; + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the RealmsServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; // Create a `gaxGrpc` object, with any grpc-specific options // sent to the client. diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index b036ccb9fea..801e665a364 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "f72d636da39868449f3abdf8371beaceb693f7d0" + "sha": "e1d1b17aa79de4b0f34689ce83a1796ebe2508ed" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "be74d3e532faa47eb59f1a0eaebde0860d1d8ab4" + "sha": "e7034945fbdc0e79d3c57f6e299e5c90b0f11469" } } ], From 0a8bc2108167898bb2ef9d753f9747bd036c8d61 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 16 Jun 2020 09:01:48 -0700 Subject: [PATCH 044/180] chore: release 2.0.1 (#75) * updated CHANGELOG.md [ci skip] * updated package.json [ci skip] * updated samples/package.json Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-gaming/CHANGELOG.md | 7 +++++++ packages/google-cloud-gaming/package.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index a163916719d..c4011b18c86 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 2407fa42b03..ec3ea9aba78 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "2.0.0", + "version": "2.0.1", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index b24d1d469b4..9b6401e6c3e 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^2.0.0" + "@google-cloud/game-servers": "^2.0.1" }, "devDependencies": { "c8": "^7.0.0", From c2be8c907b3d0590fe1986cf52fc2dd67d9af439 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 18 Jun 2020 07:48:14 -0700 Subject: [PATCH 045/180] chore: update node issue template (#76) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/37f383f8-7560-459e-b66c-def10ff830cb/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/b10590a4a1568548dd13cfcea9aa11d40898144b --- packages/google-cloud-gaming/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 801e665a364..e2d9cc4b452 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "e1d1b17aa79de4b0f34689ce83a1796ebe2508ed" + "sha": "1652d07415c7ea54c8de8a2cb7c68191436776d5" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "e7034945fbdc0e79d3c57f6e299e5c90b0f11469" + "sha": "b10590a4a1568548dd13cfcea9aa11d40898144b" } } ], From 1cf42b7617067f3f4c872a38e29ceed69b72ffc6 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Wed, 8 Jul 2020 20:00:49 -0700 Subject: [PATCH 046/180] fix: correct return type of delete operations (#79) Response type of Delete LRO is changed. Technically, a breaking change, but the previous code never worked, so considering this to be a regular fix. fix: increase timeout for CreateGameServerCluster build: use bazel build Co-authored-by: Justin Beckwith --- .../google/cloud/gaming/v1beta/common.proto | 19 +++-- .../gaming/v1beta/game_server_clusters.proto | 62 ++++++++------ .../v1beta/game_server_clusters_service.proto | 8 +- .../gaming/v1beta/game_server_configs.proto | 34 ++++---- .../v1beta/game_server_configs_service.proto | 24 +++--- .../v1beta/game_server_deployments.proto | 72 ++++++++--------- .../game_server_deployments_service.proto | 37 +++++---- .../google/cloud/gaming/v1beta/realms.proto | 36 ++++----- .../cloud/gaming/v1beta/realms_service.proto | 20 ++--- .../google-cloud-gaming/protos/protos.json | 30 +++---- .../game_server_clusters_service_client.ts | 50 ++++++------ ...server_clusters_service_client_config.json | 40 ++++++--- .../game_server_configs_service_client.ts | 50 ++++++------ ..._server_configs_service_client_config.json | 24 +++++- .../game_server_deployments_service_client.ts | 81 ++++++++++--------- ...ver_deployments_service_client_config.json | 41 +++++++--- .../src/v1beta/realms_service_client.ts | 50 ++++++------ .../v1beta/realms_service_client_config.json | 30 +++++-- packages/google-cloud-gaming/synth.metadata | 24 ++---- packages/google-cloud-gaming/synth.py | 13 +-- ...pic_game_server_clusters_service_v1beta.ts | 4 +- ...apic_game_server_configs_service_v1beta.ts | 4 +- ..._game_server_deployments_service_v1beta.ts | 4 +- .../test/gapic_realms_service_v1beta.ts | 4 +- 24 files changed, 421 insertions(+), 340 deletions(-) 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 index 1db6b77cfa4..159167a469b 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -56,7 +55,7 @@ message OperationMetadata { // 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 gameservices API operations. Operation status is in + // 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. @@ -90,9 +89,9 @@ message LabelSelector { map labels = 1; } -// The Realm selector, used to match Realm resources. +// The realm selector, used to match realm resources. message RealmSelector { - // List of Realms to match. + // List of realms to match. repeated string realms = 1; } @@ -117,13 +116,13 @@ message Schedule { // 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. + // 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: + // The game server config resource. Uses the form: // // `projects/{project}/locations/{location}/gameServerDeployments/{deployment_id}/configs/{config_id}`. string game_server_config_name = 1; @@ -164,17 +163,17 @@ message TargetDetails { TargetFleetAutoscaler autoscaler = 2; } - // The Game Server Cluster name. Uses the form: + // 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: + // 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. + // Agones fleet details for game server clusters and game server deployments. repeated TargetFleetDetails fleet_details = 3; } 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 index 62ce7ef9cba..357ef36ebaa 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -25,6 +24,7 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,12 +35,12 @@ message ListGameServerClustersRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerCluster" + child_type: "gameservices.googleapis.com/GameServerCluster" } ]; - // Optional. The maximum number of items to return. If unspecified, server - // will pick an appropriate default. Server may return fewer items than + // 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. @@ -59,20 +59,20 @@ message ListGameServerClustersRequest { // Response message for GameServerClustersService.ListGameServerClusters. message ListGameServerClustersResponse { - // The list of Game Server Clusters. + // 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. + // 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: + // 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 [ @@ -90,14 +90,14 @@ message CreateGameServerClusterRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerCluster" + child_type: "gameservices.googleapis.com/GameServerCluster" } ]; - // Required. The ID of the Game Server Cluster resource to be created. + // 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. + // Required. The game server cluster resource to be created. GameServerCluster game_server_cluster = 3 [(google.api.field_behavior) = REQUIRED]; } @@ -105,12 +105,17 @@ message CreateGameServerClusterRequest { message PreviewCreateGameServerClusterRequest { // Required. The parent resource name. Uses the form: // `projects/{project}/locations/{location}/realms/{realm}`. - string parent = 1 [(google.api.field_behavior) = REQUIRED]; + 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. + // 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. + // 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. @@ -129,7 +134,7 @@ message PreviewCreateGameServerClusterResponse { // Request message for GameServerClustersService.DeleteGameServerCluster. message DeleteGameServerClusterRequest { - // Required. The name of the Game Server Cluster to delete. Uses the form: + // 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, @@ -141,9 +146,14 @@ message DeleteGameServerClusterRequest { // Request message for GameServerClustersService.PreviewDeleteGameServerCluster. message PreviewDeleteGameServerClusterRequest { - // Required. The name of the Game Server Cluster to delete. Uses the form: + // 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]; + 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]; @@ -161,7 +171,7 @@ message PreviewDeleteGameServerClusterResponse { // Request message for GameServerClustersService.UpdateGameServerCluster. message UpdateGameServerClusterRequest { - // Required. The Game Server Cluster to be updated. + // 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]; @@ -176,7 +186,7 @@ message UpdateGameServerClusterRequest { // Request message for GameServerClustersService.UpdateGameServerCluster. message PreviewUpdateGameServerClusterRequest { - // Required. The Game Server Cluster to be updated. + // 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]; @@ -201,7 +211,7 @@ message PreviewUpdateGameServerClusterResponse { TargetState target_state = 3; } -// The Game Server Cluster connection information. +// The game server cluster connection information. message GameServerClusterConnectionInfo { // The location of the Kubernetes cluster. oneof cluster_reference { @@ -209,7 +219,7 @@ message GameServerClusterConnectionInfo { GkeClusterReference gke_cluster_reference = 7; } - // Namespace designated on the Game Server Cluster where the Agones game + // 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; @@ -228,14 +238,14 @@ message GkeClusterReference { string cluster = 1; } -// A Game Server Cluster resource. +// 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: + // Required. The resource name of the game server cluster. Uses the form: // // `projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}`. // For example, @@ -249,12 +259,12 @@ message GameServerCluster { // 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 + // The labels associated with this game server cluster. Each label is a // key-value pair. map labels = 4; - // Game Server Cluster connection information. This information is used to - // manage Game Server Clusters. + // The game server cluster connection information. This information is used to + // manage game server clusters. GameServerClusterConnectionInfo connection_info = 5; // ETag of the resource. 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 index 462e42dde47..935d365f576 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -23,6 +22,7 @@ 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"; @@ -32,7 +32,7 @@ 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. + // 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" @@ -77,7 +77,7 @@ service GameServerClustersService { }; option (google.api.method_signature) = "name"; option (google.longrunning.operation_info) = { - response_type: "GameServerCluster" + response_type: "google.protobuf.Empty" metadata_type: "OperationMetadata" }; } 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 index ac57c5c3a19..86c6ed293f0 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -24,6 +23,7 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListGameServerConfigsRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerConfig" + child_type: "gameservices.googleapis.com/GameServerConfig" } ]; @@ -46,7 +46,7 @@ message ListGameServerConfigsRequest { // 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. + // 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. @@ -59,20 +59,20 @@ message ListGameServerConfigsRequest { // Response message for GameServerConfigsService.ListGameServerConfigs. message ListGameServerConfigsResponse { - // The list of Game Server Configs. + // 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. + // 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: + // Required. The name of the game server config to retrieve. Uses the form: // // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. string name = 1 [ @@ -91,20 +91,20 @@ message CreateGameServerConfigRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerConfig" + child_type: "gameservices.googleapis.com/GameServerConfig" } ]; - // Required. The ID of the Game Server Config resource to be created. + // 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. + // 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: + // Required. The name of the game server config to delete. Uses the form: // // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. string name = 1 [ @@ -124,8 +124,8 @@ message ScalingConfig { // 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 + // 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; @@ -143,14 +143,14 @@ message FleetConfig { string name = 2; } -// A Game Server Config resource. +// 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: + // The resource name of the game server config. Uses the form: // // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. // For example, @@ -164,7 +164,7 @@ message GameServerConfig { // 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 + // The labels associated with this game server config. Each label is a // key-value pair. map labels = 4; @@ -175,6 +175,6 @@ message GameServerConfig { // The autoscaling settings. repeated ScalingConfig scaling_configs = 6; - // The description of the Game Server Config. + // 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 index 89dd582307a..60d2a910f4f 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -23,16 +22,17 @@ 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"; -// The Game Server Config configures the game servers in an Agones fleet. +// 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. + // 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" @@ -40,7 +40,7 @@ service GameServerConfigsService { option (google.api.method_signature) = "parent"; } - // Gets details of a single Game Server Config. + // Gets details of a single game server config. rpc GetGameServerConfig(GetGameServerConfigRequest) returns (GameServerConfig) { option (google.api.http) = { get: "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*/configs/*}" @@ -48,9 +48,9 @@ service GameServerConfigsService { 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. + // 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" @@ -63,15 +63,15 @@ service GameServerConfigsService { }; } - // Deletes a single Game Server Config. The deletion will fail if the Game - // Server Config is referenced in a Game Server Deployment Rollout. + // 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: "GameServerConfig" + 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 index d0682520900..a9a31e3ad44 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -25,6 +24,7 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,12 +35,12 @@ message ListGameServerDeploymentsRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerDeployment" + child_type: "gameservices.googleapis.com/GameServerDeployment" } ]; - // Optional. The maximum number of items to return. If unspecified, server - // will pick an appropriate default. Server may return fewer items than + // 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. @@ -60,20 +60,20 @@ message ListGameServerDeploymentsRequest { // Response message for GameServerDeploymentsService.ListGameServerDeployments. message ListGameServerDeploymentsResponse { - // The list of Game Server Delpoyments. + // 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. + // 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 Deployment to retrieve. Uses the form: + // Required. The name of the game server delpoyment to retrieve. Uses the form: // // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. string name = 1 [ @@ -87,7 +87,7 @@ message GetGameServerDeploymentRequest { // Request message for // GameServerDeploymentsService.GetGameServerDeploymentRollout. message GetGameServerDeploymentRolloutRequest { - // Required. The name of the Game Server Deployment to retrieve. Uses the form: + // Required. The name of the game server delpoyment to retrieve. Uses the form: // // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. string name = 1 [ @@ -105,20 +105,20 @@ message CreateGameServerDeploymentRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/GameServerDeployment" + child_type: "gameservices.googleapis.com/GameServerDeployment" } ]; - // Required. The ID of the Game Server Deployment resource to be created. + // 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 Deployment resource to be created. + // 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 Deployment to delete. Uses the form: + // Required. The name of the game server delpoyment to delete. Uses the form: // // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. string name = 1 [ @@ -132,7 +132,7 @@ message DeleteGameServerDeploymentRequest { // Request message for GameServerDeploymentsService.UpdateGameServerDeployment. // Only allows updates for labels. message UpdateGameServerDeploymentRequest { - // Required. The Game Server Deployment to be updated. + // 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]; @@ -148,7 +148,7 @@ message UpdateGameServerDeploymentRequest { // Request message for // GameServerDeploymentsService.UpdateGameServerRolloutDeployment. message UpdateGameServerDeploymentRolloutRequest { - // Required. The Game Server Deployment Rollout to be updated. + // 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]; @@ -163,7 +163,7 @@ message UpdateGameServerDeploymentRolloutRequest { // Request message for GameServerDeploymentsService.FetchDeploymentState. message FetchDeploymentStateRequest { - // Required. The name of the Game Server Deployment. Uses the form: + // 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]; @@ -171,31 +171,31 @@ message FetchDeploymentStateRequest { // Response message for GameServerDeploymentsService.FetchDeploymentState. message FetchDeploymentStateResponse { - // The Game Server Cluster changes made by the Game Server Deployment. + // 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. + // game server cluster. repeated DeployedFleetDetails fleet_details = 2; } - // The state of the Game Server Deployment in each Game Server Cluster. + // 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. + // List of locations that could not be reached. repeated string unavailable = 2; } -// A Game Server Deployment resource. +// 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: + // The resource name of the game server deployment. Uses the form: // // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. // For example, @@ -209,33 +209,33 @@ message GameServerDeployment { // 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 + // 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 Deployment. + // Human readable description of the game server delpoyment. string description = 8; } -// A Game Server Config override. +// A game server config override. message GameServerConfigOverride { - // Selector chooses the Game Server Config targets. + // 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. + // 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 +// The game server deployment rollout which represents the desired rollout // state. message GameServerDeploymentRollout { option (google.api.resource) = { @@ -243,7 +243,7 @@ message GameServerDeploymentRollout { pattern: "projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout" }; - // The resource name of the Game Server Deployment Rollout. Uses the form: + // The resource name of the game server deployment rollout. Uses the form: // // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. // For example, @@ -257,14 +257,14 @@ message GameServerDeploymentRollout { // 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, + // 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 + // 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; @@ -274,7 +274,7 @@ message GameServerDeploymentRollout { // Request message for PreviewGameServerDeploymentRollout. message PreviewGameServerDeploymentRolloutRequest { - // Required. The Game Server Deployment Rollout to be updated. + // 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]; @@ -287,7 +287,7 @@ message PreviewGameServerDeploymentRolloutRequest { 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. + // after the proposed rollout completes. google.protobuf.Timestamp preview_time = 3 [(google.api.field_behavior) = OPTIONAL]; } @@ -297,7 +297,7 @@ message PreviewGameServerDeploymentRolloutResponse { // Locations that could not be reached on this request. repeated string unavailable = 2; - // ETag of the Game Server Deployment. + // ETag of the game server deployment. string etag = 3; // The target state. 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 index ccb0c5055f4..c20fbb7fce4 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -23,16 +22,17 @@ 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"; -// The Game Server Deployment is used to control the deployment of Agones +// 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. + // 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" @@ -40,7 +40,7 @@ service GameServerDeploymentsService { option (google.api.method_signature) = "parent"; } - // Gets details of a single Game Server Deployment. + // Gets details of a single game server deployment. rpc GetGameServerDeployment(GetGameServerDeploymentRequest) returns (GameServerDeployment) { option (google.api.http) = { get: "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*}" @@ -48,7 +48,7 @@ service GameServerDeploymentsService { option (google.api.method_signature) = "name"; } - // Creates a new Game Server Deployment in a given project and Location. + // 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" @@ -61,19 +61,19 @@ service GameServerDeploymentsService { }; } - // Deletes a single Game Server Deployment. + // 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: "GameServerDeployment" + response_type: "google.protobuf.Empty" metadata_type: "OperationMetadata" }; } - // Patches a Game Server Deployment. + // 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/*}" @@ -86,7 +86,7 @@ service GameServerDeploymentsService { }; } - // Gets details a single Game Server Deployment Rollout. + // Gets details a single game server deployment rollout. rpc GetGameServerDeploymentRollout(GetGameServerDeploymentRolloutRequest) returns (GameServerDeploymentRollout) { option (google.api.http) = { get: "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*}/rollout" @@ -94,7 +94,12 @@ service GameServerDeploymentsService { option (google.api.method_signature) = "name"; } - // Patches a single Game Server Deployment Rollout. + // 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" @@ -107,8 +112,8 @@ service GameServerDeploymentsService { }; } - // Previews the Game Server Deployment Rollout. This API does not mutate the - // Rollout resource. + // 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" @@ -116,9 +121,9 @@ service GameServerDeploymentsService { }; } - // Retrieves information about the current state of the Game Server - // Ddeployment. Gathers all the Agones fleets and Agones autoscalers, - // including fleets running an older version of the Game Server Deployment. + // 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" 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 index 38281aa6789..f07013fb37d 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -25,6 +24,7 @@ import "google/protobuf/timestamp.proto"; import "google/api/annotations.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"; @@ -35,7 +35,7 @@ message ListRealmsRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/Realm" + child_type: "gameservices.googleapis.com/Realm" } ]; @@ -43,7 +43,7 @@ message ListRealmsRequest { // 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. + // 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, @@ -60,20 +60,20 @@ message ListRealmsRequest { // Response message for RealmsService.ListRealms. message ListRealmsResponse { - // The list of Realms. + // 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. + // 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: + // 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, @@ -90,20 +90,20 @@ message CreateRealmRequest { string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { - type: "gameservices.googleapis.com/Realm" + child_type: "gameservices.googleapis.com/Realm" } ]; - // Required. The ID of the Realm resource to be created. + // 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. + // 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: + // 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, @@ -115,7 +115,7 @@ message DeleteRealmRequest { // Request message for RealmsService.UpdateRealm. message UpdateRealmRequest { - // Required. The Realm to be updated. + // Required. The realm to be updated. // Only fields specified in update_mask are updated. Realm realm = 1 [(google.api.field_behavior) = REQUIRED]; @@ -130,7 +130,7 @@ message UpdateRealmRequest { // Request message for RealmsService.PreviewRealmUpdate. message PreviewRealmUpdateRequest { - // Required. The Realm to be updated. + // Required. The realm to be updated. // Only fields specified in update_mask are updated. Realm realm = 1 [(google.api.field_behavior) = REQUIRED]; @@ -155,14 +155,14 @@ message PreviewRealmUpdateResponse { TargetState target_state = 3; } -// A Realm resource. +// 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: + // 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; @@ -173,10 +173,10 @@ message Realm { // 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. + // 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 + // 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]; @@ -184,6 +184,6 @@ message Realm { // ETag of the resource. string etag = 7; - // Human readable description of the Realm. + // 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 index b7dfaa07cc3..446f5f5a9ff 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2019 Google LLC. +// 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. @@ -11,7 +11,6 @@ // WITHOUT 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"; @@ -23,16 +22,17 @@ 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"; -// A Realm is a grouping of Game Server Clusters that are considered +// 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. + // Lists realms in a given project and location. rpc ListRealms(ListRealmsRequest) returns (ListRealmsResponse) { option (google.api.http) = { get: "/v1beta/{parent=projects/*/locations/*}/realms" @@ -40,7 +40,7 @@ service RealmsService { option (google.api.method_signature) = "parent"; } - // Gets details of a single Realm. + // Gets details of a single realm. rpc GetRealm(GetRealmRequest) returns (Realm) { option (google.api.http) = { get: "/v1beta/{name=projects/*/locations/*/realms/*}" @@ -48,7 +48,7 @@ service RealmsService { option (google.api.method_signature) = "name"; } - // Creates a new Realm in a given project and Location. + // 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" @@ -61,19 +61,19 @@ service RealmsService { }; } - // Deletes a single Realm. + // 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: "Realm" + response_type: "google.protobuf.Empty" metadata_type: "OperationMetadata" }; } - // Patches a single Realm. + // Patches a single realm. rpc UpdateRealm(UpdateRealmRequest) returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1beta/{realm.name=projects/*/locations/*/realms/*}" @@ -86,7 +86,7 @@ service RealmsService { }; } - // Previews patches to a single Realm. + // Previews patches to a single realm. rpc PreviewRealmUpdate(PreviewRealmUpdateRequest) returns (PreviewRealmUpdateResponse) { option (google.api.http) = { patch: "/v1beta/{realm.name=projects/*/locations/*/realms/*}:previewUpdate" diff --git a/packages/google-cloud-gaming/protos/protos.json b/packages/google-cloud-gaming/protos/protos.json index acc63edae5f..5f6744bf6e6 100644 --- a/packages/google-cloud-gaming/protos/protos.json +++ b/packages/google-cloud-gaming/protos/protos.json @@ -306,7 +306,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" } }, "pageSize": { @@ -376,7 +376,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" } }, "gameServerClusterId": { @@ -401,7 +401,8 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerCluster" } }, "gameServerClusterId": { @@ -457,7 +458,8 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerCluster" } }, "previewTime": { @@ -656,7 +658,7 @@ "options": { "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/realms/*/gameServerClusters/*}", "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "GameServerCluster", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", "(google.longrunning.operation_info).metadata_type": "OperationMetadata" } }, @@ -695,7 +697,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerConfig" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerConfig" } }, "pageSize": { @@ -765,7 +767,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerConfig" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerConfig" } }, "configId": { @@ -920,7 +922,7 @@ "options": { "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*/configs/*}", "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "GameServerConfig", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", "(google.longrunning.operation_info).metadata_type": "OperationMetadata" } } @@ -933,7 +935,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerDeployment" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerDeployment" } }, "pageSize": { @@ -1015,7 +1017,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/GameServerDeployment" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/GameServerDeployment" } }, "deploymentId": { @@ -1305,7 +1307,7 @@ "options": { "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*}", "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "GameServerDeployment", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", "(google.longrunning.operation_info).metadata_type": "OperationMetadata" } }, @@ -1364,7 +1366,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/Realm" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/Realm" } }, "pageSize": { @@ -1434,7 +1436,7 @@ "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "gameservices.googleapis.com/Realm" + "(google.api.resource_reference).child_type": "gameservices.googleapis.com/Realm" } }, "realmId": { @@ -1605,7 +1607,7 @@ "options": { "(google.api.http).delete": "/v1beta/{name=projects/*/locations/*/realms/*}", "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Realm", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", "(google.longrunning.operation_info).metadata_type": "OperationMetadata" } }, 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 index ee23cce256f..36d51eafb6b 100644 --- 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 @@ -216,7 +216,7 @@ export class GameServerClustersServiceClient { '.google.cloud.gaming.v1beta.OperationMetadata' ) as gax.protobuf.Type; const deleteGameServerClusterResponse = protoFilesRoot.lookup( - '.google.cloud.gaming.v1beta.GameServerCluster' + '.google.protobuf.Empty' ) as gax.protobuf.Type; const deleteGameServerClusterMetadata = protoFilesRoot.lookup( '.google.cloud.gaming.v1beta.OperationMetadata' @@ -432,7 +432,7 @@ export class GameServerClustersServiceClient { * @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: + * 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] @@ -532,9 +532,9 @@ export class GameServerClustersServiceClient { * 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. + * 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. + * 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] @@ -634,7 +634,7 @@ export class GameServerClustersServiceClient { * @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: + * 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. @@ -735,7 +735,7 @@ export class GameServerClustersServiceClient { * @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. + * 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 @@ -849,9 +849,9 @@ export class GameServerClustersServiceClient { * 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. + * 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. + * 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. @@ -953,7 +953,7 @@ export class GameServerClustersServiceClient { ): Promise< [ LROperation< - protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -965,7 +965,7 @@ export class GameServerClustersServiceClient { options: gax.CallOptions, callback: Callback< LROperation< - protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -976,7 +976,7 @@ export class GameServerClustersServiceClient { request: protos.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, callback: Callback< LROperation< - protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -989,7 +989,7 @@ export class GameServerClustersServiceClient { * @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: + * 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. @@ -1003,7 +1003,7 @@ export class GameServerClustersServiceClient { | gax.CallOptions | Callback< LROperation< - protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -1011,7 +1011,7 @@ export class GameServerClustersServiceClient { >, callback?: Callback< LROperation< - protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -1020,7 +1020,7 @@ export class GameServerClustersServiceClient { ): Promise< [ LROperation< - protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -1068,7 +1068,7 @@ export class GameServerClustersServiceClient { name: string ): Promise< LROperation< - protos.google.cloud.gaming.v1beta.GameServerCluster, + protos.google.protobuf.Empty, protos.google.cloud.gaming.v1beta.OperationMetadata > > { @@ -1082,7 +1082,7 @@ export class GameServerClustersServiceClient { gax.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.cloud.gaming.v1beta.GameServerCluster, + protos.google.protobuf.Empty, protos.google.cloud.gaming.v1beta.OperationMetadata >; } @@ -1128,7 +1128,7 @@ export class GameServerClustersServiceClient { * @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. + * 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 @@ -1264,7 +1264,7 @@ export class GameServerClustersServiceClient { > ): void; /** - * Lists Game Server Clusters in a given project and location. + * Lists game server clusters in a given project and location. * * @param {Object} request * The request object that will be sent. @@ -1272,8 +1272,8 @@ export class GameServerClustersServiceClient { * 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, server - * will pick an appropriate default. Server may return fewer items than + * 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. @@ -1370,8 +1370,8 @@ export class GameServerClustersServiceClient { * 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, server - * will pick an appropriate default. Server may return fewer items than + * 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. @@ -1420,8 +1420,8 @@ export class GameServerClustersServiceClient { * 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, server - * will pick an appropriate default. Server may return fewer items than + * 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. 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 index f13eed1bc43..e5e66fdb13c 100644 --- 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 @@ -6,6 +6,9 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" ] }, "retry_params": { @@ -17,40 +20,57 @@ "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": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "GetGameServerCluster": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "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": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "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": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "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": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" } } } 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 index 9a32804b303..36e69a68c49 100644 --- 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 @@ -36,7 +36,7 @@ import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** - * The Game Server Config configures the game servers in an Agones fleet. + * The game server config configures the game servers in an Agones fleet. * @class * @memberof v1beta */ @@ -215,7 +215,7 @@ export class GameServerConfigsServiceClient { '.google.cloud.gaming.v1beta.OperationMetadata' ) as gax.protobuf.Type; const deleteGameServerConfigResponse = protoFilesRoot.lookup( - '.google.cloud.gaming.v1beta.GameServerConfig' + '.google.protobuf.Empty' ) as gax.protobuf.Type; const deleteGameServerConfigMetadata = protoFilesRoot.lookup( '.google.cloud.gaming.v1beta.OperationMetadata' @@ -404,12 +404,12 @@ export class GameServerConfigsServiceClient { > ): void; /** - * Gets details of a single Game Server Config. + * 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: + * Required. The name of the game server config to retrieve. Uses the form: * * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. * @param {object} [options] @@ -500,9 +500,9 @@ export class GameServerConfigsServiceClient { > ): void; /** - * 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. + * 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. @@ -511,9 +511,9 @@ export class GameServerConfigsServiceClient { * * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/`. * @param {string} request.configId - * Required. The ID of the Game Server Config resource to be created. + * 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. + * 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. @@ -615,7 +615,7 @@ export class GameServerConfigsServiceClient { ): Promise< [ LROperation< - protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -627,7 +627,7 @@ export class GameServerConfigsServiceClient { options: gax.CallOptions, callback: Callback< LROperation< - protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -638,7 +638,7 @@ export class GameServerConfigsServiceClient { request: protos.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, callback: Callback< LROperation< - protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -646,13 +646,13 @@ export class GameServerConfigsServiceClient { > ): void; /** - * Deletes a single Game Server Config. The deletion will fail if the Game - * Server Config is referenced in a Game Server Deployment Rollout. + * 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: + * Required. The name of the game server config to delete. Uses the form: * * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}`. * @param {object} [options] @@ -667,7 +667,7 @@ export class GameServerConfigsServiceClient { | gax.CallOptions | Callback< LROperation< - protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -675,7 +675,7 @@ export class GameServerConfigsServiceClient { >, callback?: Callback< LROperation< - protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -684,7 +684,7 @@ export class GameServerConfigsServiceClient { ): Promise< [ LROperation< - protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -732,7 +732,7 @@ export class GameServerConfigsServiceClient { name: string ): Promise< LROperation< - protos.google.cloud.gaming.v1beta.GameServerConfig, + protos.google.protobuf.Empty, protos.google.cloud.gaming.v1beta.OperationMetadata > > { @@ -746,7 +746,7 @@ export class GameServerConfigsServiceClient { gax.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.cloud.gaming.v1beta.GameServerConfig, + protos.google.protobuf.Empty, protos.google.cloud.gaming.v1beta.OperationMetadata >; } @@ -782,8 +782,8 @@ export class GameServerConfigsServiceClient { > ): void; /** - * Lists Game Server Configs in a given project, Location, and Game Server - * Deployment. + * Lists game server configs in a given project, location, and game server + * deployment. * * @param {Object} request * The request object that will be sent. @@ -798,7 +798,7 @@ export class GameServerConfigsServiceClient { * {@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. + * 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] @@ -893,7 +893,7 @@ export class GameServerConfigsServiceClient { * {@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. + * 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] @@ -944,7 +944,7 @@ export class GameServerConfigsServiceClient { * {@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. + * 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] 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 index 78ebd2fa491..0782290b888 100644 --- 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 @@ -6,6 +6,9 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" ] }, "retry_params": { @@ -17,22 +20,35 @@ "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": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "GetGameServerConfig": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "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_deployments_service_client.ts b/packages/google-cloud-gaming/src/v1beta/game_server_deployments_service_client.ts index 817bba9659b..b4a1fed8418 100644 --- 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 @@ -36,7 +36,7 @@ import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** - * The Game Server Deployment is used to control the deployment of Agones + * The game server deployment is used to control the deployment of Agones * fleets. * @class * @memberof v1beta @@ -216,7 +216,7 @@ export class GameServerDeploymentsServiceClient { '.google.cloud.gaming.v1beta.OperationMetadata' ) as gax.protobuf.Type; const deleteGameServerDeploymentResponse = protoFilesRoot.lookup( - '.google.cloud.gaming.v1beta.GameServerDeployment' + '.google.protobuf.Empty' ) as gax.protobuf.Type; const deleteGameServerDeploymentMetadata = protoFilesRoot.lookup( '.google.cloud.gaming.v1beta.OperationMetadata' @@ -443,12 +443,12 @@ export class GameServerDeploymentsServiceClient { > ): void; /** - * Gets details of a single Game Server Deployment. + * 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 Deployment to retrieve. Uses the form: + * Required. The name of the game server delpoyment to retrieve. Uses the form: * * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. * @param {object} [options] @@ -543,12 +543,12 @@ export class GameServerDeploymentsServiceClient { > ): void; /** - * Gets details a single Game Server Deployment Rollout. + * 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 Deployment to retrieve. Uses the form: + * Required. The name of the game server delpoyment to retrieve. Uses the form: * * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. * @param {object} [options] @@ -643,13 +643,13 @@ export class GameServerDeploymentsServiceClient { > ): void; /** - * Previews the Game Server Deployment Rollout. This API does not mutate the - * Rollout resource. + * 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. + * 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 @@ -660,7 +660,7 @@ export class GameServerDeploymentsServiceClient { * // /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. + * 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. @@ -753,14 +753,14 @@ export class GameServerDeploymentsServiceClient { > ): void; /** - * Retrieves information about the current state of the Game Server - * Ddeployment. Gathers all the Agones fleets and Agones autoscalers, - * including fleets running an older version of the Game Server Deployment. + * 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 Deployment. Uses the form: + * Required. The name of the game server delpoyment. Uses the form: * * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. * @param {object} [options] @@ -854,7 +854,7 @@ export class GameServerDeploymentsServiceClient { > ): void; /** - * Creates a new Game Server Deployment in a given project and Location. + * Creates a new game server deployment in a given project and location. * * @param {Object} request * The request object that will be sent. @@ -862,9 +862,9 @@ export class GameServerDeploymentsServiceClient { * Required. The parent resource name. Uses the form: * `projects/{project}/locations/{location}`. * @param {string} request.deploymentId - * Required. The ID of the Game Server Deployment resource to be created. + * Required. The ID of the game server delpoyment resource to be created. * @param {google.cloud.gaming.v1beta.GameServerDeployment} request.gameServerDeployment - * Required. The Game Server Deployment resource to be created. + * 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. @@ -966,7 +966,7 @@ export class GameServerDeploymentsServiceClient { ): Promise< [ LROperation< - protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -978,7 +978,7 @@ export class GameServerDeploymentsServiceClient { options: gax.CallOptions, callback: Callback< LROperation< - protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -989,7 +989,7 @@ export class GameServerDeploymentsServiceClient { request: protos.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, callback: Callback< LROperation< - protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -997,12 +997,12 @@ export class GameServerDeploymentsServiceClient { > ): void; /** - * Deletes a single Game Server Deployment. + * 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 Deployment to delete. Uses the form: + * Required. The name of the game server delpoyment to delete. Uses the form: * * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. * @param {object} [options] @@ -1017,7 +1017,7 @@ export class GameServerDeploymentsServiceClient { | gax.CallOptions | Callback< LROperation< - protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -1025,7 +1025,7 @@ export class GameServerDeploymentsServiceClient { >, callback?: Callback< LROperation< - protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -1034,7 +1034,7 @@ export class GameServerDeploymentsServiceClient { ): Promise< [ LROperation< - protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -1082,7 +1082,7 @@ export class GameServerDeploymentsServiceClient { name: string ): Promise< LROperation< - protos.google.cloud.gaming.v1beta.GameServerDeployment, + protos.google.protobuf.Empty, protos.google.cloud.gaming.v1beta.OperationMetadata > > { @@ -1096,7 +1096,7 @@ export class GameServerDeploymentsServiceClient { gax.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.cloud.gaming.v1beta.GameServerDeployment, + protos.google.protobuf.Empty, protos.google.cloud.gaming.v1beta.OperationMetadata >; } @@ -1137,12 +1137,12 @@ export class GameServerDeploymentsServiceClient { > ): void; /** - * Patches a Game Server Deployment. + * 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 Deployment to be updated. + * 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 @@ -1283,12 +1283,17 @@ export class GameServerDeploymentsServiceClient { > ): void; /** - * Patches a single Game Server Deployment Rollout. + * 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 Deployment Rollout to be updated. + * 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 @@ -1424,7 +1429,7 @@ export class GameServerDeploymentsServiceClient { > ): void; /** - * Lists Game Server Deployments in a given project and Location. + * Lists game server deployments in a given project and location. * * @param {Object} request * The request object that will be sent. @@ -1432,8 +1437,8 @@ export class GameServerDeploymentsServiceClient { * 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 + * 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. @@ -1531,8 +1536,8 @@ export class GameServerDeploymentsServiceClient { * 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 + * 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. @@ -1582,8 +1587,8 @@ export class GameServerDeploymentsServiceClient { * 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 + * 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. 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 index ace93ff10cc..8c0ada7f727 100644 --- 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 @@ -6,6 +6,9 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" ] }, "retry_params": { @@ -17,44 +20,62 @@ "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": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "GetGameServerDeployment": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "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": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "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": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "FetchDeploymentState": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" } } } diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index 5d4c1b50a42..b32c2761e71 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -36,7 +36,7 @@ import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** - * A Realm is a grouping of Game Server Clusters that are considered + * A realm is a grouping of game server clusters that are considered * interchangeable. * @class * @memberof v1beta @@ -214,7 +214,7 @@ export class RealmsServiceClient { '.google.cloud.gaming.v1beta.OperationMetadata' ) as gax.protobuf.Type; const deleteRealmResponse = protoFilesRoot.lookup( - '.google.cloud.gaming.v1beta.Realm' + '.google.protobuf.Empty' ) as gax.protobuf.Type; const deleteRealmMetadata = protoFilesRoot.lookup( '.google.cloud.gaming.v1beta.OperationMetadata' @@ -403,12 +403,12 @@ export class RealmsServiceClient { > ): void; /** - * Gets details of a single Realm. + * 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: + * 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. @@ -488,12 +488,12 @@ export class RealmsServiceClient { > ): void; /** - * Previews patches to a single Realm. + * 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. + * 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` @@ -592,7 +592,7 @@ export class RealmsServiceClient { > ): void; /** - * Creates a new Realm in a given project and Location. + * Creates a new realm in a given project and location. * * @param {Object} request * The request object that will be sent. @@ -600,9 +600,9 @@ export class RealmsServiceClient { * 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. + * 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. + * 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. @@ -700,7 +700,7 @@ export class RealmsServiceClient { ): Promise< [ LROperation< - protos.google.cloud.gaming.v1beta.IRealm, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -712,7 +712,7 @@ export class RealmsServiceClient { options: gax.CallOptions, callback: Callback< LROperation< - protos.google.cloud.gaming.v1beta.IRealm, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -723,7 +723,7 @@ export class RealmsServiceClient { request: protos.google.cloud.gaming.v1beta.IDeleteRealmRequest, callback: Callback< LROperation< - protos.google.cloud.gaming.v1beta.IRealm, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -731,12 +731,12 @@ export class RealmsServiceClient { > ): void; /** - * Deletes a single Realm. + * 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: + * 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. @@ -750,7 +750,7 @@ export class RealmsServiceClient { | gax.CallOptions | Callback< LROperation< - protos.google.cloud.gaming.v1beta.IRealm, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -758,7 +758,7 @@ export class RealmsServiceClient { >, callback?: Callback< LROperation< - protos.google.cloud.gaming.v1beta.IRealm, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -767,7 +767,7 @@ export class RealmsServiceClient { ): Promise< [ LROperation< - protos.google.cloud.gaming.v1beta.IRealm, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -811,7 +811,7 @@ export class RealmsServiceClient { name: string ): Promise< LROperation< - protos.google.cloud.gaming.v1beta.Realm, + protos.google.protobuf.Empty, protos.google.cloud.gaming.v1beta.OperationMetadata > > { @@ -825,7 +825,7 @@ export class RealmsServiceClient { gax.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.cloud.gaming.v1beta.Realm, + protos.google.protobuf.Empty, protos.google.cloud.gaming.v1beta.OperationMetadata >; } @@ -866,12 +866,12 @@ export class RealmsServiceClient { > ): void; /** - * Patches a single Realm. + * 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. + * 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` @@ -999,7 +999,7 @@ export class RealmsServiceClient { > ): void; /** - * Lists Realms in a given project and Location. + * Lists realms in a given project and location. * * @param {Object} request * The request object that will be sent. @@ -1011,7 +1011,7 @@ export class RealmsServiceClient { * 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. + * 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. @@ -1104,7 +1104,7 @@ export class RealmsServiceClient { * 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. + * 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. @@ -1155,7 +1155,7 @@ export class RealmsServiceClient { * 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. + * 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. 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 index 9d42f97a616..fc607b80a10 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client_config.json +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client_config.json @@ -6,6 +6,9 @@ "idempotent": [ "DEADLINE_EXCEEDED", "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" ] }, "retry_params": { @@ -17,32 +20,47 @@ "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": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "GetRealm": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "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": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" } } } diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index e2d9cc4b452..720d0fa5bc5 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -3,34 +3,26 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "1652d07415c7ea54c8de8a2cb7c68191436776d5" - } - }, - { - "git": { - "name": "googleapis-private", - "remote": "https://github.com/googleapis/googleapis-private.git", - "sha": "dfbc67c8c1f91957abe96da943d90fe8101addf1", - "internalRef": "309845930" + "remote": "git@github.com:googleapis/nodejs-game-servers.git", + "sha": "5e24f3dc67ec1b42c81fa3151b3a13321d673f9f" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "b10590a4a1568548dd13cfcea9aa11d40898144b" + "sha": "303271797a360f8a439203413f13a160f2f5b3b4" } } ], "destinations": [ { "client": { - "source": "googleapis-private", - "apiName": "gameservices", - "apiVersion": "v1beta1", - "language": "typescript", - "generator": "gapic-generator-typescript" + "source": "googleapis", + "apiName": "gaming", + "apiVersion": "v1beta", + "language": "nodejs", + "generator": "bazel" } } ] diff --git a/packages/google-cloud-gaming/synth.py b/packages/google-cloud-gaming/synth.py index 8ef89f941dd..5a083000653 100644 --- a/packages/google-cloud-gaming/synth.py +++ b/packages/google-cloud-gaming/synth.py @@ -21,17 +21,10 @@ AUTOSYNTH_MULTIPLE_COMMITS = True # run the gapic generator -gapic = gcp.GAPICMicrogenerator() -versions = ['v1beta1'] +gapic = gcp.GAPICBazel() +versions = ['v1beta'] for version in versions: - library = gapic.typescript_library( - 'gameservices', - generator_args={ - 'package-name': '@google-cloud/game-servers' - }, - proto_path='/google/cloud/gaming/v1beta', - private=True, - version=version) + library = gapic.node_library('gaming', version) s.copy(library, excludes=['package.json', 'README.md']) # Copy common templates common_templates = gcp.CommonTemplates() 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 index b1161d90f32..7fea1857878 100644 --- 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 @@ -1014,7 +1014,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { ( err?: Error | null, result?: LROperation< - protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata > | null ) => { @@ -1027,7 +1027,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.gaming.v1beta.IGameServerCluster, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >; const [response] = await operation.promise(); 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 index fdf20c0248a..ff53460b0ed 100644 --- 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 @@ -641,7 +641,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { ( err?: Error | null, result?: LROperation< - protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata > | null ) => { @@ -654,7 +654,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.gaming.v1beta.IGameServerConfig, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >; const [response] = await operation.promise(); 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 index 8e17f7577d4..9f34191931d 100644 --- 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 @@ -1016,7 +1016,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ( err?: Error | null, result?: LROperation< - protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata > | null ) => { @@ -1029,7 +1029,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.gaming.v1beta.IGameServerDeployment, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >; const [response] = await operation.promise(); diff --git a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts index ca654d35369..ca9daa24232 100644 --- a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts @@ -708,7 +708,7 @@ describe('v1beta.RealmsServiceClient', () => { ( err?: Error | null, result?: LROperation< - protos.google.cloud.gaming.v1beta.IRealm, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata > | null ) => { @@ -721,7 +721,7 @@ describe('v1beta.RealmsServiceClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.gaming.v1beta.IRealm, + protos.google.protobuf.IEmpty, protos.google.cloud.gaming.v1beta.IOperationMetadata >; const [response] = await operation.promise(); From 95112cec733aef7ff6c497251fcbc385942e998e Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 10 Jul 2020 01:14:15 +0000 Subject: [PATCH 047/180] chore: release 2.0.2 (#82) :robot: I have created a release \*beep\* \*boop\* --- ### [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)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- packages/google-cloud-gaming/CHANGELOG.md | 7 +++++++ packages/google-cloud-gaming/package.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index c4011b18c86..edb08a336fb 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index ec3ea9aba78..a5e0bf5156e 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "2.0.1", + "version": "2.0.2", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index 9b6401e6c3e..92c20f638de 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^2.0.1" + "@google-cloud/game-servers": "^2.0.2" }, "devDependencies": { "c8": "^7.0.0", From 6104838fffc3fde830a151e97283ec298f14d06d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jul 2020 18:50:08 +0200 Subject: [PATCH 048/180] chore(deps): update dependency ts-loader to v8 (#83) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [ts-loader](https://togithub.com/TypeStrong/ts-loader) | devDependencies | major | [`^7.0.0` -> `^8.0.0`](https://renovatebot.com/diffs/npm/ts-loader/7.0.5/8.0.0) | --- ### Release Notes
TypeStrong/ts-loader ### [`v8.0.0`](https://togithub.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md#v800) [Compare Source](https://togithub.com/TypeStrong/ts-loader/compare/v7.0.5...v8.0.0) - [Support for symlinks in project references](https://togithub.com/TypeStrong/ts-loader/pull/1136) - thanks [@​sheetalkamat](https://togithub.com/sheetalkamat)! - `ts-loader` now supports TypeScript 3.6 and greater **BREAKING CHANGE**
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index a5e0bf5156e..f051b677223 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -43,7 +43,7 @@ "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^9.0.1", - "ts-loader": "^7.0.0", + "ts-loader": "^8.0.0", "typescript": "^3.8.3", "webpack": "^4.41.2", "webpack-cli": "^3.3.10" From a0293aed6e4f660208411cefd98b33cba060e66d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 10 Jul 2020 15:43:02 -0700 Subject: [PATCH 049/180] build: typo in gitattribute (#85) * changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. * fix: typeo in nodejs .gitattribute replace `test` to `text` Source-Author: Summer Ji Source-Date: Wed Jul 8 14:02:57 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b Source-Link: https://github.com/googleapis/synthtool/commit/799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- packages/google-cloud-gaming/.gitattributes | 3 +++ packages/google-cloud-gaming/synth.metadata | 14 +++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 packages/google-cloud-gaming/.gitattributes diff --git a/packages/google-cloud-gaming/.gitattributes b/packages/google-cloud-gaming/.gitattributes new file mode 100644 index 00000000000..d4f4169b28b --- /dev/null +++ b/packages/google-cloud-gaming/.gitattributes @@ -0,0 +1,3 @@ +*.ts text eol=lf +*.js text eol=lf +protos/* linguist-generated diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 720d0fa5bc5..0f6a8b516a9 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -3,15 +3,23 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-game-servers.git", - "sha": "5e24f3dc67ec1b42c81fa3151b3a13321d673f9f" + "remote": "https://github.com/googleapis/nodejs-game-servers.git", + "sha": "e9466329399c62c0f6f49a713f68ecf8ef96213b" + } + }, + { + "git": { + "name": "googleapis", + "remote": "https://github.com/googleapis/googleapis.git", + "sha": "4f4aa3a03e470f1390758b9d89eb1aa88837a5be", + "internalRef": "320300472" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "303271797a360f8a439203413f13a160f2f5b3b4" + "sha": "799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b" } } ], From 100c9b5c90cb173b5c148f3ae7252ad601aa8f92 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 12 Jul 2020 18:47:00 +0200 Subject: [PATCH 050/180] chore(deps): update dependency @types/mocha to v8 (#86) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@types/mocha](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | devDependencies | major | [`^7.0.0` -> `^8.0.0`](https://renovatebot.com/diffs/npm/@types%2fmocha/7.0.2/8.0.0) | --- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index f051b677223..017535e6944 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -30,7 +30,7 @@ "google-gax": "^2.1.0" }, "devDependencies": { - "@types/mocha": "^7.0.0", + "@types/mocha": "^8.0.0", "@types/node": "^12.0.0", "@types/sinon": "^9.0.0", "c8": "^7.0.0", From 91da2086a54d03901743ce9b7ea335b682cf2e65 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 14 Jul 2020 17:34:52 -0700 Subject: [PATCH 051/180] chore: update generated protos.js (#88) --- packages/google-cloud-gaming/protos/protos.js | 144 ++++++++++++++---- packages/google-cloud-gaming/synth.metadata | 2 +- 2 files changed, 115 insertions(+), 31 deletions(-) diff --git a/packages/google-cloud-gaming/protos/protos.js b/packages/google-cloud-gaming/protos/protos.js index 570d830a389..644c52844d7 100644 --- a/packages/google-cloud-gaming/protos/protos.js +++ b/packages/google-cloud-gaming/protos/protos.js @@ -248,7 +248,7 @@ 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; + 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) { @@ -279,12 +279,26 @@ message.unreachable.push(reader.string()); break; case 9: - reader.skip().pos++; if (message.operationStatus === $util.emptyObject) message.operationStatus = {}; - key = reader.string(); - reader.pos++; - message.operationStatus[key] = $root.google.cloud.gaming.v1beta.OperationStatus.decode(reader, reader.uint32()); + 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); @@ -849,17 +863,31 @@ 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; + 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: - reader.skip().pos++; if (message.labels === $util.emptyObject) message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); + 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); @@ -7117,7 +7145,7 @@ 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; + 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) { @@ -7131,12 +7159,26 @@ message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 4: - reader.skip().pos++; if (message.labels === $util.emptyObject) message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); + 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()); @@ -9442,7 +9484,7 @@ 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; + 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) { @@ -9456,12 +9498,26 @@ message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 4: - reader.skip().pos++; if (message.labels === $util.emptyObject) message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); + 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)) @@ -12439,7 +12495,7 @@ 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; + 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) { @@ -12453,12 +12509,26 @@ message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 4: - reader.skip().pos++; if (message.labels === $util.emptyObject) message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); + 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(); @@ -16030,7 +16100,7 @@ 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; + 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) { @@ -16044,12 +16114,26 @@ message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; case 4: - reader.skip().pos++; if (message.labels === $util.emptyObject) message.labels = {}; - key = reader.string(); - reader.pos++; - message.labels[key] = reader.string(); + 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(); diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 0f6a8b516a9..c30ffaa5f99 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "e9466329399c62c0f6f49a713f68ecf8ef96213b" + "sha": "8003c1a43e6982ed751ff5c6b1b81b8426826758" } }, { From 65b372626d8456b4ee62f330966b2e1479c9cf6a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 14 Jul 2020 17:43:04 -0700 Subject: [PATCH 052/180] build: missing closing paren in publish script (#89) --- packages/google-cloud-gaming/synth.metadata | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index c30ffaa5f99..d5fc69314f6 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "799d8e6522c1ef7cb55a70d9ea0b15e045c3d00b" + "sha": "d82deccf657a66e31bd5da9efdb96c6fa322fc7e" } } ], From ca119c224f8390a7951f3856e13fa9d47df40509 Mon Sep 17 00:00:00 2001 From: pooneh-m <46979170+pooneh-m@users.noreply.github.com> Date: Thu, 16 Jul 2020 09:31:19 -0700 Subject: [PATCH 053/180] docs(samples): Add Game Server deployment samples (#92) Co-authored-by: Justin Beckwith --- .../google-cloud-gaming/samples/README.md | 84 +++++++++++++++++-- .../google-cloud-gaming/samples/package.json | 2 +- 2 files changed, 77 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-gaming/samples/README.md b/packages/google-cloud-gaming/samples/README.md index f6806b8e41c..7f38b048977 100644 --- a/packages/google-cloud-gaming/samples/README.md +++ b/packages/google-cloud-gaming/samples/README.md @@ -46,7 +46,7 @@ View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/ma __Usage:__ -`node samples/create_cluster.js` +`node samples/create_cluster.js ` ----- @@ -63,7 +63,24 @@ View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/ma __Usage:__ -`node samples/create_realm.js` +`node samples/create_realm.js ` + + +----- + + + + +### Create_deployment + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_deployment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_deployment.js,samples/README.md) + +__Usage:__ + + +`node samples/create_deployment.js ` ----- @@ -80,7 +97,7 @@ View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/ma __Usage:__ -`node samples/delete_cluster.js` +`node samples/delete_cluster.js ` ----- @@ -97,7 +114,24 @@ View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/ma __Usage:__ -`node samples/delete_realm.js` +`node samples/delete_realm.js ` + + +----- + + + + +### Delete_deployment + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_deployment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_deployment.js,samples/README.md) + +__Usage:__ + + +`node samples/delete_deployment.js ` ----- @@ -114,7 +148,7 @@ View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/ma __Usage:__ -`node samples/get_cluster.js` +`node samples/get_cluster.js ` ----- @@ -131,7 +165,24 @@ View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/ma __Usage:__ -`node samples/get_realm.js` +`node samples/get_realm.js ` + + +----- + + + + +### Get_deployment + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_deployment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_deployment.js,samples/README.md) + +__Usage:__ + + +`node samples/get_deployment.js ` ----- @@ -148,7 +199,7 @@ View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/ma __Usage:__ -`node samples/list_clusters.js` +`node samples/list_clusters.js ` ----- @@ -165,7 +216,24 @@ View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/ma __Usage:__ -`node samples/list_realms.js` +`node samples/list_realms.js ` + + +----- + + + + +### List_deployments + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_deployments.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_deployments.js,samples/README.md) + +__Usage:__ + + +`node samples/list_deployments.js ` ----- diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index 92c20f638de..d6364f03a04 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -16,7 +16,7 @@ "@google-cloud/game-servers": "^2.0.2" }, "devDependencies": { - "c8": "^7.0.0", + "c8": "^7.2.1", "chai": "^4.2.0", "mocha": "^8.0.0", "uuid": "^8.0.0" From 7a787a12b4003723a45b42ab0661e679ffb3a389 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 17 Jul 2020 15:44:35 -0700 Subject: [PATCH 054/180] chore: updates to readme, add Node8 tests --- packages/google-cloud-gaming/README.md | 4 + .../google-cloud-gaming/samples/README.md | 76 ++++++++++--------- packages/google-cloud-gaming/synth.metadata | 2 +- 3 files changed, 45 insertions(+), 37 deletions(-) diff --git a/packages/google-cloud-gaming/README.md b/packages/google-cloud-gaming/README.md index 03400819ee6..3d769c319ab 100644 --- a/packages/google-cloud-gaming/README.md +++ b/packages/google-cloud-gaming/README.md @@ -100,12 +100,16 @@ has instructions for running the samples. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | | Create_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_cluster.js,samples/README.md) | +| Create_deployment | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_deployment.js,samples/README.md) | | Create_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_realm.js,samples/README.md) | | Delete_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_cluster.js,samples/README.md) | +| Delete_deployment | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_deployment.js,samples/README.md) | | Delete_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_realm.js,samples/README.md) | | Get_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_cluster.js,samples/README.md) | +| Get_deployment | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_deployment.js,samples/README.md) | | Get_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_realm.js,samples/README.md) | | List_clusters | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_clusters.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_clusters.js,samples/README.md) | +| List_deployments | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_deployments.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_deployments.js,samples/README.md) | | List_realms | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_realms.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_realms.js,samples/README.md) | | Create Game Server Realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | diff --git a/packages/google-cloud-gaming/samples/README.md b/packages/google-cloud-gaming/samples/README.md index 7f38b048977..f95bdb3e711 100644 --- a/packages/google-cloud-gaming/samples/README.md +++ b/packages/google-cloud-gaming/samples/README.md @@ -13,12 +13,16 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) * [Create_cluster](#create_cluster) + * [Create_deployment](#create_deployment) * [Create_realm](#create_realm) * [Delete_cluster](#delete_cluster) + * [Delete_deployment](#delete_deployment) * [Delete_realm](#delete_realm) * [Get_cluster](#get_cluster) + * [Get_deployment](#get_deployment) * [Get_realm](#get_realm) * [List_clusters](#list_clusters) + * [List_deployments](#list_deployments) * [List_realms](#list_realms) * [Create Game Server Realm](#create-game-server-realm) @@ -46,7 +50,7 @@ View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/ma __Usage:__ -`node samples/create_cluster.js ` +`node samples/create_cluster.js` ----- @@ -54,16 +58,16 @@ __Usage:__ -### Create_realm +### Create_deployment -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_realm.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_deployment.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_realm.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_deployment.js,samples/README.md) __Usage:__ -`node samples/create_realm.js ` +`node samples/create_deployment.js` ----- @@ -71,16 +75,16 @@ __Usage:__ -### Create_deployment +### Create_realm -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_deployment.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_realm.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_deployment.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_realm.js,samples/README.md) __Usage:__ -`node samples/create_deployment.js ` +`node samples/create_realm.js` ----- @@ -97,7 +101,7 @@ View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/ma __Usage:__ -`node samples/delete_cluster.js ` +`node samples/delete_cluster.js` ----- @@ -105,16 +109,16 @@ __Usage:__ -### Delete_realm +### Delete_deployment -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_realm.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_deployment.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_realm.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_deployment.js,samples/README.md) __Usage:__ -`node samples/delete_realm.js ` +`node samples/delete_deployment.js` ----- @@ -122,16 +126,16 @@ __Usage:__ -### Delete_deployment +### Delete_realm -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_deployment.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_realm.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_deployment.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_realm.js,samples/README.md) __Usage:__ -`node samples/delete_deployment.js ` +`node samples/delete_realm.js` ----- @@ -148,7 +152,7 @@ View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/ma __Usage:__ -`node samples/get_cluster.js ` +`node samples/get_cluster.js` ----- @@ -156,16 +160,16 @@ __Usage:__ -### Get_realm +### Get_deployment -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_realm.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_deployment.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_realm.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_deployment.js,samples/README.md) __Usage:__ -`node samples/get_realm.js ` +`node samples/get_deployment.js` ----- @@ -173,16 +177,16 @@ __Usage:__ -### Get_deployment +### Get_realm -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_deployment.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_realm.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_deployment.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_realm.js,samples/README.md) __Usage:__ -`node samples/get_deployment.js ` +`node samples/get_realm.js` ----- @@ -199,7 +203,7 @@ View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/ma __Usage:__ -`node samples/list_clusters.js ` +`node samples/list_clusters.js` ----- @@ -207,16 +211,16 @@ __Usage:__ -### List_realms +### List_deployments -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_realms.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_deployments.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_realms.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_deployments.js,samples/README.md) __Usage:__ -`node samples/list_realms.js ` +`node samples/list_deployments.js` ----- @@ -224,16 +228,16 @@ __Usage:__ -### List_deployments +### List_realms -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_deployments.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_realms.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_deployments.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_realms.js,samples/README.md) __Usage:__ -`node samples/list_deployments.js ` +`node samples/list_realms.js` ----- diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index d5fc69314f6..91b4b0064fb 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "8003c1a43e6982ed751ff5c6b1b81b8426826758" + "sha": "b5f4c987261711fe2aaf56f98156cadc94c6a1f7" } }, { From f9e2800168b6816215ddeeeb0f23376db0316cc7 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Tue, 21 Jul 2020 14:46:00 -0400 Subject: [PATCH 055/180] chore: add dev dependencies for cloud-rad ref docs (#103) --- packages/google-cloud-gaming/package.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 017535e6944..05a7bc1418e 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -24,7 +24,9 @@ "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "test": "c8 mocha build/test", "prelint": "cd samples; npm link ../; npm install", - "precompile": "gts clean" + "precompile": "gts clean", + "api-extractor": "api-extractor run --local", + "api-documenter": "api-documenter yaml --input-folder=temp" }, "dependencies": { "google-gax": "^2.1.0" @@ -46,7 +48,9 @@ "ts-loader": "^8.0.0", "typescript": "^3.8.3", "webpack": "^4.41.2", - "webpack-cli": "^3.3.10" + "webpack-cli": "^3.3.10", + "@microsoft/api-documenter": "^7.8.10", + "@microsoft/api-extractor": "^7.8.10" }, "engines": { "node": ">=10" From 73194f6cfbbf80e7676865d0e84e6a2a4aa69ae1 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 24 Jul 2020 11:28:03 -0700 Subject: [PATCH 056/180] chore: add config files for cloud-rad for node.js, delete Node 8 templates (#101) --- .../google-cloud-gaming/api-extractor.json | 369 ++++++++++++++++++ packages/google-cloud-gaming/synth.metadata | 2 +- 2 files changed, 370 insertions(+), 1 deletion(-) create mode 100644 packages/google-cloud-gaming/api-extractor.json diff --git a/packages/google-cloud-gaming/api-extractor.json b/packages/google-cloud-gaming/api-extractor.json new file mode 100644 index 00000000000..de228294b23 --- /dev/null +++ b/packages/google-cloud-gaming/api-extractor.json @@ -0,0 +1,369 @@ +/** + * Config file for API Extractor. For more info, please visit: https://api-extractor.com + */ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + + /** + * Optionally specifies another JSON config file that this file extends from. This provides a way for + * standard settings to be shared across multiple projects. + * + * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains + * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be + * resolved using NodeJS require(). + * + * SUPPORTED TOKENS: none + * DEFAULT VALUE: "" + */ + // "extends": "./shared/api-extractor-base.json" + // "extends": "my-package/include/api-extractor-base.json" + + /** + * Determines the "" token that can be used with other config file settings. The project folder + * typically contains the tsconfig.json and package.json config files, but the path is user-defined. + * + * The path is resolved relative to the folder of the config file that contains the setting. + * + * The default value for "projectFolder" is the token "", which means the folder is determined by traversing + * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder + * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error + * will be reported. + * + * SUPPORTED TOKENS: + * DEFAULT VALUE: "" + */ + // "projectFolder": "..", + + /** + * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor + * analyzes the symbols exported by this module. + * + * The file extension must be ".d.ts" and not ".ts". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + */ + "mainEntryPointFilePath": "/protos/protos.d.ts", + + /** + * A list of NPM package names whose exports should be treated as part of this package. + * + * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", + * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part + * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly + * imports library2. To avoid this, we can specify: + * + * "bundledPackages": [ "library2" ], + * + * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been + * local files for library1. + */ + "bundledPackages": [ ], + + /** + * Determines how the TypeScript compiler engine will be invoked by API Extractor. + */ + "compiler": { + /** + * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * Note: This setting will be ignored if "overrideTsconfig" is used. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/tsconfig.json" + */ + // "tsconfigFilePath": "/tsconfig.json", + + /** + * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. + * The object must conform to the TypeScript tsconfig schema: + * + * http://json.schemastore.org/tsconfig + * + * If omitted, then the tsconfig.json file will be read from the "projectFolder". + * + * DEFAULT VALUE: no overrideTsconfig section + */ + // "overrideTsconfig": { + // . . . + // } + + /** + * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended + * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when + * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses + * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. + * + * DEFAULT VALUE: false + */ + // "skipLibCheck": true, + }, + + /** + * Configures how the API report file (*.api.md) will be generated. + */ + "apiReport": { + /** + * (REQUIRED) Whether to generate an API report. + */ + "enabled": true, + + /** + * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce + * a full file path. + * + * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". + * + * SUPPORTED TOKENS: , + * DEFAULT VALUE: ".api.md" + */ + // "reportFileName": ".api.md", + + /** + * Specifies the folder where the API report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, + * e.g. for an API review. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/etc/" + */ + // "reportFolder": "/etc/", + + /** + * Specifies the folder where the temporary report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * After the temporary file is written to disk, it is compared with the file in the "reportFolder". + * If they are different, a production build will fail. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/" + */ + // "reportTempFolder": "/temp/" + }, + + /** + * Configures how the doc model file (*.api.json) will be generated. + */ + "docModel": { + /** + * (REQUIRED) Whether to generate a doc model file. + */ + "enabled": true, + + /** + * The output path for the doc model file. The file extension should be ".api.json". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/.api.json" + */ + // "apiJsonFilePath": "/temp/.api.json" + }, + + /** + * Configures how the .d.ts rollup file will be generated. + */ + "dtsRollup": { + /** + * (REQUIRED) Whether to generate the .d.ts rollup file. + */ + "enabled": true, + + /** + * Specifies the output path for a .d.ts rollup file to be generated without any trimming. + * This file will include all declarations that are exported by the main entry point. + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/dist/.d.ts" + */ + // "untrimmedFilePath": "/dist/.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. + * This file will include only declarations that are marked as "@public" or "@beta". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "betaTrimmedFilePath": "/dist/-beta.d.ts", + + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. + * This file will include only declarations that are marked as "@public". + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "publicTrimmedFilePath": "/dist/-public.d.ts", + + /** + * When a declaration is trimmed, by default it will be replaced by a code comment such as + * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the + * declaration completely. + * + * DEFAULT VALUE: false + */ + // "omitTrimmingComments": true + }, + + /** + * Configures how the tsdoc-metadata.json file will be generated. + */ + "tsdocMetadata": { + /** + * Whether to generate the tsdoc-metadata.json file. + * + * DEFAULT VALUE: true + */ + // "enabled": true, + + /** + * Specifies where the TSDoc metadata file should be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", + * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup + * falls back to "tsdoc-metadata.json" in the package folder. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" + }, + + /** + * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files + * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. + * To use the OS's default newline kind, specify "os". + * + * DEFAULT VALUE: "crlf" + */ + // "newlineKind": "crlf", + + /** + * Configures how API Extractor reports error and warning messages produced during analysis. + * + * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. + */ + "messages": { + /** + * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing + * the input .d.ts files. + * + * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "compilerMessageReporting": { + /** + * Configures the default routing for messages that don't match an explicit rule in this table. + */ + "default": { + /** + * Specifies whether the message should be written to the the tool's output log. Note that + * the "addToApiReportFile" property may supersede this option. + * + * Possible values: "error", "warning", "none" + * + * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail + * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes + * the "--local" option), the warning is displayed but the build will not fail. + * + * DEFAULT VALUE: "warning" + */ + "logLevel": "warning", + + /** + * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), + * then the message will be written inside that file; otherwise, the message is instead logged according to + * the "logLevel" option. + * + * DEFAULT VALUE: false + */ + // "addToApiReportFile": false + }, + + // "TS2551": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by API Extractor during its analysis. + * + * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" + * + * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings + */ + "extractorMessageReporting": { + "default": { + "logLevel": "warning", + // "addToApiReportFile": false + }, + + // "ae-extra-release-tag": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by the TSDoc parser when analyzing code comments. + * + * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "tsdocMessageReporting": { + "default": { + "logLevel": "warning", + // "addToApiReportFile": false + } + + // "tsdoc-link-tag-unescaped-text": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + } + } + +} diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 91b4b0064fb..73f7b56a454 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "d82deccf657a66e31bd5da9efdb96c6fa322fc7e" + "sha": "21f1470ecd01424dc91c70f1a7c798e4e87d1eec" } } ], From f51799c4d5cc188eabcc4e9592aee0434ca1325d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 25 Jul 2020 10:46:41 -0700 Subject: [PATCH 057/180] docs: update README with additional samples (#104) --- packages/google-cloud-gaming/README.md | 9 + .../google-cloud-gaming/samples/README.md | 162 ++++++++++++++++++ packages/google-cloud-gaming/synth.metadata | 2 +- 3 files changed, 172 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/README.md b/packages/google-cloud-gaming/README.md index 3d769c319ab..8417f2a2fbc 100644 --- a/packages/google-cloud-gaming/README.md +++ b/packages/google-cloud-gaming/README.md @@ -100,18 +100,27 @@ has instructions for running the samples. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | | Create_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_cluster.js,samples/README.md) | +| Create_config | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_config.js,samples/README.md) | | Create_deployment | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_deployment.js,samples/README.md) | | Create_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_realm.js,samples/README.md) | | Delete_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_cluster.js,samples/README.md) | +| Delete_config | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_config.js,samples/README.md) | | Delete_deployment | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_deployment.js,samples/README.md) | | Delete_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_realm.js,samples/README.md) | | Get_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_cluster.js,samples/README.md) | +| Get_config | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_config.js,samples/README.md) | | Get_deployment | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_deployment.js,samples/README.md) | | Get_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_realm.js,samples/README.md) | +| Get_rollout | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_rollout.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_rollout.js,samples/README.md) | | List_clusters | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_clusters.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_clusters.js,samples/README.md) | +| List_configs | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_configs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_configs.js,samples/README.md) | | List_deployments | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_deployments.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_deployments.js,samples/README.md) | | List_realms | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_realms.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_realms.js,samples/README.md) | | Create Game Server Realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Update_rollout_default | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/update_rollout_default.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_default.js,samples/README.md) | +| Update_rollout_override | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/update_rollout_override.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_override.js,samples/README.md) | +| Update_rollout_remove_default | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/update_rollout_remove_default.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_remove_default.js,samples/README.md) | +| Update_rollout_remove_override | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/update_rollout_remove_override.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_remove_override.js,samples/README.md) | diff --git a/packages/google-cloud-gaming/samples/README.md b/packages/google-cloud-gaming/samples/README.md index f95bdb3e711..49270a08135 100644 --- a/packages/google-cloud-gaming/samples/README.md +++ b/packages/google-cloud-gaming/samples/README.md @@ -13,18 +13,27 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) * [Create_cluster](#create_cluster) + * [Create_config](#create_config) * [Create_deployment](#create_deployment) * [Create_realm](#create_realm) * [Delete_cluster](#delete_cluster) + * [Delete_config](#delete_config) * [Delete_deployment](#delete_deployment) * [Delete_realm](#delete_realm) * [Get_cluster](#get_cluster) + * [Get_config](#get_config) * [Get_deployment](#get_deployment) * [Get_realm](#get_realm) + * [Get_rollout](#get_rollout) * [List_clusters](#list_clusters) + * [List_configs](#list_configs) * [List_deployments](#list_deployments) * [List_realms](#list_realms) * [Create Game Server Realm](#create-game-server-realm) + * [Update_rollout_default](#update_rollout_default) + * [Update_rollout_override](#update_rollout_override) + * [Update_rollout_remove_default](#update_rollout_remove_default) + * [Update_rollout_remove_override](#update_rollout_remove_override) ## Before you begin @@ -58,6 +67,23 @@ __Usage:__ +### Create_config + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_config.js,samples/README.md) + +__Usage:__ + + +`node samples/create_config.js` + + +----- + + + + ### Create_deployment View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_deployment.js). @@ -109,6 +135,23 @@ __Usage:__ +### Delete_config + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_config.js,samples/README.md) + +__Usage:__ + + +`node samples/delete_config.js` + + +----- + + + + ### Delete_deployment View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_deployment.js). @@ -160,6 +203,23 @@ __Usage:__ +### Get_config + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_config.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_config.js,samples/README.md) + +__Usage:__ + + +`node samples/get_config.js` + + +----- + + + + ### Get_deployment View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_deployment.js). @@ -194,6 +254,23 @@ __Usage:__ +### Get_rollout + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_rollout.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_rollout.js,samples/README.md) + +__Usage:__ + + +`node samples/get_rollout.js` + + +----- + + + + ### List_clusters View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_clusters.js). @@ -211,6 +288,23 @@ __Usage:__ +### List_configs + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_configs.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_configs.js,samples/README.md) + +__Usage:__ + + +`node samples/list_configs.js` + + +----- + + + + ### List_deployments View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_deployments.js). @@ -259,6 +353,74 @@ __Usage:__ `node quickstart.js ` +----- + + + + +### Update_rollout_default + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/update_rollout_default.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_default.js,samples/README.md) + +__Usage:__ + + +`node samples/update_rollout_default.js` + + +----- + + + + +### Update_rollout_override + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/update_rollout_override.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_override.js,samples/README.md) + +__Usage:__ + + +`node samples/update_rollout_override.js` + + +----- + + + + +### Update_rollout_remove_default + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/update_rollout_remove_default.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_remove_default.js,samples/README.md) + +__Usage:__ + + +`node samples/update_rollout_remove_default.js` + + +----- + + + + +### Update_rollout_remove_override + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/update_rollout_remove_override.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_remove_override.js,samples/README.md) + +__Usage:__ + + +`node samples/update_rollout_remove_override.js` + + diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 73f7b56a454..6d64e66084a 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "b5f4c987261711fe2aaf56f98156cadc94c6a1f7" + "sha": "d2d9a64c75f682b954b0da8e4d509c9827b1a4f4" } }, { From c628df0e80daf8e7afbec5705f97b16122693849 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 27 Jul 2020 12:36:40 -0700 Subject: [PATCH 058/180] build: update gitattributes and docs release scripts (#105) * fix: rename _toc to toc Source-Author: F. Hinkelmann Source-Date: Tue Jul 21 10:53:20 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 99c93fe09f8c1dca09dfc0301c8668e3a70dd796 Source-Link: https://github.com/googleapis/synthtool/commit/99c93fe09f8c1dca09dfc0301c8668e3a70dd796 * fix: move gitattributes files to node templates Source-Author: F. Hinkelmann Source-Date: Thu Jul 23 01:45:04 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3 Source-Link: https://github.com/googleapis/synthtool/commit/3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3 Co-authored-by: Justin Beckwith --- packages/google-cloud-gaming/.gitattributes | 1 + packages/google-cloud-gaming/synth.metadata | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/.gitattributes b/packages/google-cloud-gaming/.gitattributes index d4f4169b28b..33739cb74e4 100644 --- a/packages/google-cloud-gaming/.gitattributes +++ b/packages/google-cloud-gaming/.gitattributes @@ -1,3 +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/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 6d64e66084a..3fff7a75bba 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "21f1470ecd01424dc91c70f1a7c798e4e87d1eec" + "sha": "3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3" } } ], From b31493761839ebd633b23915d25f47949679abc8 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 29 Jul 2020 11:58:18 -0700 Subject: [PATCH 059/180] chore(node): fix kokoro build path for cloud-rad (#106) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/4bdc1826-2f69-49f1-a63b-94f99cceb5ee/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/89d431fb2975fc4e0ed24995a6e6dfc8ff4c24fa --- packages/google-cloud-gaming/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 3fff7a75bba..5368cb4b33a 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "d2d9a64c75f682b954b0da8e4d509c9827b1a4f4" + "sha": "8a5988f143c552f4fb5ec2624c6a97d9a0666ee7" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "3a00b7fea8c4c83eaff8eb207f530a2e3e8e1de3" + "sha": "89d431fb2975fc4e0ed24995a6e6dfc8ff4c24fa" } } ], From 453ca32d9401fb967a1a78bae0de9e787d35663b Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 30 Jul 2020 19:12:11 -0700 Subject: [PATCH 060/180] build: update protos (#107) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/b205fd33-200c-4298-88b8-18b0d1c79a3e/targets - [ ] To automatically regenerate this PR, check this box. --- packages/google-cloud-gaming/protos/protos.d.ts | 2 +- packages/google-cloud-gaming/protos/protos.js | 2 +- packages/google-cloud-gaming/synth.metadata | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-gaming/protos/protos.d.ts b/packages/google-cloud-gaming/protos/protos.d.ts index 159c5deddc8..3bb4aaf4735 100644 --- a/packages/google-cloud-gaming/protos/protos.d.ts +++ b/packages/google-cloud-gaming/protos/protos.d.ts @@ -13,7 +13,7 @@ // limitations under the License. import * as Long from "long"; -import * as $protobuf from "protobufjs"; +import {protobuf as $protobuf} from "google-gax"; /** Namespace google. */ export namespace google { diff --git a/packages/google-cloud-gaming/protos/protos.js b/packages/google-cloud-gaming/protos/protos.js index 644c52844d7..1170dcc32ad 100644 --- a/packages/google-cloud-gaming/protos/protos.js +++ b/packages/google-cloud-gaming/protos/protos.js @@ -19,7 +19,7 @@ define(["protobufjs/minimal"], factory); /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("protobufjs/minimal")); + module.exports = factory(require("google-gax").protobufMinimal); })(this, function($protobuf) { "use strict"; diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 5368cb4b33a..7baf74e40e6 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "8a5988f143c552f4fb5ec2624c6a97d9a0666ee7" + "sha": "de78c250f6b3ac5287f7f07a0f664f0126869f70" } }, { From 623cbd0bcd945694c09c36ac7786b770751a5975 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 31 Jul 2020 09:24:10 -0700 Subject: [PATCH 061/180] docs: add links to the CHANGELOG from the README.md for Java and Node (#108) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/7b446397-88f3-4463-9e7d-d2ce7069989d/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/5936421202fb53ed4641bcb824017dd393a3dbcc --- packages/google-cloud-gaming/README.md | 3 +++ packages/google-cloud-gaming/synth.metadata | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/README.md b/packages/google-cloud-gaming/README.md index 8417f2a2fbc..13ee7de5773 100644 --- a/packages/google-cloud-gaming/README.md +++ b/packages/google-cloud-gaming/README.md @@ -14,6 +14,9 @@ Game service client for Node.js +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-game-servers/blob/master/CHANGELOG.md). + * [Google Cloud Game Servers Node.js Client API Reference][client-docs] * [Google Cloud Game Servers Documentation][product-docs] * [github.com/googleapis/nodejs-game-servers](https://github.com/googleapis/nodejs-game-servers) diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 7baf74e40e6..bd30aba55ea 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "de78c250f6b3ac5287f7f07a0f664f0126869f70" + "sha": "5c70728c51ed996fc39c36ea956e38524ac48681" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "89d431fb2975fc4e0ed24995a6e6dfc8ff4c24fa" + "sha": "5936421202fb53ed4641bcb824017dd393a3dbcc" } } ], From f307fd2e97cd49caf0e3af458fdecccd5d2c3a27 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 5 Aug 2020 13:00:44 -0700 Subject: [PATCH 062/180] feat: v1 API surface (#109) --- .../google/cloud/gaming/v1/common.proto | 240 + .../gaming/v1/game_server_clusters.proto | 274 + .../v1/game_server_clusters_service.proto | 111 + .../cloud/gaming/v1/game_server_configs.proto | 179 + .../v1/game_server_configs_service.proto | 77 + .../gaming/v1/game_server_deployments.proto | 303 + .../v1/game_server_deployments_service.proto | 132 + .../google/cloud/gaming/v1/realms.proto | 188 + .../cloud/gaming/v1/realms_service.proto | 95 + .../google-cloud-gaming/protos/protos.d.ts | 7068 +++++++ packages/google-cloud-gaming/protos/protos.js | 16489 ++++++++++++++++ .../google-cloud-gaming/protos/protos.json | 1628 ++ packages/google-cloud-gaming/src/index.ts | 17 +- .../v1/game_server_clusters_service_client.ts | 1800 ++ ...server_clusters_service_client_config.json | 78 + ...me_server_clusters_service_proto_list.json | 11 + .../v1/game_server_configs_service_client.ts | 1323 ++ ..._server_configs_service_client_config.json | 58 + ...ame_server_configs_service_proto_list.json | 11 + .../game_server_deployments_service_client.ts | 1962 ++ ...ver_deployments_service_client_config.json | 83 + ...server_deployments_service_proto_list.json | 11 + packages/google-cloud-gaming/src/v1/index.ts | 22 + .../src/v1/realms_service_client.ts | 1536 ++ .../src/v1/realms_service_client_config.json | 68 + .../src/v1/realms_service_proto_list.json | 11 + packages/google-cloud-gaming/synth.metadata | 24 +- packages/google-cloud-gaming/synth.py | 4 +- .../gapic_game_server_clusters_service_v1.ts | 2089 ++ .../gapic_game_server_configs_service_v1.ts | 1502 ++ ...apic_game_server_deployments_service_v1.ts | 2313 +++ .../test/gapic_realms_service_v1.ts | 1685 ++ 32 files changed, 41373 insertions(+), 19 deletions(-) create mode 100644 packages/google-cloud-gaming/protos/google/cloud/gaming/v1/common.proto create mode 100644 packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_clusters.proto create mode 100644 packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_clusters_service.proto create mode 100644 packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_configs.proto create mode 100644 packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_configs_service.proto create mode 100644 packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_deployments.proto create mode 100644 packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_deployments_service.proto create mode 100644 packages/google-cloud-gaming/protos/google/cloud/gaming/v1/realms.proto create mode 100644 packages/google-cloud-gaming/protos/google/cloud/gaming/v1/realms_service.proto create mode 100644 packages/google-cloud-gaming/src/v1/game_server_clusters_service_client.ts create mode 100644 packages/google-cloud-gaming/src/v1/game_server_clusters_service_client_config.json create mode 100644 packages/google-cloud-gaming/src/v1/game_server_clusters_service_proto_list.json create mode 100644 packages/google-cloud-gaming/src/v1/game_server_configs_service_client.ts create mode 100644 packages/google-cloud-gaming/src/v1/game_server_configs_service_client_config.json create mode 100644 packages/google-cloud-gaming/src/v1/game_server_configs_service_proto_list.json create mode 100644 packages/google-cloud-gaming/src/v1/game_server_deployments_service_client.ts create mode 100644 packages/google-cloud-gaming/src/v1/game_server_deployments_service_client_config.json create mode 100644 packages/google-cloud-gaming/src/v1/game_server_deployments_service_proto_list.json create mode 100644 packages/google-cloud-gaming/src/v1/index.ts create mode 100644 packages/google-cloud-gaming/src/v1/realms_service_client.ts create mode 100644 packages/google-cloud-gaming/src/v1/realms_service_client_config.json create mode 100644 packages/google-cloud-gaming/src/v1/realms_service_proto_list.json create mode 100644 packages/google-cloud-gaming/test/gapic_game_server_clusters_service_v1.ts create mode 100644 packages/google-cloud-gaming/test/gapic_game_server_configs_service_v1.ts create mode 100644 packages/google-cloud-gaming/test/gapic_game_server_deployments_service_v1.ts create mode 100644 packages/google-cloud-gaming/test/gapic_realms_service_v1.ts 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..87cfedcb732 --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/common.proto @@ -0,0 +1,240 @@ +// 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.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.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..8e23c67a0b2 --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_clusters.proto @@ -0,0 +1,274 @@ +// 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.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"; +import "google/api/annotations.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 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.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]; +} + +// 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/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..b8b8ea27c8d --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_clusters_service.proto @@ -0,0 +1,111 @@ +// 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.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..05a1a169f5a --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_configs.proto @@ -0,0 +1,179 @@ +// 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.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/gaming/v1/common.proto"; +import "google/protobuf/timestamp.proto"; +import "google/api/annotations.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. 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.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. 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/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..bee5334fb6c --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_configs_service.proto @@ -0,0 +1,77 @@ +// 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.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..9160eb32a23 --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_deployments.proto @@ -0,0 +1,303 @@ +// 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.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"; +import "google/api/annotations.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. 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.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. 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/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. Uses the 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..5b07723fb23 --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/game_server_deployments_service.proto @@ -0,0 +1,132 @@ +// 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.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..6c2425889ce --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/realms.proto @@ -0,0 +1,188 @@ +// 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.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"; +import "google/api/annotations.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. 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.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. 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/v1/realms_service.proto b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/realms_service.proto new file mode 100644 index 00000000000..5b6467573fa --- /dev/null +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/realms_service.proto @@ -0,0 +1,95 @@ +// 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.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/protos.d.ts b/packages/google-cloud-gaming/protos/protos.d.ts index 3bb4aaf4735..f81f1659422 100644 --- a/packages/google-cloud-gaming/protos/protos.d.ts +++ b/packages/google-cloud-gaming/protos/protos.d.ts @@ -23,6 +23,7074 @@ export namespace google { /** 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 }; + } + + /** 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 }; + } + + 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + 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 }; + } + + 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 }; + } + + /** 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 }; + } + } + } + + /** 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 }; + } + + /** 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 }; + } + + 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 }; + } + + 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 }; + } + } + + /** 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 }; + } + } + + /** 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.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; + + /** + * 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 }; + } + + /** 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 }; + } + + /** 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.v1.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.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 }; + } + + /** 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 }; + } + + /** 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); + } + + /** 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); + + /** + * 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 }; + } + + /** Properties of a PreviewCreateGameServerClusterResponse. */ + interface IPreviewCreateGameServerClusterResponse { + + /** PreviewCreateGameServerClusterResponse etag */ + etag?: (string|null); + + /** PreviewCreateGameServerClusterResponse targetState */ + targetState?: (google.cloud.gaming.v1.ITargetState|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); + + /** + * 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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); + } + + /** 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; + + /** + * 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + 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 }; + } + } + + /** 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 }; + } + + /** 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; + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 { diff --git a/packages/google-cloud-gaming/protos/protos.js b/packages/google-cloud-gaming/protos/protos.js index 1170dcc32ad..4e649b100f2 100644 --- a/packages/google-cloud-gaming/protos/protos.js +++ b/packages/google-cloud-gaming/protos/protos.js @@ -57,6 +57,16495 @@ */ 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); + }; + + 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) { + 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] : 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); + }; + + /** + * 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + return DeployedFleetAutoscaler; + })(); + + return DeployedFleetDetails; + })(); + + 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 + */ + + /** + * 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 = ""; + + /** + * 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); + 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; + 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"; + 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); + 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 = ""; + } + 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.v1.ListGameServerClustersRequest + * @instance + * @returns {Object.} JSON object + */ + ListGameServerClustersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + 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); + }; + + return ListGameServerClustersResponse; + })(); + + v1.GetGameServerClusterRequest = (function() { + + /** + * Properties of a GetGameServerClusterRequest. + * @memberof google.cloud.gaming.v1 + * @interface IGetGameServerClusterRequest + * @property {string|null} [name] GetGameServerClusterRequest name + */ + + /** + * 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 = ""; + + /** + * 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); + 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; + 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"; + 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); + 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 = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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); + }; + + 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); + }; + + 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 + */ + + /** + * 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; + + /** + * 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(); + 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; + 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; + } + 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); + } + 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; + } + 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); + 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); + }; + + 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 + */ + + /** + * 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; + + /** + * 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(); + 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; + 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; + } + 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); + } + 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; + } + 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 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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 + */ + + /** + * 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 = ""; + + /** + * 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); + 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; + 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"; + 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); + 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 = ""; + } + 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; + 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); + }; + + return GameServerCluster; + })(); + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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} configVersion + * @memberof google.cloud.gaming.v1.GameServerConfigOverride + * @instance + */ + GameServerConfigOverride.prototype.configVersion = ""; + + // 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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() { /** diff --git a/packages/google-cloud-gaming/protos/protos.json b/packages/google-cloud-gaming/protos/protos.json index 5f6744bf6e6..edf735dd05d 100644 --- a/packages/google-cloud-gaming/protos/protos.json +++ b/packages/google-cloud-gaming/protos/protos.json @@ -6,6 +6,1634 @@ "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 + } + } + } + } + }, + "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": "/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" + } + }, + "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" + } + }, + "PreviewCreateGameServerCluster": { + "requestType": "PreviewCreateGameServerClusterRequest", + "responseType": "PreviewCreateGameServerClusterResponse", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/realms/*}/gameServerClusters:previewCreate", + "(google.api.http).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" + } + }, + "PreviewDeleteGameServerCluster": { + "requestType": "PreviewDeleteGameServerClusterRequest", + "responseType": "PreviewDeleteGameServerClusterResponse", + "options": { + "(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" + } + }, + "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" + } + } + } + }, + "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" + } + }, + "GetGameServerConfig": { + "requestType": "GetGameServerConfigRequest", + "responseType": "GameServerConfig", + "options": { + "(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" + } + }, + "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" + } + } + } + }, + "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" + } + }, + "GetGameServerDeployment": { + "requestType": "GetGameServerDeploymentRequest", + "responseType": "GameServerDeployment", + "options": { + "(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" + } + }, + "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" + } + }, + "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" + } + }, + "GetGameServerDeploymentRollout": { + "requestType": "GetGameServerDeploymentRolloutRequest", + "responseType": "GameServerDeploymentRollout", + "options": { + "(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" + } + }, + "PreviewGameServerDeploymentRollout": { + "requestType": "PreviewGameServerDeploymentRolloutRequest", + "responseType": "PreviewGameServerDeploymentRolloutResponse", + "options": { + "(google.api.http).patch": "/v1/{rollout.name=projects/*/locations/*/gameServerDeployments/*}/rollout:preview", + "(google.api.http).body": "rollout" + } + }, + "FetchDeploymentState": { + "requestType": "FetchDeploymentStateRequest", + "responseType": "FetchDeploymentStateResponse", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/gameServerDeployments/*}:fetchDeploymentState", + "(google.api.http).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" + } + }, + "GetRealm": { + "requestType": "GetRealmRequest", + "responseType": "Realm", + "options": { + "(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" + } + }, + "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" + } + }, + "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" + } + }, + "PreviewRealmUpdate": { + "requestType": "PreviewRealmUpdateRequest", + "responseType": "PreviewRealmUpdateResponse", + "options": { + "(google.api.http).patch": "/v1/{realm.name=projects/*/locations/*/realms/*}:previewUpdate", + "(google.api.http).body": "realm" + } + } + } + } + } + }, "v1beta": { "options": { "go_package": "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming", diff --git a/packages/google-cloud-gaming/src/index.ts b/packages/google-cloud-gaming/src/index.ts index f0357c3b1d2..8ff4ccb7fbf 100644 --- a/packages/google-cloud-gaming/src/index.ts +++ b/packages/google-cloud-gaming/src/index.ts @@ -12,17 +12,21 @@ // See the License for the specific language governing permissions and // limitations under the License. // -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** 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 = v1beta.GameServerClustersServiceClient; -const GameServerConfigsServiceClient = v1beta.GameServerConfigsServiceClient; + +const GameServerClustersServiceClient = v1.GameServerClustersServiceClient; +const GameServerConfigsServiceClient = v1.GameServerConfigsServiceClient; const GameServerDeploymentsServiceClient = - v1beta.GameServerDeploymentsServiceClient; -const RealmsServiceClient = v1beta.RealmsServiceClient; + v1.GameServerDeploymentsServiceClient; +const RealmsServiceClient = v1.RealmsServiceClient; + export { + v1, v1beta, GameServerClustersServiceClient, GameServerConfigsServiceClient, @@ -30,6 +34,7 @@ export { RealmsServiceClient, }; export default { + v1, v1beta, GameServerClustersServiceClient, GameServerConfigsServiceClient, 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..1b7aae2cffe --- /dev/null +++ b/packages/google-cloud-gaming/src/v1/game_server_clusters_service_client.ts @@ -0,0 +1,1800 @@ +// 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. ** + +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import * as gapicConfig from './game_server_clusters_service_client_config.json'; +import {operationsProtos} from 'google-gax'; +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 _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: {}, + }; + 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. See the subsequent + * parameters for more details. + * @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. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this + .constructor as typeof GameServerClustersServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + + // users can override the config from client side, like retry codes name. + // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 + // The way to override client config for Showcase API: + // + // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} + // const showcaseClient = new showcaseClient({ projectId, customConfig }); + opts.clientConfig = opts.clientConfig || {}; + + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the GameServerClustersServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this + .constructor as typeof GameServerClustersServiceClient).scopes; + 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; + + // 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}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // 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' + ), + }; + + // 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 protoFilesRoot = opts.fallback + ? this._gaxModule.protobuf.Root.fromJSON( + // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); + + this.operationsClient = this._gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }) + .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 = {}; + } + + /** + * 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 + ) 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 apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.gameServerClustersServiceStub; + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'gameservices.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'gameservices.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + 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. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + getGameServerCluster( + request: protos.google.cloud.gaming.v1.IGetGameServerClusterRequest, + options?: gax.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: gax.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; + /** + * 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.v1.GameServerCluster}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getGameServerCluster( + request: protos.google.cloud.gaming.v1.IGetGameServerClusterRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getGameServerCluster(request, options, callback); + } + previewCreateGameServerCluster( + request: protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest, + options?: gax.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: gax.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; + /** + * 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.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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + previewCreateGameServerCluster( + request: protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.previewCreateGameServerCluster( + request, + options, + callback + ); + } + previewDeleteGameServerCluster( + request: protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest, + options?: gax.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: gax.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; + /** + * 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.v1.PreviewDeleteGameServerClusterResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + previewDeleteGameServerCluster( + request: protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.previewDeleteGameServerCluster( + request, + options, + callback + ); + } + previewUpdateGameServerCluster( + request: protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest, + options?: gax.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: gax.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; + /** + * 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}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + previewUpdateGameServerCluster( + request: protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'game_server_cluster.name': request.gameServerCluster!.name || '', + }); + this.initialize(); + return this.innerApiCalls.previewUpdateGameServerCluster( + request, + options, + callback + ); + } + + createGameServerCluster( + request: protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest, + options?: gax.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: gax.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; + /** + * 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.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 [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createGameServerCluster( + request: protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createGameServerCluster( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by the createGameServerCluster() method. + * @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. + * + * @example: + * const decodedOperation = await checkCreateGameServerClusterProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkCreateGameServerClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1.GameServerCluster, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.createGameServerCluster, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1.GameServerCluster, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + deleteGameServerCluster( + request: protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest, + options?: gax.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: gax.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; + /** + * 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 [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteGameServerCluster( + request: protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteGameServerCluster( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by the deleteGameServerCluster() method. + * @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. + * + * @example: + * const decodedOperation = await checkDeleteGameServerClusterProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkDeleteGameServerClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.deleteGameServerCluster, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + updateGameServerCluster( + request: protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest, + options?: gax.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: gax.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; + /** + * 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 [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateGameServerCluster( + request: protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.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 the updateGameServerCluster() method. + * @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. + * + * @example: + * const decodedOperation = await checkUpdateGameServerClusterProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkUpdateGameServerClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1.GameServerCluster, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.updateGameServerCluster, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1.GameServerCluster, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + listGameServerClusters( + request: protos.google.cloud.gaming.v1.IListGameServerClustersRequest, + options?: gax.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: gax.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; + /** + * 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.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 {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [GameServerCluster]{@link google.cloud.gaming.v1.GameServerCluster} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListGameServerClustersRequest]{@link google.cloud.gaming.v1.ListGameServerClustersRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListGameServerClustersResponse]{@link google.cloud.gaming.v1.ListGameServerClustersResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listGameServerClusters( + request: protos.google.cloud.gaming.v1.IListGameServerClustersRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listGameServerClusters( + request, + options, + callback + ); + } + + /** + * Equivalent to {@link listGameServerClusters}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listGameServerClusters} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @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.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 {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. + */ + listGameServerClustersStream( + request?: protos.google.cloud.gaming.v1.IListGameServerClustersRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listGameServerClusters.createStream( + this.innerApiCalls.listGameServerClusters as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to {@link listGameServerClusters}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.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.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 {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 conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listGameServerClustersAsync( + request?: protos.google.cloud.gaming.v1.IListGameServerClustersRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listGameServerClusters.asyncIterate( + this.innerApiCalls['listGameServerClusters'] as GaxCall, + (request as unknown) as RequestType, + 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. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.gameServerClustersServiceStub!.then(stub => { + this._terminated = true; + stub.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..02f943ab4bd --- /dev/null +++ b/packages/google-cloud-gaming/src/v1/game_server_configs_service_client.ts @@ -0,0 +1,1323 @@ +// 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. ** + +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import * as gapicConfig from './game_server_configs_service_client_config.json'; +import {operationsProtos} from 'google-gax'; +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 _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: {}, + }; + 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. See the subsequent + * parameters for more details. + * @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. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this + .constructor as typeof GameServerConfigsServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + + // users can override the config from client side, like retry codes name. + // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 + // The way to override client config for Showcase API: + // + // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} + // const showcaseClient = new showcaseClient({ projectId, customConfig }); + opts.clientConfig = opts.clientConfig || {}; + + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the GameServerConfigsServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this + .constructor as typeof GameServerConfigsServiceClient).scopes; + 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; + + // 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}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // 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' + ), + }; + + // 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 protoFilesRoot = opts.fallback + ? this._gaxModule.protobuf.Root.fromJSON( + // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); + + this.operationsClient = this._gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }) + .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 = {}; + } + + /** + * 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 + ) 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 apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.gameServerConfigsServiceStub; + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'gameservices.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'gameservices.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + 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. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + getGameServerConfig( + request: protos.google.cloud.gaming.v1.IGetGameServerConfigRequest, + options?: gax.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: gax.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; + /** + * 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.v1.GameServerConfig}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getGameServerConfig( + request: protos.google.cloud.gaming.v1.IGetGameServerConfigRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getGameServerConfig(request, options, callback); + } + + createGameServerConfig( + request: protos.google.cloud.gaming.v1.ICreateGameServerConfigRequest, + options?: gax.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: gax.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; + /** + * 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.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 [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createGameServerConfig( + request: protos.google.cloud.gaming.v1.ICreateGameServerConfigRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createGameServerConfig( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by the createGameServerConfig() method. + * @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. + * + * @example: + * const decodedOperation = await checkCreateGameServerConfigProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkCreateGameServerConfigProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1.GameServerConfig, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.createGameServerConfig, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1.GameServerConfig, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + deleteGameServerConfig( + request: protos.google.cloud.gaming.v1.IDeleteGameServerConfigRequest, + options?: gax.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: gax.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; + /** + * 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 [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteGameServerConfig( + request: protos.google.cloud.gaming.v1.IDeleteGameServerConfigRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteGameServerConfig( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by the deleteGameServerConfig() method. + * @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. + * + * @example: + * const decodedOperation = await checkDeleteGameServerConfigProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkDeleteGameServerConfigProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.deleteGameServerConfig, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + listGameServerConfigs( + request: protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, + options?: gax.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: gax.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; + /** + * 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.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 support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [GameServerConfig]{@link google.cloud.gaming.v1.GameServerConfig} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListGameServerConfigsRequest]{@link google.cloud.gaming.v1.ListGameServerConfigsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListGameServerConfigsResponse]{@link google.cloud.gaming.v1.ListGameServerConfigsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listGameServerConfigs( + request: protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listGameServerConfigs(request, options, callback); + } + + /** + * Equivalent to {@link listGameServerConfigs}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listGameServerConfigs} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @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.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. + */ + listGameServerConfigsStream( + request?: protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listGameServerConfigs.createStream( + this.innerApiCalls.listGameServerConfigs as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to {@link listGameServerConfigs}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.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.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 conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listGameServerConfigsAsync( + request?: protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listGameServerConfigs.asyncIterate( + this.innerApiCalls['listGameServerConfigs'] as GaxCall, + (request as unknown) as RequestType, + 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. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.gameServerConfigsServiceStub!.then(stub => { + this._terminated = true; + stub.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..7a4fbc41935 --- /dev/null +++ b/packages/google-cloud-gaming/src/v1/game_server_deployments_service_client.ts @@ -0,0 +1,1962 @@ +// 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. ** + +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import * as gapicConfig from './game_server_deployments_service_client_config.json'; +import {operationsProtos} from 'google-gax'; +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 _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: {}, + }; + 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. See the subsequent + * parameters for more details. + * @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. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this + .constructor as typeof GameServerDeploymentsServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + + // users can override the config from client side, like retry codes name. + // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 + // The way to override client config for Showcase API: + // + // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} + // const showcaseClient = new showcaseClient({ projectId, customConfig }); + opts.clientConfig = opts.clientConfig || {}; + + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the GameServerDeploymentsServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this + .constructor as typeof GameServerDeploymentsServiceClient).scopes; + 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; + + // 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}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // 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' + ), + }; + + // 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 protoFilesRoot = opts.fallback + ? this._gaxModule.protobuf.Root.fromJSON( + // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); + + this.operationsClient = this._gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }) + .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 = {}; + } + + /** + * 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 + ) 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 apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.gameServerDeploymentsServiceStub; + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'gameservices.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'gameservices.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + 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. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + getGameServerDeployment( + request: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRequest, + options?: gax.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: gax.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; + /** + * 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.v1.GameServerDeployment}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getGameServerDeployment( + request: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getGameServerDeployment( + request, + options, + callback + ); + } + getGameServerDeploymentRollout( + request: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest, + options?: gax.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: gax.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; + /** + * 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.v1.GameServerDeploymentRollout}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getGameServerDeploymentRollout( + request: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getGameServerDeploymentRollout( + request, + options, + callback + ); + } + previewGameServerDeploymentRollout( + request: protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest, + options?: gax.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: gax.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; + /** + * 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}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + previewGameServerDeploymentRollout( + request: protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'rollout.name': request.rollout!.name || '', + }); + this.initialize(); + return this.innerApiCalls.previewGameServerDeploymentRollout( + request, + options, + callback + ); + } + fetchDeploymentState( + request: protos.google.cloud.gaming.v1.IFetchDeploymentStateRequest, + options?: gax.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: gax.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; + /** + * 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.v1.FetchDeploymentStateResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + fetchDeploymentState( + request: protos.google.cloud.gaming.v1.IFetchDeploymentStateRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.fetchDeploymentState(request, options, callback); + } + + createGameServerDeployment( + request: protos.google.cloud.gaming.v1.ICreateGameServerDeploymentRequest, + options?: gax.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: gax.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; + /** + * 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.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 [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createGameServerDeployment( + request: protos.google.cloud.gaming.v1.ICreateGameServerDeploymentRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createGameServerDeployment( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by the createGameServerDeployment() method. + * @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. + * + * @example: + * const decodedOperation = await checkCreateGameServerDeploymentProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkCreateGameServerDeploymentProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1.GameServerDeployment, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.createGameServerDeployment, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1.GameServerDeployment, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + deleteGameServerDeployment( + request: protos.google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest, + options?: gax.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: gax.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; + /** + * 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 [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteGameServerDeployment( + request: protos.google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteGameServerDeployment( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by the deleteGameServerDeployment() method. + * @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. + * + * @example: + * const decodedOperation = await checkDeleteGameServerDeploymentProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkDeleteGameServerDeploymentProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.deleteGameServerDeployment, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + updateGameServerDeployment( + request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest, + options?: gax.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: gax.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; + /** + * 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 [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateGameServerDeployment( + request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.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 the updateGameServerDeployment() method. + * @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. + * + * @example: + * const decodedOperation = await checkUpdateGameServerDeploymentProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkUpdateGameServerDeploymentProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1.GameServerDeployment, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.updateGameServerDeployment, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1.GameServerDeployment, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + updateGameServerDeploymentRollout( + request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest, + options?: gax.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: gax.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; + /** + * 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 [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateGameServerDeploymentRollout( + request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.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 the updateGameServerDeploymentRollout() method. + * @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. + * + * @example: + * const decodedOperation = await checkUpdateGameServerDeploymentRolloutProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkUpdateGameServerDeploymentRolloutProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1.GameServerDeployment, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.updateGameServerDeploymentRollout, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1.GameServerDeployment, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + listGameServerDeployments( + request: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, + options?: gax.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: gax.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; + /** + * 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.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 support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [GameServerDeployment]{@link google.cloud.gaming.v1.GameServerDeployment} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListGameServerDeploymentsRequest]{@link google.cloud.gaming.v1.ListGameServerDeploymentsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListGameServerDeploymentsResponse]{@link google.cloud.gaming.v1.ListGameServerDeploymentsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listGameServerDeployments( + request: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listGameServerDeployments( + request, + options, + callback + ); + } + + /** + * Equivalent to {@link listGameServerDeployments}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listGameServerDeployments} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @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.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. + */ + listGameServerDeploymentsStream( + request?: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listGameServerDeployments.createStream( + this.innerApiCalls.listGameServerDeployments as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to {@link listGameServerDeployments}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.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.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 conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listGameServerDeploymentsAsync( + request?: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listGameServerDeployments.asyncIterate( + this.innerApiCalls['listGameServerDeployments'] as GaxCall, + (request as unknown) as RequestType, + 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. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.gameServerDeploymentsServiceStub!.then(stub => { + this._terminated = true; + stub.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..65967cc2879 --- /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": 120000, + "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/index.ts b/packages/google-cloud-gaming/src/v1/index.ts new file mode 100644 index 00000000000..861b577d05e --- /dev/null +++ b/packages/google-cloud-gaming/src/v1/index.ts @@ -0,0 +1,22 @@ +// 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. ** + +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..00a71bdf402 --- /dev/null +++ b/packages/google-cloud-gaming/src/v1/realms_service_client.ts @@ -0,0 +1,1536 @@ +// 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. ** + +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import * as gapicConfig from './realms_service_client_config.json'; +import {operationsProtos} from 'google-gax'; +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 _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: {}, + }; + 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. See the subsequent + * parameters for more details. + * @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. + */ + + constructor(opts?: ClientOptions) { + // Ensure that options include the service address and port. + const staticMembers = this.constructor as typeof RealmsServiceClient; + const servicePath = + opts && opts.servicePath + ? opts.servicePath + : opts && opts.apiEndpoint + ? opts.apiEndpoint + : staticMembers.servicePath; + const port = opts && opts.port ? opts.port : staticMembers.port; + + if (!opts) { + opts = {servicePath, port}; + } + opts.servicePath = opts.servicePath || servicePath; + opts.port = opts.port || port; + + // users can override the config from client side, like retry codes name. + // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 + // The way to override client config for Showcase API: + // + // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} + // const showcaseClient = new showcaseClient({ projectId, customConfig }); + opts.clientConfig = opts.clientConfig || {}; + + // If we're running in browser, it's OK to omit `fallback` since + // google-gax has `browser` field in its `package.json`. + // For Electron (which does not respect `browser` field), + // pass `{fallback: true}` to the RealmsServiceClient constructor. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options + // sent to the client. + opts.scopes = (this.constructor as typeof RealmsServiceClient).scopes; + 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; + + // 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}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // 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' + ), + }; + + // 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 protoFilesRoot = opts.fallback + ? this._gaxModule.protobuf.Root.fromJSON( + // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); + + this.operationsClient = this._gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }) + .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 = {}; + } + + /** + * 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 + ) 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 apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + this.descriptors.longrunning[methodName] + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.realmsServiceStub; + } + + /** + * The DNS address for this API service. + */ + static get servicePath() { + return 'gameservices.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + */ + static get apiEndpoint() { + return 'gameservices.googleapis.com'; + } + + /** + * The port for this API service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + */ + 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. + * @param {function(Error, string)} callback - the callback to + * be called with the current project Id. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + getRealm( + request: protos.google.cloud.gaming.v1.IGetRealmRequest, + options?: gax.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: gax.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; + /** + * 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.v1.Realm}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getRealm( + request: protos.google.cloud.gaming.v1.IGetRealmRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getRealm(request, options, callback); + } + previewRealmUpdate( + request: protos.google.cloud.gaming.v1.IPreviewRealmUpdateRequest, + options?: gax.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: gax.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; + /** + * 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}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + previewRealmUpdate( + request: protos.google.cloud.gaming.v1.IPreviewRealmUpdateRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'realm.name': request.realm!.name || '', + }); + this.initialize(); + return this.innerApiCalls.previewRealmUpdate(request, options, callback); + } + + createRealm( + request: protos.google.cloud.gaming.v1.ICreateRealmRequest, + options?: gax.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: gax.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; + /** + * 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.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 [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + createRealm( + request: protos.google.cloud.gaming.v1.ICreateRealmRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createRealm(request, options, callback); + } + /** + * Check the status of the long running operation returned by the createRealm() method. + * @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. + * + * @example: + * const decodedOperation = await checkCreateRealmProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkCreateRealmProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1.Realm, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.createRealm, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1.Realm, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + deleteRealm( + request: protos.google.cloud.gaming.v1.IDeleteRealmRequest, + options?: gax.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: gax.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; + /** + * 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 [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + deleteRealm( + request: protos.google.cloud.gaming.v1.IDeleteRealmRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteRealm(request, options, callback); + } + /** + * Check the status of the long running operation returned by the deleteRealm() method. + * @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. + * + * @example: + * const decodedOperation = await checkDeleteRealmProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkDeleteRealmProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.deleteRealm, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + updateRealm( + request: protos.google.cloud.gaming.v1.IUpdateRealmRequest, + options?: gax.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: gax.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; + /** + * 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 [Operation]{@link google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + updateRealm( + request: protos.google.cloud.gaming.v1.IUpdateRealmRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.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 the updateRealm() method. + * @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. + * + * @example: + * const decodedOperation = await checkUpdateRealmProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + * + */ + async checkUpdateRealmProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.gaming.v1.Realm, + protos.google.cloud.gaming.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.updateRealm, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.gaming.v1.Realm, + protos.google.cloud.gaming.v1.OperationMetadata + >; + } + listRealms( + request: protos.google.cloud.gaming.v1.IListRealmsRequest, + options?: gax.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: gax.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; + /** + * 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.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 support 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. + * + * When autoPaginate: false is specified through options, the array has three elements. + * The first element is Array of [Realm]{@link google.cloud.gaming.v1.Realm} that corresponds to + * the one page received from the API server. + * If the second element is not null it contains the request object of type [ListRealmsRequest]{@link google.cloud.gaming.v1.ListRealmsRequest} + * that can be used to obtain the next page of the results. + * If it is null, the next page does not exist. + * The third element contains the raw response received from the API server. Its type is + * [ListRealmsResponse]{@link google.cloud.gaming.v1.ListRealmsResponse}. + * + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + listRealms( + request: protos.google.cloud.gaming.v1.IListRealmsRequest, + optionsOrCallback?: + | gax.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: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listRealms(request, options, callback); + } + + /** + * Equivalent to {@link listRealms}, but returns a NodeJS Stream object. + * + * This fetches the paged responses for {@link listRealms} continuously + * and invokes the callback registered for 'data' event for each element in the + * responses. + * + * The returned object has 'end' method when no more elements are required. + * + * autoPaginate option will be ignored. + * + * @see {@link https://nodejs.org/api/stream.html} + * + * @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.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. + */ + listRealmsStream( + request?: protos.google.cloud.gaming.v1.IListRealmsRequest, + options?: gax.CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listRealms.createStream( + this.innerApiCalls.listRealms as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to {@link listRealms}, but returns an iterable object. + * + * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.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.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 conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + */ + listRealmsAsync( + request?: protos.google.cloud.gaming.v1.IListRealmsRequest, + options?: gax.CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listRealms.asyncIterate( + this.innerApiCalls['listRealms'] as GaxCall, + (request as unknown) as RequestType, + 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. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.realmsServiceStub!.then(stub => { + this._terminated = true; + stub.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/synth.metadata b/packages/google-cloud-gaming/synth.metadata index bd30aba55ea..9eca1b0002a 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -3,27 +3,29 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "5c70728c51ed996fc39c36ea956e38524ac48681" + "remote": "git@github.com:googleapis/nodejs-game-servers.git", + "sha": "1edc5501da48f1f67ca1aef75da96f47d3c98fce" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4f4aa3a03e470f1390758b9d89eb1aa88837a5be", - "internalRef": "320300472" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5936421202fb53ed4641bcb824017dd393a3dbcc" + "sha": "dbdd8ddeb6d9556952aa8784d9e48f2566c9911a", + "internalRef": "324762765" } } ], "destinations": [ + { + "client": { + "source": "googleapis", + "apiName": "gaming", + "apiVersion": "v1", + "language": "nodejs", + "generator": "bazel" + } + }, { "client": { "source": "googleapis", diff --git a/packages/google-cloud-gaming/synth.py b/packages/google-cloud-gaming/synth.py index 5a083000653..2f98c0d2a92 100644 --- a/packages/google-cloud-gaming/synth.py +++ b/packages/google-cloud-gaming/synth.py @@ -22,12 +22,12 @@ # run the gapic generator gapic = gcp.GAPICBazel() -versions = ['v1beta'] +versions = ['v1', 'v1beta'] for version in versions: library = gapic.node_library('gaming', version) s.copy(library, excludes=['package.json', 'README.md']) # Copy common templates common_templates = gcp.CommonTemplates() -templates = common_templates.node_library(source_location='build/src') +templates = common_templates.node_library(source_location='build/src', versions=versions, default_version='v1') s.copy(templates, excludes=[]) node.postprocess_gapic_library() 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..58aa189c571 --- /dev/null +++ b/packages/google-cloud-gaming/test/gapic_game_server_clusters_service_v1.ts @@ -0,0 +1,2089 @@ +// 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. ** + +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'; + +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', () => { + 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', () => { + const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.getGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.getGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getGameServerCluster = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getGameServerCluster(request), expectedError); + assert( + (client.innerApiCalls.getGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.previewCreateGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.previewCreateGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.previewCreateGameServerCluster = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.previewCreateGameServerCluster(request), + expectedError + ); + assert( + (client.innerApiCalls.previewCreateGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.previewDeleteGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.previewDeleteGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.previewDeleteGameServerCluster = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.previewDeleteGameServerCluster(request), + expectedError + ); + assert( + (client.innerApiCalls.previewDeleteGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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 = {}; + request.gameServerCluster.name = ''; + const expectedHeaderRequestParams = 'game_server_cluster.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.previewUpdateGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.gameServerCluster.name = ''; + const expectedHeaderRequestParams = 'game_server_cluster.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.previewUpdateGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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 = {}; + request.gameServerCluster.name = ''; + const expectedHeaderRequestParams = 'game_server_cluster.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.previewUpdateGameServerCluster = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.previewUpdateGameServerCluster(request), + expectedError + ); + assert( + (client.innerApiCalls.previewUpdateGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.createGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.createGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerCluster = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createGameServerCluster(request), + expectedError + ); + assert( + (client.innerApiCalls.createGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerCluster = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createGameServerCluster(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.createGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.deleteGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.deleteGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerCluster = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteGameServerCluster(request), + expectedError + ); + assert( + (client.innerApiCalls.deleteGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerCluster = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteGameServerCluster(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.deleteGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.gameServerCluster.name = ''; + const expectedHeaderRequestParams = 'game_server_cluster.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.updateGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.gameServerCluster.name = ''; + const expectedHeaderRequestParams = 'game_server_cluster.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.updateGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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 = {}; + request.gameServerCluster.name = ''; + const expectedHeaderRequestParams = 'game_server_cluster.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerCluster = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateGameServerCluster(request), + expectedError + ); + assert( + (client.innerApiCalls.updateGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.gameServerCluster.name = ''; + const expectedHeaderRequestParams = 'game_server_cluster.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerCluster = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateGameServerCluster(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.updateGameServerCluster as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.listGameServerClusters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.listGameServerClusters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listGameServerClusters = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listGameServerClusters(request), + expectedError + ); + assert( + (client.innerApiCalls.listGameServerClusters as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listGameServerClusters + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listGameServerClusters + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listGameServerClusters + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listGameServerClusters + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + 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_configs_service_v1.ts b/packages/google-cloud-gaming/test/gapic_game_server_configs_service_v1.ts new file mode 100644 index 00000000000..090728f0dfd --- /dev/null +++ b/packages/google-cloud-gaming/test/gapic_game_server_configs_service_v1.ts @@ -0,0 +1,1502 @@ +// 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. ** + +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'; + +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', () => { + 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', () => { + const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.getGameServerConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.getGameServerConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getGameServerConfig = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getGameServerConfig(request), expectedError); + assert( + (client.innerApiCalls.getGameServerConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.createGameServerConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.createGameServerConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerConfig = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createGameServerConfig(request), + expectedError + ); + assert( + (client.innerApiCalls.createGameServerConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerConfig = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createGameServerConfig(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.createGameServerConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.deleteGameServerConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.deleteGameServerConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerConfig = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteGameServerConfig(request), + expectedError + ); + assert( + (client.innerApiCalls.deleteGameServerConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerConfig = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteGameServerConfig(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.deleteGameServerConfig as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.listGameServerConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.listGameServerConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listGameServerConfigs = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listGameServerConfigs(request), + expectedError + ); + assert( + (client.innerApiCalls.listGameServerConfigs as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listGameServerConfigs + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listGameServerConfigs + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listGameServerConfigs + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listGameServerConfigs + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + 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_deployments_service_v1.ts b/packages/google-cloud-gaming/test/gapic_game_server_deployments_service_v1.ts new file mode 100644 index 00000000000..b61109c3136 --- /dev/null +++ b/packages/google-cloud-gaming/test/gapic_game_server_deployments_service_v1.ts @@ -0,0 +1,2313 @@ +// 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. ** + +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'; + +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', () => { + 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', () => { + const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.getGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.getGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getGameServerDeployment = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getGameServerDeployment(request), + expectedError + ); + assert( + (client.innerApiCalls.getGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.getGameServerDeploymentRollout as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.getGameServerDeploymentRollout as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getGameServerDeploymentRollout = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getGameServerDeploymentRollout(request), + expectedError + ); + assert( + (client.innerApiCalls.getGameServerDeploymentRollout as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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 = {}; + request.rollout.name = ''; + const expectedHeaderRequestParams = 'rollout.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.rollout.name = ''; + const expectedHeaderRequestParams = 'rollout.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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 = {}; + request.rollout.name = ''; + const expectedHeaderRequestParams = 'rollout.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.previewGameServerDeploymentRollout = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.previewGameServerDeploymentRollout(request), + expectedError + ); + assert( + (client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.fetchDeploymentState as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.fetchDeploymentState as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchDeploymentState = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.fetchDeploymentState(request), expectedError); + assert( + (client.innerApiCalls.fetchDeploymentState as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.createGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.createGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerDeployment = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createGameServerDeployment(request), + expectedError + ); + assert( + (client.innerApiCalls.createGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createGameServerDeployment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createGameServerDeployment(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.createGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.deleteGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.deleteGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerDeployment = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteGameServerDeployment(request), + expectedError + ); + assert( + (client.innerApiCalls.deleteGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteGameServerDeployment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteGameServerDeployment(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.deleteGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.gameServerDeployment.name = ''; + const expectedHeaderRequestParams = 'game_server_deployment.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.updateGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.gameServerDeployment.name = ''; + const expectedHeaderRequestParams = 'game_server_deployment.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.updateGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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 = {}; + request.gameServerDeployment.name = ''; + const expectedHeaderRequestParams = 'game_server_deployment.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerDeployment = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateGameServerDeployment(request), + expectedError + ); + assert( + (client.innerApiCalls.updateGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.gameServerDeployment.name = ''; + const expectedHeaderRequestParams = 'game_server_deployment.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerDeployment = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateGameServerDeployment(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.updateGameServerDeployment as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.rollout.name = ''; + const expectedHeaderRequestParams = 'rollout.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.rollout.name = ''; + const expectedHeaderRequestParams = 'rollout.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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 = {}; + request.rollout.name = ''; + const expectedHeaderRequestParams = 'rollout.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerDeploymentRollout = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateGameServerDeploymentRollout(request), + expectedError + ); + assert( + (client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.rollout.name = ''; + const expectedHeaderRequestParams = 'rollout.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateGameServerDeploymentRollout = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateGameServerDeploymentRollout( + request + ); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.listGameServerDeployments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.listGameServerDeployments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listGameServerDeployments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listGameServerDeployments(request), + expectedError + ); + assert( + (client.innerApiCalls.listGameServerDeployments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listGameServerDeployments + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listGameServerDeployments + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listGameServerDeployments + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listGameServerDeployments + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + 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_realms_service_v1.ts b/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts new file mode 100644 index 00000000000..868b90b09d1 --- /dev/null +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts @@ -0,0 +1,1685 @@ +// 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. ** + +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'; + +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', () => { + 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', () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.getRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.getRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getRealm = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getRealm(request), expectedError); + assert( + (client.innerApiCalls.getRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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 = {}; + request.realm.name = ''; + const expectedHeaderRequestParams = 'realm.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.previewRealmUpdate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.realm.name = ''; + const expectedHeaderRequestParams = 'realm.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.previewRealmUpdate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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 = {}; + request.realm.name = ''; + const expectedHeaderRequestParams = 'realm.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.previewRealmUpdate = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.previewRealmUpdate(request), expectedError); + assert( + (client.innerApiCalls.previewRealmUpdate as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.createRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.createRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createRealm = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createRealm(request), expectedError); + assert( + (client.innerApiCalls.createRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createRealm = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createRealm(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.createRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.deleteRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.deleteRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRealm = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteRealm(request), expectedError); + assert( + (client.innerApiCalls.deleteRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteRealm = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteRealm(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.deleteRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.realm.name = ''; + const expectedHeaderRequestParams = 'realm.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.updateRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.realm.name = ''; + const expectedHeaderRequestParams = 'realm.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.updateRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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 = {}; + request.realm.name = ''; + const expectedHeaderRequestParams = 'realm.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRealm = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateRealm(request), expectedError); + assert( + (client.innerApiCalls.updateRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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 = {}; + request.realm.name = ''; + const expectedHeaderRequestParams = 'realm.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateRealm = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateRealm(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.updateRealm as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.listRealms as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + 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); + assert( + (client.innerApiCalls.listRealms as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listRealms = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listRealms(request), expectedError); + assert( + (client.innerApiCalls.listRealms as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listRealms.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listRealms.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listRealms.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + 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.strictEqual( + (client.descriptors.page.listRealms.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + 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) + ); + }); + }); + }); +}); From eb2a63a45a520b6808a6c24f7e3438d8c076592a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 5 Aug 2020 13:25:11 -0700 Subject: [PATCH 063/180] chore: release 2.1.0 (#110) --- packages/google-cloud-gaming/CHANGELOG.md | 7 +++++++ packages/google-cloud-gaming/package.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index edb08a336fb..1556001dcc0 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 05a7bc1418e..5ccf47096b9 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "2.0.2", + "version": "2.1.0", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index d6364f03a04..c3fcc34a9d1 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^2.0.2" + "@google-cloud/game-servers": "^2.1.0" }, "devDependencies": { "c8": "^7.2.1", From 4aaa03f7397d077d6366b0cc7ac8fd5304008e2f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 10 Aug 2020 19:20:51 -0700 Subject: [PATCH 064/180] build: stop passing credential file to secret manager autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. --- packages/google-cloud-gaming/synth.metadata | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 9eca1b0002a..1584d4a56a6 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -3,8 +3,8 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-game-servers.git", - "sha": "1edc5501da48f1f67ca1aef75da96f47d3c98fce" + "remote": "https://github.com/googleapis/nodejs-game-servers.git", + "sha": "c490890a536bb8681a98c5b429bb1a7676c324a5" } }, { @@ -14,6 +14,13 @@ "sha": "dbdd8ddeb6d9556952aa8784d9e48f2566c9911a", "internalRef": "324762765" } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "94421c47802f56a44c320257b2b4c190dc7d6b68" + } } ], "destinations": [ From 2ffddd4cadfc0e709319f38e29f4a6f751af9a18 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 11 Aug 2020 22:11:41 -0700 Subject: [PATCH 065/180] build: use gapic-generator-typescript v1.0.7. (#113) This new generator will bring some changes to the generated code across all libraries, but the behavior will only change for nodejs-logging and nodejs-pubsub (those two libraries that use request batching). For other libraries, the changes should be minor (the createApiCall call is simplified) and it should be safe to merge them. Please talk to @alexander-fenster if you have any questions. PiperOrigin-RevId: 325949033 Source-Author: Google APIs Source-Date: Mon Aug 10 21:11:13 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: 94006b3cb8d2fb44703cf535da15608eed6bf7db Source-Link: https://github.com/googleapis/googleapis/commit/94006b3cb8d2fb44703cf535da15608eed6bf7db --- .../src/v1beta/game_server_clusters_service_client.ts | 8 +++++--- .../src/v1beta/game_server_configs_service_client.ts | 8 +++++--- .../src/v1beta/game_server_deployments_service_client.ts | 8 +++++--- .../src/v1beta/realms_service_client.ts | 8 +++++--- packages/google-cloud-gaming/synth.metadata | 6 +++--- 5 files changed, 23 insertions(+), 15 deletions(-) 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 index 36d51eafb6b..26dbec1240c 100644 --- 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 @@ -328,12 +328,14 @@ export class GameServerClustersServiceClient { } ); + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + descriptor ); this.innerApiCalls[methodName] = apiCall; 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 index 36e69a68c49..acd59c064bc 100644 --- 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 @@ -308,12 +308,14 @@ export class GameServerConfigsServiceClient { } ); + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + descriptor ); this.innerApiCalls[methodName] = apiCall; 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 index b4a1fed8418..546fb7db9ec 100644 --- 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 @@ -344,12 +344,14 @@ export class GameServerDeploymentsServiceClient { } ); + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + descriptor ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index b32c2761e71..2a1cd760a54 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -311,12 +311,14 @@ export class RealmsServiceClient { } ); + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + descriptor ); this.innerApiCalls[methodName] = apiCall; diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 1584d4a56a6..17f28c0e71f 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "c490890a536bb8681a98c5b429bb1a7676c324a5" + "sha": "afafc97df1583a9596a764c23d63f9082dae783f" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "dbdd8ddeb6d9556952aa8784d9e48f2566c9911a", - "internalRef": "324762765" + "sha": "94006b3cb8d2fb44703cf535da15608eed6bf7db", + "internalRef": "325949033" } }, { From ff0550b966bbce1c78b8d7733704f5c104f46530 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 11 Aug 2020 22:20:12 -0700 Subject: [PATCH 066/180] chore: update cloud rad kokoro build job (#114) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/5f7f9c6d-c75a-4c60-8bb8-0026a14cead7/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/bd0deaa1113b588d70449535ab9cbf0f2bd0e72f --- packages/google-cloud-gaming/synth.metadata | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 17f28c0e71f..14b34aefbe2 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "94421c47802f56a44c320257b2b4c190dc7d6b68" + "sha": "bd0deaa1113b588d70449535ab9cbf0f2bd0e72f" } } ], From b7b5e7d4cadf5b0eb01ce516735d18fb23af036d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 13 Aug 2020 13:00:06 -0700 Subject: [PATCH 067/180] build: perform publish using Node 12 (#115) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/c36c6dbc-ab79-4f17-b70b-523b420b2a70/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/5747555f7620113d9a2078a48f4c047a99d31b3e --- packages/google-cloud-gaming/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 14b34aefbe2..feb7f275ba6 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "afafc97df1583a9596a764c23d63f9082dae783f" + "sha": "ef698acfb0e251a80a028d49b62d6eb3805c5be6" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "bd0deaa1113b588d70449535ab9cbf0f2bd0e72f" + "sha": "5747555f7620113d9a2078a48f4c047a99d31b3e" } } ], From 3d5bc71095c7682a4111c5251cb91ef048d40d01 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 19 Aug 2020 09:42:30 -0700 Subject: [PATCH 068/180] chore: start tracking obsolete files (#116) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/7a1b0b96-8ddb-4836-a1a2-d2f73b7e6ffe/targets - [ ] To automatically regenerate this PR, check this box. --- packages/google-cloud-gaming/synth.metadata | 100 +++++++++++++++++++- 1 file changed, 96 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index feb7f275ba6..299637d8d30 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,22 +4,22 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "ef698acfb0e251a80a028d49b62d6eb3805c5be6" + "sha": "4d04f32af05a0014d3de2cc791618262bc9b6d84" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "94006b3cb8d2fb44703cf535da15608eed6bf7db", - "internalRef": "325949033" + "sha": "4c5071b615d96ef9dfd6a63d8429090f1f2872bb", + "internalRef": "327369997" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "5747555f7620113d9a2078a48f4c047a99d31b3e" + "sha": "1a60ff2a3975c2f5054431588bd95db9c3b862ba" } } ], @@ -42,5 +42,97 @@ "generator": "bazel" } } + ], + "generatedFiles": [ + ".eslintignore", + ".eslintrc.json", + ".gitattributes", + ".github/ISSUE_TEMPLATE/bug_report.md", + ".github/ISSUE_TEMPLATE/feature_request.md", + ".github/ISSUE_TEMPLATE/support_request.md", + ".github/PULL_REQUEST_TEMPLATE.md", + ".github/publish.yml", + ".github/release-please.yml", + ".github/workflows/ci.yaml", + ".gitignore", + ".jsdoc.js", + ".kokoro/.gitattributes", + ".kokoro/common.cfg", + ".kokoro/continuous/node10/common.cfg", + ".kokoro/continuous/node10/docs.cfg", + ".kokoro/continuous/node10/lint.cfg", + ".kokoro/continuous/node10/samples-test.cfg", + ".kokoro/continuous/node10/system-test.cfg", + ".kokoro/continuous/node10/test.cfg", + ".kokoro/continuous/node12/common.cfg", + ".kokoro/continuous/node12/test.cfg", + ".kokoro/docs.sh", + ".kokoro/lint.sh", + ".kokoro/populate-secrets.sh", + ".kokoro/presubmit/node10/common.cfg", + ".kokoro/presubmit/node10/samples-test.cfg", + ".kokoro/presubmit/node10/system-test.cfg", + ".kokoro/presubmit/node12/common.cfg", + ".kokoro/presubmit/node12/test.cfg", + ".kokoro/publish.sh", + ".kokoro/release/docs-devsite.cfg", + ".kokoro/release/docs-devsite.sh", + ".kokoro/release/docs.cfg", + ".kokoro/release/docs.sh", + ".kokoro/release/publish.cfg", + ".kokoro/samples-test.sh", + ".kokoro/system-test.sh", + ".kokoro/test.bat", + ".kokoro/test.sh", + ".kokoro/trampoline.sh", + ".mocharc.js", + ".nycrc", + ".prettierignore", + ".prettierrc.js", + "CODE_OF_CONDUCT.md", + "CONTRIBUTING.md", + "LICENSE", + "README.md", + "api-extractor.json", + "linkinator.config.json", + "package-lock.json.3481972961", + "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", + "protos/protos.d.ts", + "protos/protos.js", + "protos/protos.json", + "renovate.json", + "samples/README.md", + "samples/package-lock.json.2394233924", + "src/index.ts", + "src/v1beta/game_server_clusters_service_client.ts", + "src/v1beta/game_server_clusters_service_client_config.json", + "src/v1beta/game_server_clusters_service_proto_list.json", + "src/v1beta/game_server_configs_service_client.ts", + "src/v1beta/game_server_configs_service_client_config.json", + "src/v1beta/game_server_configs_service_proto_list.json", + "src/v1beta/game_server_deployments_service_client.ts", + "src/v1beta/game_server_deployments_service_client_config.json", + "src/v1beta/game_server_deployments_service_proto_list.json", + "src/v1beta/index.ts", + "src/v1beta/realms_service_client.ts", + "src/v1beta/realms_service_client_config.json", + "src/v1beta/realms_service_proto_list.json", + "system-test/fixtures/sample/src/index.js", + "system-test/fixtures/sample/src/index.ts", + "system-test/install.ts", + "test/gapic_game_server_clusters_service_v1beta.ts", + "test/gapic_game_server_configs_service_v1beta.ts", + "test/gapic_game_server_deployments_service_v1beta.ts", + "test/gapic_realms_service_v1beta.ts", + "tsconfig.json", + "webpack.config.js" ] } \ No newline at end of file From abf940d6b6cab5f214821ed8cc6d202fdc1005a4 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 21 Aug 2020 09:26:36 -0700 Subject: [PATCH 069/180] build: move system and samples test from Node 10 to Node 12 (#117) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/ba2d388f-b3b2-4ad7-a163-0c6b4d86894f/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/05de3e1e14a0b07eab8b474e669164dbd31f81fb --- packages/google-cloud-gaming/synth.metadata | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 299637d8d30..edab5840a74 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "4d04f32af05a0014d3de2cc791618262bc9b6d84" + "sha": "73d77648ad81b7665ec01a6026b5cabc71461a21" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1a60ff2a3975c2f5054431588bd95db9c3b862ba" + "sha": "05de3e1e14a0b07eab8b474e669164dbd31f81fb" } } ], @@ -60,19 +60,19 @@ ".kokoro/common.cfg", ".kokoro/continuous/node10/common.cfg", ".kokoro/continuous/node10/docs.cfg", - ".kokoro/continuous/node10/lint.cfg", - ".kokoro/continuous/node10/samples-test.cfg", - ".kokoro/continuous/node10/system-test.cfg", ".kokoro/continuous/node10/test.cfg", ".kokoro/continuous/node12/common.cfg", + ".kokoro/continuous/node12/lint.cfg", + ".kokoro/continuous/node12/samples-test.cfg", + ".kokoro/continuous/node12/system-test.cfg", ".kokoro/continuous/node12/test.cfg", ".kokoro/docs.sh", ".kokoro/lint.sh", ".kokoro/populate-secrets.sh", ".kokoro/presubmit/node10/common.cfg", - ".kokoro/presubmit/node10/samples-test.cfg", - ".kokoro/presubmit/node10/system-test.cfg", ".kokoro/presubmit/node12/common.cfg", + ".kokoro/presubmit/node12/samples-test.cfg", + ".kokoro/presubmit/node12/system-test.cfg", ".kokoro/presubmit/node12/test.cfg", ".kokoro/publish.sh", ".kokoro/release/docs-devsite.cfg", @@ -95,7 +95,6 @@ "README.md", "api-extractor.json", "linkinator.config.json", - "package-lock.json.3481972961", "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", @@ -110,7 +109,6 @@ "protos/protos.json", "renovate.json", "samples/README.md", - "samples/package-lock.json.2394233924", "src/index.ts", "src/v1beta/game_server_clusters_service_client.ts", "src/v1beta/game_server_clusters_service_client_config.json", From 6974977a3b615401dba456cc3bc8c0de861acd40 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 28 Aug 2020 15:00:02 -0700 Subject: [PATCH 070/180] build: track flaky tests for "nightly", add new secrets for tagging (#118) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/d56361e6-7265-4ad8-8ccb-dc2ff9ab5573/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/8cf6d2834ad14318e64429c3b94f6443ae83daf9 --- packages/google-cloud-gaming/synth.metadata | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index edab5840a74..eb8b9d58a41 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "73d77648ad81b7665ec01a6026b5cabc71461a21" + "sha": "98bedb8f71cfd1cf2fbad9e3cf7b9b7d1b06a5a8" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "05de3e1e14a0b07eab8b474e669164dbd31f81fb" + "sha": "8cf6d2834ad14318e64429c3b94f6443ae83daf9" } } ], @@ -51,7 +51,6 @@ ".github/ISSUE_TEMPLATE/feature_request.md", ".github/ISSUE_TEMPLATE/support_request.md", ".github/PULL_REQUEST_TEMPLATE.md", - ".github/publish.yml", ".github/release-please.yml", ".github/workflows/ci.yaml", ".gitignore", From d7f040ecb7213c1287e193999d5f3b3c32b1c9b5 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sat, 12 Sep 2020 14:06:16 -0700 Subject: [PATCH 071/180] build(test): recursively find test files; fail on unsupported dependency versions (#121) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/396d1a63-c8ed-42ae-811f-d2b08d6e2089/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/fdd03c161003ab97657cc0218f25c82c89ddf4b6 --- packages/google-cloud-gaming/.mocharc.js | 3 ++- packages/google-cloud-gaming/synth.metadata | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-gaming/.mocharc.js b/packages/google-cloud-gaming/.mocharc.js index ff7b34fa5d1..0b600509bed 100644 --- a/packages/google-cloud-gaming/.mocharc.js +++ b/packages/google-cloud-gaming/.mocharc.js @@ -14,7 +14,8 @@ const config = { "enable-source-maps": true, "throw-deprecation": true, - "timeout": 10000 + "timeout": 10000, + "recursive": true } if (process.env.MOCHA_THROW_DEPRECATION === 'false') { delete config['throw-deprecation']; diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index eb8b9d58a41..562fb486402 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "98bedb8f71cfd1cf2fbad9e3cf7b9b7d1b06a5a8" + "sha": "c369f6295fa4429c2083cacce9574ba67fd3138f" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "8cf6d2834ad14318e64429c3b94f6443ae83daf9" + "sha": "fdd03c161003ab97657cc0218f25c82c89ddf4b6" } } ], From ab0fbcd7d2d0d9c8b57e382714218dcdb6f9bb21 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 12 Oct 2020 21:54:21 +0200 Subject: [PATCH 072/180] chore(deps): update dependency webpack-cli to v4 (#127) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [webpack-cli](https://togithub.com/webpack/webpack-cli) | devDependencies | major | [`^3.3.10` -> `^4.0.0`](https://renovatebot.com/diffs/npm/webpack-cli/3.3.12/4.0.0) | --- ### Release Notes
webpack/webpack-cli ### [`v4.0.0`](https://togithub.com/webpack/webpack-cli/blob/master/CHANGELOG.md#​400-httpsgithubcomwebpackwebpack-clicomparewebpack-cli400-rc1webpack-cli400-2020-10-10) [Compare Source](https://togithub.com/webpack/webpack-cli/compare/v3.3.12...webpack-cli@4.0.0) ##### Bug Fixes - add compilation lifecycle in watch instance ([#​1903](https://togithub.com/webpack/webpack-cli/issues/1903)) ([02b6d21](https://togithub.com/webpack/webpack-cli/commit/02b6d21eaa20166a7ed37816de716b8fc22b756a)) - cleanup `package-utils` package ([#​1822](https://togithub.com/webpack/webpack-cli/issues/1822)) ([fd5b92b](https://togithub.com/webpack/webpack-cli/commit/fd5b92b3cd40361daec5bf4486e455a41f4c9738)) - cli-executer supplies args further up ([#​1904](https://togithub.com/webpack/webpack-cli/issues/1904)) ([097564a](https://togithub.com/webpack/webpack-cli/commit/097564a851b36b63e0a6bf88144997ef65aa057a)) - exit code for validation errors ([59f6303](https://togithub.com/webpack/webpack-cli/commit/59f63037fcbdbb8934b578b9adf5725bc4ae1235)) - exit process in case of schema errors ([71e89b4](https://togithub.com/webpack/webpack-cli/commit/71e89b4092d953ea587cc4f606451ab78cbcdb93)) ##### Features - assign config paths in build dependencies in cache config ([#​1900](https://togithub.com/webpack/webpack-cli/issues/1900)) ([7e90f11](https://togithub.com/webpack/webpack-cli/commit/7e90f110b119f36ef9def4f66cf4e17ccf1438cd))
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 5ccf47096b9..79accef0e46 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -48,7 +48,7 @@ "ts-loader": "^8.0.0", "typescript": "^3.8.3", "webpack": "^4.41.2", - "webpack-cli": "^3.3.10", + "webpack-cli": "^4.0.0", "@microsoft/api-documenter": "^7.8.10", "@microsoft/api-extractor": "^7.8.10" }, From 4184f596ddc3cc4ac336421bf3a21070cece53b0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Oct 2020 23:02:32 +0200 Subject: [PATCH 073/180] chore(deps): update dependency webpack to v5 (#126) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [webpack](https://togithub.com/webpack/webpack) | devDependencies | major | [`^4.41.2` -> `^5.0.0`](https://renovatebot.com/diffs/npm/webpack/4.44.2/5.1.0) | --- ### Release Notes
webpack/webpack ### [`v5.1.0`](https://togithub.com/webpack/webpack/releases/v5.1.0) [Compare Source](https://togithub.com/webpack/webpack/compare/v5.0.0...v5.1.0) ### Features - expose `webpack` property from `Compiler` - expose `cleverMerge`, `EntryOptionPlugin`, `DynamicEntryPlugin` ### Bugfixes - missing `require("..").xxx` in try-catch produces a warning instead of an error now - handle reexports in concatenated modules correctly when they are side-effect-free - fix incorrect deprecation message for ModuleTemplate.hooks.hash ### [`v5.0.0`](https://togithub.com/webpack/webpack/releases/v5.0.0) [Compare Source](https://togithub.com/webpack/webpack/compare/v4.44.2...v5.0.0) [Announcement and changelog](https://webpack.js.org/blog/2020-10-10-webpack-5-release/)
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 79accef0e46..e2db0d49c02 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -47,7 +47,7 @@ "sinon": "^9.0.1", "ts-loader": "^8.0.0", "typescript": "^3.8.3", - "webpack": "^4.41.2", + "webpack": "^5.0.0", "webpack-cli": "^4.0.0", "@microsoft/api-documenter": "^7.8.10", "@microsoft/api-extractor": "^7.8.10" From de922d4af533b04de83b74d5d0b0cdf177e88b77 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 28 Oct 2020 18:22:42 -0700 Subject: [PATCH 074/180] build: update to the latest build config (#129) * chore: update bucket for cloud-rad Co-authored-by: gcf-merge-on-green[bot] <60162190+gcf-merge-on-green[bot]@users.noreply.github.com> Source-Author: F. Hinkelmann Source-Date: Wed Sep 30 14:13:57 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 079dcce498117f9570cebe6e6cff254b38ba3860 Source-Link: https://github.com/googleapis/synthtool/commit/079dcce498117f9570cebe6e6cff254b38ba3860 * build(node_library): migrate to Trampoline V2 Source-Author: Takashi Matsuo Source-Date: Fri Oct 2 12:13:27 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9 Source-Link: https://github.com/googleapis/synthtool/commit/0c868d49b8e05bc1f299bc773df9eb4ef9ed96e9 * build: only check --engine-strict for production deps Co-authored-by: Justin Beckwith Source-Author: Benjamin E. Coe Source-Date: Thu Oct 15 17:40:52 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 5451633881133e5573cc271a18e73b18caca8b1b Source-Link: https://github.com/googleapis/synthtool/commit/5451633881133e5573cc271a18e73b18caca8b1b * chore: clean up Node.js TOC for cloud-rad Source-Author: F. Hinkelmann Source-Date: Wed Oct 21 09:26:04 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: f96d3b455fe27c3dc7bc37c3c9cd27b1c6d269c8 Source-Link: https://github.com/googleapis/synthtool/commit/f96d3b455fe27c3dc7bc37c3c9cd27b1c6d269c8 * chore: fix Node.js TOC for cloud-rad Source-Author: F. Hinkelmann Source-Date: Wed Oct 21 12:01:24 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 901ddd44e9ef7887ee681b9183bbdea99437fdcc Source-Link: https://github.com/googleapis/synthtool/commit/901ddd44e9ef7887ee681b9183bbdea99437fdcc * chore(docs): update code of conduct of synthtool and templates Source-Author: Christopher Wilcox Source-Date: Thu Oct 22 14:22:01 2020 -0700 Source-Repo: googleapis/synthtool Source-Sha: 5f6ef0ec5501d33c4667885b37a7685a30d41a76 Source-Link: https://github.com/googleapis/synthtool/commit/5f6ef0ec5501d33c4667885b37a7685a30d41a76 * build(node): update testing matrix Source-Author: Benjamin E. Coe Source-Date: Thu Oct 22 22:32:52 2020 -0500 Source-Repo: googleapis/synthtool Source-Sha: b7413d38b763827c72c0360f0a3d286c84656eeb Source-Link: https://github.com/googleapis/synthtool/commit/b7413d38b763827c72c0360f0a3d286c84656eeb * build(node): don't run prepare during smoke test Source-Author: Benjamin E. Coe Source-Date: Fri Oct 23 17:27:51 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: a783321fd55f010709294455584a553f4b24b944 Source-Link: https://github.com/googleapis/synthtool/commit/a783321fd55f010709294455584a553f4b24b944 * build(node): cleanup production deps before installing dev/production Source-Author: Benjamin E. Coe Source-Date: Mon Oct 26 10:37:03 2020 -0400 Source-Repo: googleapis/synthtool Source-Sha: 89c849ba5013e45e8fb688b138f33c2ec6083dc5 Source-Link: https://github.com/googleapis/synthtool/commit/89c849ba5013e45e8fb688b138f33c2ec6083dc5 --- .../google-cloud-gaming/CODE_OF_CONDUCT.md | 123 +++++++++++++----- packages/google-cloud-gaming/synth.metadata | 6 +- 2 files changed, 91 insertions(+), 38 deletions(-) diff --git a/packages/google-cloud-gaming/CODE_OF_CONDUCT.md b/packages/google-cloud-gaming/CODE_OF_CONDUCT.md index 46b2a08ea6d..2add2547a81 100644 --- a/packages/google-cloud-gaming/CODE_OF_CONDUCT.md +++ b/packages/google-cloud-gaming/CODE_OF_CONDUCT.md @@ -1,43 +1,94 @@ -# Contributor Code of Conduct + +# Code of Conduct -As contributors and maintainers of this project, -and in the interest of fostering an open and welcoming community, -we pledge to respect all people who contribute through reporting issues, -posting feature requests, updating documentation, -submitting pull requests or patches, and other activities. +## Our Pledge -We are committed to making participation in this project -a harassment-free experience for everyone, -regardless of level of experience, gender, gender identity and expression, -sexual orientation, disability, personal appearance, -body size, race, ethnicity, age, religion, or nationality. +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 -* Personal attacks -* Trolling or insulting/derogatory comments -* Public or private harassment -* Publishing other's private information, -such as physical or electronic -addresses, without explicit permission -* Other unethical or unprofessional conduct. +* 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. -By adopting this Code of Conduct, -project maintainers commit themselves to fairly and consistently -applying these principles to every aspect of managing this project. -Project maintainers who do not follow or enforce the Code of Conduct -may be permanently removed from the project team. - -This code of conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. - -Instances of abusive, harassing, or otherwise unacceptable behavior -may be reported by opening an issue -or contacting one or more of the project maintainers. - -This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, -available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) +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/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 562fb486402..0ea9a082a4c 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "c369f6295fa4429c2083cacce9574ba67fd3138f" + "sha": "2d6efb795625f3524e604ed2de56930efcb874df" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "fdd03c161003ab97657cc0218f25c82c89ddf4b6" + "sha": "89c849ba5013e45e8fb688b138f33c2ec6083dc5" } } ], @@ -84,10 +84,12 @@ ".kokoro/test.bat", ".kokoro/test.sh", ".kokoro/trampoline.sh", + ".kokoro/trampoline_v2.sh", ".mocharc.js", ".nycrc", ".prettierignore", ".prettierrc.js", + ".trampolinerc", "CODE_OF_CONDUCT.md", "CONTRIBUTING.md", "LICENSE", From d4a8fb6fe712741de6dc8f444dcc124e6ccb46bf Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 2 Nov 2020 15:58:14 -0800 Subject: [PATCH 075/180] build(node): add KOKORO_BUILD_ARTIFACTS_SUBDIR to env (#130) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/325cd597-d8fe-40d6-aad1-01bd299fa976/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/ba9918cd22874245b55734f57470c719b577e591 --- packages/google-cloud-gaming/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 0ea9a082a4c..18211455a0f 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "2d6efb795625f3524e604ed2de56930efcb874df" + "sha": "3aa901f94c8f73c2f1322ef668685c3a792a9fd7" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "89c849ba5013e45e8fb688b138f33c2ec6083dc5" + "sha": "ba9918cd22874245b55734f57470c719b577e591" } } ], From c4d64f4567004ada08d2d77e0a715d24eabb0a23 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 6 Nov 2020 14:59:45 -0800 Subject: [PATCH 076/180] build: add v1.GameServerClustersServiceClient type (#131) --- packages/google-cloud-gaming/src/index.ts | 4 ++++ packages/google-cloud-gaming/synth.metadata | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/src/index.ts b/packages/google-cloud-gaming/src/index.ts index 8ff4ccb7fbf..05c94cbb4be 100644 --- a/packages/google-cloud-gaming/src/index.ts +++ b/packages/google-cloud-gaming/src/index.ts @@ -20,10 +20,14 @@ 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, diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 18211455a0f..57e264fe52c 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "3aa901f94c8f73c2f1322ef668685c3a792a9fd7" + "sha": "ee22980eb2c0af179d4e3cee35d13b99f9af2c32" } }, { From 3b4e1901cf3dcd53e63086ff2b59018b21a5e27a Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Fri, 6 Nov 2020 17:00:12 -0800 Subject: [PATCH 077/180] fix: do not modify options object, use defaultScopes (#132) Regenerated the library using [gapic-generator-typescript](https://github.com/googleapis/gapic-generator-typescript) v1.2.1. --- packages/google-cloud-gaming/package.json | 2 +- .../game_server_clusters_service_client.ts | 232 +++++++++------- .../game_server_configs_service_client.ts | 186 +++++++------ .../game_server_deployments_service_client.ts | 260 +++++++++++------- .../src/v1beta/realms_service_client.ts | 219 ++++++++------- packages/google-cloud-gaming/synth.metadata | 4 +- .../system-test/fixtures/sample/src/index.ts | 38 ++- .../system-test/install.ts | 18 +- 8 files changed, 570 insertions(+), 389 deletions(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index e2db0d49c02..11127f5257c 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -29,7 +29,7 @@ "api-documenter": "api-documenter yaml --input-folder=temp" }, "dependencies": { - "google-gax": "^2.1.0" + "google-gax": "^2.9.2" }, "devDependencies": { "@types/mocha": "^8.0.0", 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 index 26dbec1240c..9c3b1386e90 100644 --- 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 @@ -63,8 +63,10 @@ export class GameServerClustersServiceClient { /** * Construct an instance of GameServerClustersServiceClient. * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. + * @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/master/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] @@ -84,44 +86,34 @@ export class GameServerClustersServiceClient { * 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. + * TODO(@alexander-fenster): link to gax documentation. + * @param {boolean} fallback - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. */ - constructor(opts?: ClientOptions) { - // Ensure that options include the service address and port. + // Ensure that options include all the required fields. const staticMembers = this .constructor as typeof GameServerClustersServiceClient; const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; - const port = opts && opts.port ? opts.port : staticMembers.port; + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? typeof window !== 'undefined'; + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - if (!opts) { - opts = {servicePath, port}; + // 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; } - opts.servicePath = opts.servicePath || servicePath; - opts.port = opts.port || port; - - // users can override the config from client side, like retry codes name. - // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 - // The way to override client config for Showcase API: - // - // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} - // const showcaseClient = new showcaseClient({ projectId, customConfig }); - opts.clientConfig = opts.clientConfig || {}; - // If we're running in browser, it's OK to omit `fallback` since - // google-gax has `browser` field in its `package.json`. - // For Electron (which does not respect `browser` field), - // pass `{fallback: true}` to the GameServerClustersServiceClient constructor. + // Choose either gRPC or proto-over-HTTP implementation of google-gax. this._gaxModule = opts.fallback ? gax.fallback : gax; - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = (this - .constructor as typeof GameServerClustersServiceClient).scopes; + // 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. @@ -130,6 +122,11 @@ export class GameServerClustersServiceClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // 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) { @@ -346,6 +343,7 @@ export class GameServerClustersServiceClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'gameservices.googleapis.com'; @@ -354,6 +352,7 @@ export class GameServerClustersServiceClient { /** * 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'; @@ -361,6 +360,7 @@ export class GameServerClustersServiceClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -369,6 +369,7 @@ export class GameServerClustersServiceClient { /** * 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']; @@ -378,8 +379,7 @@ export class GameServerClustersServiceClient { getProjectId(callback: Callback): void; /** * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. + * @returns {Promise} A promise that resolves to string containing the project ID. */ getProjectId( callback?: Callback @@ -441,7 +441,11 @@ export class GameServerClustersServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getGameServerCluster(request); */ getGameServerCluster( request: protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, @@ -543,7 +547,11 @@ export class GameServerClustersServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.previewCreateGameServerCluster(request); */ previewCreateGameServerCluster( request: protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, @@ -644,7 +652,11 @@ export class GameServerClustersServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.previewDeleteGameServerCluster(request); */ previewDeleteGameServerCluster( request: protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, @@ -752,7 +764,11 @@ export class GameServerClustersServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.previewUpdateGameServerCluster(request); */ previewUpdateGameServerCluster( request: protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, @@ -857,8 +873,15 @@ export class GameServerClustersServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.createGameServerCluster(request); + * const [response] = await operation.promise(); */ createGameServerCluster( request: protos.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, @@ -914,18 +937,19 @@ export class GameServerClustersServiceClient { ); } /** - * Check the status of the long running operation returned by the createGameServerCluster() method. + * 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. - * - * @example: - * const decodedOperation = await checkCreateGameServerClusterProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkCreateGameServerClusterProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkCreateGameServerClusterProgress( name: string @@ -996,8 +1020,15 @@ export class GameServerClustersServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.deleteGameServerCluster(request); + * const [response] = await operation.promise(); */ deleteGameServerCluster( request: protos.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, @@ -1053,18 +1084,19 @@ export class GameServerClustersServiceClient { ); } /** - * Check the status of the long running operation returned by the deleteGameServerCluster() method. + * 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. - * - * @example: - * const decodedOperation = await checkDeleteGameServerClusterProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkDeleteGameServerClusterProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkDeleteGameServerClusterProgress( name: string @@ -1142,8 +1174,15 @@ export class GameServerClustersServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.updateGameServerCluster(request); + * const [response] = await operation.promise(); */ updateGameServerCluster( request: protos.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, @@ -1199,18 +1238,19 @@ export class GameServerClustersServiceClient { ); } /** - * Check the status of the long running operation returned by the updateGameServerCluster() method. + * 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. - * - * @example: - * const decodedOperation = await checkUpdateGameServerClusterProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkUpdateGameServerClusterProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkUpdateGameServerClusterProgress( name: string @@ -1290,19 +1330,14 @@ export class GameServerClustersServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 support auto-pagination by default: it will call the API as many + * 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. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [GameServerCluster]{@link google.cloud.gaming.v1beta.GameServerCluster} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListGameServerClustersRequest]{@link google.cloud.gaming.v1beta.ListGameServerClustersRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListGameServerClustersResponse]{@link google.cloud.gaming.v1beta.ListGameServerClustersResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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, @@ -1354,18 +1389,7 @@ export class GameServerClustersServiceClient { } /** - * Equivalent to {@link listGameServerClusters}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listGameServerClusters} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * 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 @@ -1388,6 +1412,13 @@ export class GameServerClustersServiceClient { * 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, @@ -1412,10 +1443,9 @@ export class GameServerClustersServiceClient { } /** - * Equivalent to {@link listGameServerClusters}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * 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 @@ -1437,7 +1467,18 @@ export class GameServerClustersServiceClient { * @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 conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * 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 + * const iterable = client.listGameServerClustersAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listGameServerClustersAsync( request?: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, @@ -1791,9 +1832,10 @@ export class GameServerClustersServiceClient { } /** - * Terminate the GRPC channel and close the client. + * 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 { this.initialize(); 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 index acd59c064bc..2f08d558ed9 100644 --- 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 @@ -62,8 +62,10 @@ export class GameServerConfigsServiceClient { /** * Construct an instance of GameServerConfigsServiceClient. * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. + * @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/master/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] @@ -83,44 +85,34 @@ export class GameServerConfigsServiceClient { * 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. + * TODO(@alexander-fenster): link to gax documentation. + * @param {boolean} fallback - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. */ - constructor(opts?: ClientOptions) { - // Ensure that options include the service address and port. + // Ensure that options include all the required fields. const staticMembers = this .constructor as typeof GameServerConfigsServiceClient; const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; - const port = opts && opts.port ? opts.port : staticMembers.port; + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? typeof window !== 'undefined'; + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - if (!opts) { - opts = {servicePath, port}; + // 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; } - opts.servicePath = opts.servicePath || servicePath; - opts.port = opts.port || port; - - // users can override the config from client side, like retry codes name. - // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 - // The way to override client config for Showcase API: - // - // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} - // const showcaseClient = new showcaseClient({ projectId, customConfig }); - opts.clientConfig = opts.clientConfig || {}; - // If we're running in browser, it's OK to omit `fallback` since - // google-gax has `browser` field in its `package.json`. - // For Electron (which does not respect `browser` field), - // pass `{fallback: true}` to the GameServerConfigsServiceClient constructor. + // Choose either gRPC or proto-over-HTTP implementation of google-gax. this._gaxModule = opts.fallback ? gax.fallback : gax; - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = (this - .constructor as typeof GameServerConfigsServiceClient).scopes; + // 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. @@ -129,6 +121,11 @@ export class GameServerConfigsServiceClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // 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) { @@ -326,6 +323,7 @@ export class GameServerConfigsServiceClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'gameservices.googleapis.com'; @@ -334,6 +332,7 @@ export class GameServerConfigsServiceClient { /** * 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'; @@ -341,6 +340,7 @@ export class GameServerConfigsServiceClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -349,6 +349,7 @@ export class GameServerConfigsServiceClient { /** * 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']; @@ -358,8 +359,7 @@ export class GameServerConfigsServiceClient { getProjectId(callback: Callback): void; /** * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. + * @returns {Promise} A promise that resolves to string containing the project ID. */ getProjectId( callback?: Callback @@ -418,7 +418,11 @@ export class GameServerConfigsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getGameServerConfig(request); */ getGameServerConfig( request: protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, @@ -519,8 +523,15 @@ export class GameServerConfigsServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.createGameServerConfig(request); + * const [response] = await operation.promise(); */ createGameServerConfig( request: protos.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, @@ -576,18 +587,19 @@ export class GameServerConfigsServiceClient { ); } /** - * Check the status of the long running operation returned by the createGameServerConfig() method. + * 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. - * - * @example: - * const decodedOperation = await checkCreateGameServerConfigProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkCreateGameServerConfigProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkCreateGameServerConfigProgress( name: string @@ -660,8 +672,15 @@ export class GameServerConfigsServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.deleteGameServerConfig(request); + * const [response] = await operation.promise(); */ deleteGameServerConfig( request: protos.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, @@ -717,18 +736,19 @@ export class GameServerConfigsServiceClient { ); } /** - * Check the status of the long running operation returned by the deleteGameServerConfig() method. + * 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. - * - * @example: - * const decodedOperation = await checkDeleteGameServerConfigProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkDeleteGameServerConfigProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkDeleteGameServerConfigProgress( name: string @@ -810,19 +830,14 @@ export class GameServerConfigsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 support auto-pagination by default: it will call the API as many + * 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. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [GameServerConfig]{@link google.cloud.gaming.v1beta.GameServerConfig} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListGameServerConfigsRequest]{@link google.cloud.gaming.v1beta.ListGameServerConfigsRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListGameServerConfigsResponse]{@link google.cloud.gaming.v1beta.ListGameServerConfigsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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, @@ -870,18 +885,7 @@ export class GameServerConfigsServiceClient { } /** - * Equivalent to {@link listGameServerConfigs}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listGameServerConfigs} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * 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 @@ -905,6 +909,13 @@ export class GameServerConfigsServiceClient { * 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, @@ -929,10 +940,9 @@ export class GameServerConfigsServiceClient { } /** - * Equivalent to {@link listGameServerConfigs}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * 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 @@ -955,7 +965,18 @@ export class GameServerConfigsServiceClient { * @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 conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * 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 + * const iterable = client.listGameServerConfigsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listGameServerConfigsAsync( request?: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, @@ -1309,9 +1330,10 @@ export class GameServerConfigsServiceClient { } /** - * Terminate the GRPC channel and close the client. + * 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 { this.initialize(); 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 index 546fb7db9ec..5048aefe2b3 100644 --- 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 @@ -63,8 +63,10 @@ export class GameServerDeploymentsServiceClient { /** * Construct an instance of GameServerDeploymentsServiceClient. * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. + * @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/master/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] @@ -84,44 +86,34 @@ export class GameServerDeploymentsServiceClient { * 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. + * TODO(@alexander-fenster): link to gax documentation. + * @param {boolean} fallback - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. */ - constructor(opts?: ClientOptions) { - // Ensure that options include the service address and port. + // Ensure that options include all the required fields. const staticMembers = this .constructor as typeof GameServerDeploymentsServiceClient; const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; - const port = opts && opts.port ? opts.port : staticMembers.port; + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? typeof window !== 'undefined'; + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - if (!opts) { - opts = {servicePath, port}; + // 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; } - opts.servicePath = opts.servicePath || servicePath; - opts.port = opts.port || port; - - // users can override the config from client side, like retry codes name. - // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 - // The way to override client config for Showcase API: - // - // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} - // const showcaseClient = new showcaseClient({ projectId, customConfig }); - opts.clientConfig = opts.clientConfig || {}; - // If we're running in browser, it's OK to omit `fallback` since - // google-gax has `browser` field in its `package.json`. - // For Electron (which does not respect `browser` field), - // pass `{fallback: true}` to the GameServerDeploymentsServiceClient constructor. + // Choose either gRPC or proto-over-HTTP implementation of google-gax. this._gaxModule = opts.fallback ? gax.fallback : gax; - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = (this - .constructor as typeof GameServerDeploymentsServiceClient).scopes; + // 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. @@ -130,6 +122,11 @@ export class GameServerDeploymentsServiceClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // 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) { @@ -362,6 +359,7 @@ export class GameServerDeploymentsServiceClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'gameservices.googleapis.com'; @@ -370,6 +368,7 @@ export class GameServerDeploymentsServiceClient { /** * 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'; @@ -377,6 +376,7 @@ export class GameServerDeploymentsServiceClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -385,6 +385,7 @@ export class GameServerDeploymentsServiceClient { /** * 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']; @@ -394,8 +395,7 @@ export class GameServerDeploymentsServiceClient { getProjectId(callback: Callback): void; /** * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. + * @returns {Promise} A promise that resolves to string containing the project ID. */ getProjectId( callback?: Callback @@ -457,7 +457,11 @@ export class GameServerDeploymentsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getGameServerDeployment(request); */ getGameServerDeployment( request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, @@ -557,7 +561,11 @@ export class GameServerDeploymentsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getGameServerDeploymentRollout(request); */ getGameServerDeploymentRollout( request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, @@ -667,7 +675,11 @@ export class GameServerDeploymentsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.previewGameServerDeploymentRollout(request); */ previewGameServerDeploymentRollout( request: protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, @@ -769,7 +781,11 @@ export class GameServerDeploymentsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.fetchDeploymentState(request); */ fetchDeploymentState( request: protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, @@ -870,8 +886,15 @@ export class GameServerDeploymentsServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.createGameServerDeployment(request); + * const [response] = await operation.promise(); */ createGameServerDeployment( request: protos.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, @@ -927,18 +950,19 @@ export class GameServerDeploymentsServiceClient { ); } /** - * Check the status of the long running operation returned by the createGameServerDeployment() method. + * 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. - * - * @example: - * const decodedOperation = await checkCreateGameServerDeploymentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkCreateGameServerDeploymentProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkCreateGameServerDeploymentProgress( name: string @@ -1010,8 +1034,15 @@ export class GameServerDeploymentsServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.deleteGameServerDeployment(request); + * const [response] = await operation.promise(); */ deleteGameServerDeployment( request: protos.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, @@ -1067,18 +1098,19 @@ export class GameServerDeploymentsServiceClient { ); } /** - * Check the status of the long running operation returned by the deleteGameServerDeployment() method. + * 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. - * - * @example: - * const decodedOperation = await checkDeleteGameServerDeploymentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkDeleteGameServerDeploymentProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkDeleteGameServerDeploymentProgress( name: string @@ -1156,8 +1188,15 @@ export class GameServerDeploymentsServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.updateGameServerDeployment(request); + * const [response] = await operation.promise(); */ updateGameServerDeployment( request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, @@ -1213,18 +1252,19 @@ export class GameServerDeploymentsServiceClient { ); } /** - * Check the status of the long running operation returned by the updateGameServerDeployment() method. + * 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. - * - * @example: - * const decodedOperation = await checkUpdateGameServerDeploymentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkUpdateGameServerDeploymentProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkUpdateGameServerDeploymentProgress( name: string @@ -1307,8 +1347,15 @@ export class GameServerDeploymentsServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.updateGameServerDeploymentRollout(request); + * const [response] = await operation.promise(); */ updateGameServerDeploymentRollout( request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, @@ -1364,18 +1411,19 @@ export class GameServerDeploymentsServiceClient { ); } /** - * Check the status of the long running operation returned by the updateGameServerDeploymentRollout() method. + * 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. - * - * @example: - * const decodedOperation = await checkUpdateGameServerDeploymentRolloutProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkUpdateGameServerDeploymentRolloutProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkUpdateGameServerDeploymentRolloutProgress( name: string @@ -1456,19 +1504,14 @@ export class GameServerDeploymentsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 support auto-pagination by default: it will call the API as many + * 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. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [GameServerDeployment]{@link google.cloud.gaming.v1beta.GameServerDeployment} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListGameServerDeploymentsRequest]{@link google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListGameServerDeploymentsResponse]{@link google.cloud.gaming.v1beta.ListGameServerDeploymentsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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, @@ -1520,18 +1563,7 @@ export class GameServerDeploymentsServiceClient { } /** - * Equivalent to {@link listGameServerDeployments}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listGameServerDeployments} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * 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 @@ -1555,6 +1587,13 @@ export class GameServerDeploymentsServiceClient { * 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, @@ -1579,10 +1618,9 @@ export class GameServerDeploymentsServiceClient { } /** - * Equivalent to {@link listGameServerDeployments}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * 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 @@ -1605,7 +1643,18 @@ export class GameServerDeploymentsServiceClient { * @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 conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * 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 + * const iterable = client.listGameServerDeploymentsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listGameServerDeploymentsAsync( request?: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, @@ -1959,9 +2008,10 @@ export class GameServerDeploymentsServiceClient { } /** - * Terminate the GRPC channel and close the client. + * 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 { this.initialize(); diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index 2a1cd760a54..4f744d417d5 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -63,8 +63,10 @@ export class RealmsServiceClient { /** * Construct an instance of RealmsServiceClient. * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. + * @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/master/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] @@ -84,42 +86,33 @@ export class RealmsServiceClient { * 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. + * TODO(@alexander-fenster): link to gax documentation. + * @param {boolean} fallback - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. */ - constructor(opts?: ClientOptions) { - // Ensure that options include the service address and port. + // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof RealmsServiceClient; const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; - const port = opts && opts.port ? opts.port : staticMembers.port; + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? typeof window !== 'undefined'; + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - if (!opts) { - opts = {servicePath, port}; + // 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; } - opts.servicePath = opts.servicePath || servicePath; - opts.port = opts.port || port; - - // users can override the config from client side, like retry codes name. - // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 - // The way to override client config for Showcase API: - // - // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} - // const showcaseClient = new showcaseClient({ projectId, customConfig }); - opts.clientConfig = opts.clientConfig || {}; - // If we're running in browser, it's OK to omit `fallback` since - // google-gax has `browser` field in its `package.json`. - // For Electron (which does not respect `browser` field), - // pass `{fallback: true}` to the RealmsServiceClient constructor. + // Choose either gRPC or proto-over-HTTP implementation of google-gax. this._gaxModule = opts.fallback ? gax.fallback : gax; - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = (this.constructor as typeof RealmsServiceClient).scopes; + // 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. @@ -128,6 +121,11 @@ export class RealmsServiceClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // 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) { @@ -329,6 +327,7 @@ export class RealmsServiceClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'gameservices.googleapis.com'; @@ -337,6 +336,7 @@ export class RealmsServiceClient { /** * 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'; @@ -344,6 +344,7 @@ export class RealmsServiceClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -352,6 +353,7 @@ export class RealmsServiceClient { /** * 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']; @@ -361,8 +363,7 @@ export class RealmsServiceClient { getProjectId(callback: Callback): void; /** * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. + * @returns {Promise} A promise that resolves to string containing the project ID. */ getProjectId( callback?: Callback @@ -416,7 +417,11 @@ export class RealmsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getRealm(request); */ getRealm( request: protos.google.cloud.gaming.v1beta.IGetRealmRequest, @@ -510,7 +515,11 @@ export class RealmsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.previewRealmUpdate(request); */ previewRealmUpdate( request: protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, @@ -608,8 +617,15 @@ export class RealmsServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.createRealm(request); + * const [response] = await operation.promise(); */ createRealm( request: protos.google.cloud.gaming.v1beta.ICreateRealmRequest, @@ -661,18 +677,19 @@ export class RealmsServiceClient { return this.innerApiCalls.createRealm(request, options, callback); } /** - * Check the status of the long running operation returned by the createRealm() method. + * 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. - * - * @example: - * const decodedOperation = await checkCreateRealmProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkCreateRealmProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkCreateRealmProgress( name: string @@ -743,8 +760,15 @@ export class RealmsServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.deleteRealm(request); + * const [response] = await operation.promise(); */ deleteRealm( request: protos.google.cloud.gaming.v1beta.IDeleteRealmRequest, @@ -796,18 +820,19 @@ export class RealmsServiceClient { return this.innerApiCalls.deleteRealm(request, options, callback); } /** - * Check the status of the long running operation returned by the deleteRealm() method. + * 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. - * - * @example: - * const decodedOperation = await checkDeleteRealmProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkDeleteRealmProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkDeleteRealmProgress( name: string @@ -885,8 +910,15 @@ export class RealmsServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.updateRealm(request); + * const [response] = await operation.promise(); */ updateRealm( request: protos.google.cloud.gaming.v1beta.IUpdateRealmRequest, @@ -938,18 +970,19 @@ export class RealmsServiceClient { return this.innerApiCalls.updateRealm(request, options, callback); } /** - * Check the status of the long running operation returned by the updateRealm() method. + * 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. - * - * @example: - * const decodedOperation = await checkUpdateRealmProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkUpdateRealmProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkUpdateRealmProgress( name: string @@ -1026,19 +1059,14 @@ export class RealmsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 support auto-pagination by default: it will call the API as many + * 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. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Realm]{@link google.cloud.gaming.v1beta.Realm} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListRealmsRequest]{@link google.cloud.gaming.v1beta.ListRealmsRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListRealmsResponse]{@link google.cloud.gaming.v1beta.ListRealmsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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, @@ -1084,18 +1112,7 @@ export class RealmsServiceClient { } /** - * Equivalent to {@link listRealms}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listRealms} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * 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 @@ -1119,6 +1136,13 @@ export class RealmsServiceClient { * 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, @@ -1143,10 +1167,9 @@ export class RealmsServiceClient { } /** - * Equivalent to {@link listRealms}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * 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 @@ -1169,7 +1192,18 @@ export class RealmsServiceClient { * @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 conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * 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 + * const iterable = client.listRealmsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listRealmsAsync( request?: protos.google.cloud.gaming.v1beta.IListRealmsRequest, @@ -1523,9 +1557,10 @@ export class RealmsServiceClient { } /** - * Terminate the GRPC channel and close the client. + * 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 { this.initialize(); diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 57e264fe52c..5b3f78be425 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "ba9918cd22874245b55734f57470c719b577e591" + "sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b" } } ], @@ -96,6 +96,7 @@ "README.md", "api-extractor.json", "linkinator.config.json", + "package-lock.json.742240568", "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", @@ -110,6 +111,7 @@ "protos/protos.json", "renovate.json", "samples/README.md", + "samples/package-lock.json.3225038820", "src/index.ts", "src/v1beta/game_server_clusters_service_client.ts", "src/v1beta/game_server_clusters_service_client_config.json", 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 index b1c9997a65b..b4ef745f138 100644 --- a/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.ts @@ -23,11 +23,41 @@ import { 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() { - new GameServerClustersServiceClient(); - new GameServerConfigsServiceClient(); - new GameServerDeploymentsServiceClient(); - new RealmsServiceClient(); + // 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 index 4c1ba3eb79a..39d90f771de 100644 --- a/packages/google-cloud-gaming/system-test/install.ts +++ b/packages/google-cloud-gaming/system-test/install.ts @@ -20,32 +20,32 @@ import {packNTest} from 'pack-n-play'; import {readFileSync} from 'fs'; import {describe, it} from 'mocha'; -describe('typescript consumer tests', () => { - it('should have correct type signature for typescript users', async function () { +describe('📦 pack-n-play test', () => { + it('TypeScript code', async function () { this.timeout(300000); const options = { - packageDir: process.cwd(), // path to your module. + packageDir: process.cwd(), sample: { - description: 'typescript based user can use the type definitions', + description: 'TypeScript user can use the type definitions', ts: readFileSync( './system-test/fixtures/sample/src/index.ts' ).toString(), }, }; - await packNTest(options); // will throw upon error. + await packNTest(options); }); - it('should have correct type signature for javascript users', async function () { + it('JavaScript code', async function () { this.timeout(300000); const options = { - packageDir: process.cwd(), // path to your module. + packageDir: process.cwd(), sample: { - description: 'typescript based user can use the type definitions', + description: 'JavaScript user can use the library', ts: readFileSync( './system-test/fixtures/sample/src/index.js' ).toString(), }, }; - await packNTest(options); // will throw upon error. + await packNTest(options); }); }); From a1e67784d649f0b72fb1969a008fda0c4d2def76 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 11 Nov 2020 12:53:46 -0800 Subject: [PATCH 078/180] chore: release 2.1.1 (#133) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-gaming/CHANGELOG.md | 7 +++++++ packages/google-cloud-gaming/package.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index 1556001dcc0..df6bd31a166 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 11127f5257c..e66a9ca29d3 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "2.1.0", + "version": "2.1.1", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index c3fcc34a9d1..0fa8ddcac82 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^2.1.0" + "@google-cloud/game-servers": "^2.1.1" }, "devDependencies": { "c8": "^7.2.1", From 94ab39b62ff32819aa6eab90f49cecb62c7e2f04 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 23 Nov 2020 12:31:38 -0800 Subject: [PATCH 079/180] fix(browser): check for fetch on window (#136) --- .../google-cloud-gaming/protos/protos.json | 831 ++++++++++++++++-- .../game_server_clusters_service_client.ts | 100 ++- .../game_server_configs_service_client.ts | 60 +- .../game_server_deployments_service_client.ts | 110 +-- .../src/v1beta/realms_service_client.ts | 80 +- packages/google-cloud-gaming/synth.metadata | 8 +- 6 files changed, 967 insertions(+), 222 deletions(-) diff --git a/packages/google-cloud-gaming/protos/protos.json b/packages/google-cloud-gaming/protos/protos.json index edf735dd05d..5c0baf5c1f3 100644 --- a/packages/google-cloud-gaming/protos/protos.json +++ b/packages/google-cloud-gaming/protos/protos.json @@ -623,7 +623,17 @@ "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", @@ -631,7 +641,17 @@ "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", @@ -642,7 +662,24 @@ "(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", @@ -650,7 +687,15 @@ "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", @@ -660,14 +705,37 @@ "(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", @@ -678,7 +746,24 @@ "(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", @@ -686,7 +771,15 @@ "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" + } + } + ] } } }, @@ -895,7 +988,17 @@ "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", @@ -903,7 +1006,17 @@ "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", @@ -914,7 +1027,24 @@ "(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", @@ -924,7 +1054,23 @@ "(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" + } + } + ] } } }, @@ -1280,7 +1426,17 @@ "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", @@ -1288,7 +1444,17 @@ "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", @@ -1299,7 +1465,24 @@ "(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", @@ -1309,7 +1492,23 @@ "(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", @@ -1320,7 +1519,24 @@ "(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", @@ -1328,7 +1544,17 @@ "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", @@ -1339,7 +1565,24 @@ "(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", @@ -1347,7 +1590,15 @@ "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", @@ -1355,7 +1606,15 @@ "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": "*" + } + } + ] } } }, @@ -1580,7 +1839,17 @@ "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", @@ -1588,7 +1857,17 @@ "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", @@ -1599,7 +1878,24 @@ "(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", @@ -1609,7 +1905,23 @@ "(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", @@ -1620,7 +1932,24 @@ "(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", @@ -1628,7 +1957,15 @@ "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" + } + } + ] } } } @@ -2251,7 +2588,17 @@ "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", @@ -2259,7 +2606,17 @@ "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", @@ -2270,7 +2627,24 @@ "(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", @@ -2278,7 +2652,15 @@ "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", @@ -2288,14 +2670,37 @@ "(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", @@ -2306,7 +2711,24 @@ "(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", @@ -2314,7 +2736,15 @@ "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" + } + } + ] } } }, @@ -2523,7 +2953,17 @@ "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", @@ -2531,7 +2971,17 @@ "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", @@ -2542,7 +2992,24 @@ "(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", @@ -2552,7 +3019,23 @@ "(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" + } + } + ] } } }, @@ -2908,7 +3391,17 @@ "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", @@ -2916,7 +3409,17 @@ "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", @@ -2927,7 +3430,24 @@ "(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", @@ -2937,7 +3457,23 @@ "(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", @@ -2948,7 +3484,24 @@ "(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", @@ -2956,7 +3509,17 @@ "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", @@ -2967,7 +3530,24 @@ "(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", @@ -2975,7 +3555,15 @@ "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", @@ -2983,7 +3571,15 @@ "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": "*" + } + } + ] } } }, @@ -3208,7 +3804,17 @@ "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", @@ -3216,7 +3822,17 @@ "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", @@ -3227,7 +3843,24 @@ "(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", @@ -3237,7 +3870,23 @@ "(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", @@ -3248,7 +3897,24 @@ "(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", @@ -3256,7 +3922,15 @@ "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" + } + } + ] } } } @@ -4435,7 +5109,17 @@ "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", @@ -4443,7 +5127,17 @@ "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", @@ -4451,7 +5145,17 @@ "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", @@ -4460,7 +5164,18 @@ "(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", 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 index 9c3b1386e90..552482b43c6 100644 --- 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 @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -31,6 +32,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * 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'; import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; @@ -86,9 +92,9 @@ export class GameServerClustersServiceClient { * 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. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -102,7 +108,9 @@ export class GameServerClustersServiceClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + 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. @@ -396,7 +404,7 @@ export class GameServerClustersServiceClient { // ------------------- getGameServerCluster( request: protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1beta.IGameServerCluster, @@ -409,7 +417,7 @@ export class GameServerClustersServiceClient { >; getGameServerCluster( request: protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.gaming.v1beta.IGameServerCluster, | protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest @@ -450,7 +458,7 @@ export class GameServerClustersServiceClient { getGameServerCluster( request: protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.gaming.v1beta.IGameServerCluster, | protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest @@ -476,12 +484,12 @@ export class GameServerClustersServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -496,7 +504,7 @@ export class GameServerClustersServiceClient { } previewCreateGameServerCluster( request: protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, @@ -509,7 +517,7 @@ export class GameServerClustersServiceClient { >; previewCreateGameServerCluster( request: protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, | protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest @@ -556,7 +564,7 @@ export class GameServerClustersServiceClient { previewCreateGameServerCluster( request: protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterResponse, | protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest @@ -582,12 +590,12 @@ export class GameServerClustersServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -606,7 +614,7 @@ export class GameServerClustersServiceClient { } previewDeleteGameServerCluster( request: protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, @@ -619,7 +627,7 @@ export class GameServerClustersServiceClient { >; previewDeleteGameServerCluster( request: protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, | protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest @@ -661,7 +669,7 @@ export class GameServerClustersServiceClient { previewDeleteGameServerCluster( request: protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterResponse, | protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest @@ -687,12 +695,12 @@ export class GameServerClustersServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -711,7 +719,7 @@ export class GameServerClustersServiceClient { } previewUpdateGameServerCluster( request: protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, @@ -724,7 +732,7 @@ export class GameServerClustersServiceClient { >; previewUpdateGameServerCluster( request: protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, | protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest @@ -773,7 +781,7 @@ export class GameServerClustersServiceClient { previewUpdateGameServerCluster( request: protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterResponse, | protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest @@ -799,12 +807,12 @@ export class GameServerClustersServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -824,7 +832,7 @@ export class GameServerClustersServiceClient { createGameServerCluster( request: protos.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -837,7 +845,7 @@ export class GameServerClustersServiceClient { >; createGameServerCluster( request: protos.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.gaming.v1beta.IGameServerCluster, @@ -886,7 +894,7 @@ export class GameServerClustersServiceClient { createGameServerCluster( request: protos.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.gaming.v1beta.IGameServerCluster, @@ -914,12 +922,12 @@ export class GameServerClustersServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -975,7 +983,7 @@ export class GameServerClustersServiceClient { } deleteGameServerCluster( request: protos.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -988,7 +996,7 @@ export class GameServerClustersServiceClient { >; deleteGameServerCluster( request: protos.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.protobuf.IEmpty, @@ -1033,7 +1041,7 @@ export class GameServerClustersServiceClient { deleteGameServerCluster( request: protos.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.protobuf.IEmpty, @@ -1061,12 +1069,12 @@ export class GameServerClustersServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1122,7 +1130,7 @@ export class GameServerClustersServiceClient { } updateGameServerCluster( request: protos.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -1135,7 +1143,7 @@ export class GameServerClustersServiceClient { >; updateGameServerCluster( request: protos.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.gaming.v1beta.IGameServerCluster, @@ -1187,7 +1195,7 @@ export class GameServerClustersServiceClient { updateGameServerCluster( request: protos.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.gaming.v1beta.IGameServerCluster, @@ -1215,12 +1223,12 @@ export class GameServerClustersServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1276,7 +1284,7 @@ export class GameServerClustersServiceClient { } listGameServerClusters( request: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1beta.IGameServerCluster[], @@ -1286,7 +1294,7 @@ export class GameServerClustersServiceClient { >; listGameServerClusters( request: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, | protos.google.cloud.gaming.v1beta.IListGameServerClustersResponse @@ -1342,7 +1350,7 @@ export class GameServerClustersServiceClient { listGameServerClusters( request: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, | protos.google.cloud.gaming.v1beta.IListGameServerClustersResponse @@ -1365,12 +1373,12 @@ export class GameServerClustersServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1422,7 +1430,7 @@ export class GameServerClustersServiceClient { */ listGameServerClustersStream( request?: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1482,7 +1490,7 @@ export class GameServerClustersServiceClient { */ listGameServerClustersAsync( request?: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; 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 index 2f08d558ed9..f92ff6e52fd 100644 --- 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 @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -31,6 +32,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * 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'; import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; @@ -85,9 +91,9 @@ export class GameServerConfigsServiceClient { * 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. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -101,7 +107,9 @@ export class GameServerConfigsServiceClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + 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. @@ -376,7 +384,7 @@ export class GameServerConfigsServiceClient { // ------------------- getGameServerConfig( request: protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1beta.IGameServerConfig, @@ -386,7 +394,7 @@ export class GameServerConfigsServiceClient { >; getGameServerConfig( request: protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.gaming.v1beta.IGameServerConfig, | protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest @@ -427,7 +435,7 @@ export class GameServerConfigsServiceClient { getGameServerConfig( request: protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.gaming.v1beta.IGameServerConfig, | protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest @@ -450,12 +458,12 @@ export class GameServerConfigsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -471,7 +479,7 @@ export class GameServerConfigsServiceClient { createGameServerConfig( request: protos.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -484,7 +492,7 @@ export class GameServerConfigsServiceClient { >; createGameServerConfig( request: protos.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.gaming.v1beta.IGameServerConfig, @@ -536,7 +544,7 @@ export class GameServerConfigsServiceClient { createGameServerConfig( request: protos.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.gaming.v1beta.IGameServerConfig, @@ -564,12 +572,12 @@ export class GameServerConfigsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -625,7 +633,7 @@ export class GameServerConfigsServiceClient { } deleteGameServerConfig( request: protos.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -638,7 +646,7 @@ export class GameServerConfigsServiceClient { >; deleteGameServerConfig( request: protos.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.protobuf.IEmpty, @@ -685,7 +693,7 @@ export class GameServerConfigsServiceClient { deleteGameServerConfig( request: protos.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.protobuf.IEmpty, @@ -713,12 +721,12 @@ export class GameServerConfigsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -774,7 +782,7 @@ export class GameServerConfigsServiceClient { } listGameServerConfigs( request: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1beta.IGameServerConfig[], @@ -784,7 +792,7 @@ export class GameServerConfigsServiceClient { >; listGameServerConfigs( request: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, | protos.google.cloud.gaming.v1beta.IListGameServerConfigsResponse @@ -842,7 +850,7 @@ export class GameServerConfigsServiceClient { listGameServerConfigs( request: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, | protos.google.cloud.gaming.v1beta.IListGameServerConfigsResponse @@ -865,12 +873,12 @@ export class GameServerConfigsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -919,7 +927,7 @@ export class GameServerConfigsServiceClient { */ listGameServerConfigsStream( request?: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -980,7 +988,7 @@ export class GameServerConfigsServiceClient { */ listGameServerConfigsAsync( request?: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; 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 index 5048aefe2b3..595304c0b82 100644 --- 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 @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -31,6 +32,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * 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'; import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; @@ -86,9 +92,9 @@ export class GameServerDeploymentsServiceClient { * 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. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -102,7 +108,9 @@ export class GameServerDeploymentsServiceClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + 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. @@ -412,7 +420,7 @@ export class GameServerDeploymentsServiceClient { // ------------------- getGameServerDeployment( request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1beta.IGameServerDeployment, @@ -425,7 +433,7 @@ export class GameServerDeploymentsServiceClient { >; getGameServerDeployment( request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.gaming.v1beta.IGameServerDeployment, | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest @@ -466,7 +474,7 @@ export class GameServerDeploymentsServiceClient { getGameServerDeployment( request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.gaming.v1beta.IGameServerDeployment, | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest @@ -492,12 +500,12 @@ export class GameServerDeploymentsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -516,7 +524,7 @@ export class GameServerDeploymentsServiceClient { } getGameServerDeploymentRollout( request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, @@ -529,7 +537,7 @@ export class GameServerDeploymentsServiceClient { >; getGameServerDeploymentRollout( request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest @@ -570,7 +578,7 @@ export class GameServerDeploymentsServiceClient { getGameServerDeploymentRollout( request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.gaming.v1beta.IGameServerDeploymentRollout, | protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest @@ -596,12 +604,12 @@ export class GameServerDeploymentsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -620,7 +628,7 @@ export class GameServerDeploymentsServiceClient { } previewGameServerDeploymentRollout( request: protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, @@ -633,7 +641,7 @@ export class GameServerDeploymentsServiceClient { >; previewGameServerDeploymentRollout( request: protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, | protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest @@ -684,7 +692,7 @@ export class GameServerDeploymentsServiceClient { previewGameServerDeploymentRollout( request: protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutResponse, | protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest @@ -710,12 +718,12 @@ export class GameServerDeploymentsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -734,7 +742,7 @@ export class GameServerDeploymentsServiceClient { } fetchDeploymentState( request: protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, @@ -747,7 +755,7 @@ export class GameServerDeploymentsServiceClient { >; fetchDeploymentState( request: protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, | protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest @@ -790,7 +798,7 @@ export class GameServerDeploymentsServiceClient { fetchDeploymentState( request: protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.gaming.v1beta.IFetchDeploymentStateResponse, | protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest @@ -816,12 +824,12 @@ export class GameServerDeploymentsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -837,7 +845,7 @@ export class GameServerDeploymentsServiceClient { createGameServerDeployment( request: protos.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -850,7 +858,7 @@ export class GameServerDeploymentsServiceClient { >; createGameServerDeployment( request: protos.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.gaming.v1beta.IGameServerDeployment, @@ -899,7 +907,7 @@ export class GameServerDeploymentsServiceClient { createGameServerDeployment( request: protos.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.gaming.v1beta.IGameServerDeployment, @@ -927,12 +935,12 @@ export class GameServerDeploymentsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -988,7 +996,7 @@ export class GameServerDeploymentsServiceClient { } deleteGameServerDeployment( request: protos.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -1001,7 +1009,7 @@ export class GameServerDeploymentsServiceClient { >; deleteGameServerDeployment( request: protos.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.protobuf.IEmpty, @@ -1047,7 +1055,7 @@ export class GameServerDeploymentsServiceClient { deleteGameServerDeployment( request: protos.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.protobuf.IEmpty, @@ -1075,12 +1083,12 @@ export class GameServerDeploymentsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1136,7 +1144,7 @@ export class GameServerDeploymentsServiceClient { } updateGameServerDeployment( request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -1149,7 +1157,7 @@ export class GameServerDeploymentsServiceClient { >; updateGameServerDeployment( request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.gaming.v1beta.IGameServerDeployment, @@ -1201,7 +1209,7 @@ export class GameServerDeploymentsServiceClient { updateGameServerDeployment( request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.gaming.v1beta.IGameServerDeployment, @@ -1229,12 +1237,12 @@ export class GameServerDeploymentsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1290,7 +1298,7 @@ export class GameServerDeploymentsServiceClient { } updateGameServerDeploymentRollout( request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -1303,7 +1311,7 @@ export class GameServerDeploymentsServiceClient { >; updateGameServerDeploymentRollout( request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.gaming.v1beta.IGameServerDeployment, @@ -1360,7 +1368,7 @@ export class GameServerDeploymentsServiceClient { updateGameServerDeploymentRollout( request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.gaming.v1beta.IGameServerDeployment, @@ -1388,12 +1396,12 @@ export class GameServerDeploymentsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1449,7 +1457,7 @@ export class GameServerDeploymentsServiceClient { } listGameServerDeployments( request: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1beta.IGameServerDeployment[], @@ -1459,7 +1467,7 @@ export class GameServerDeploymentsServiceClient { >; listGameServerDeployments( request: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, | protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse @@ -1516,7 +1524,7 @@ export class GameServerDeploymentsServiceClient { listGameServerDeployments( request: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, | protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsResponse @@ -1539,12 +1547,12 @@ export class GameServerDeploymentsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1597,7 +1605,7 @@ export class GameServerDeploymentsServiceClient { */ listGameServerDeploymentsStream( request?: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1658,7 +1666,7 @@ export class GameServerDeploymentsServiceClient { */ listGameServerDeploymentsAsync( request?: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index 4f744d417d5..467cc809323 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -31,6 +32,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * 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'; import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; @@ -86,9 +92,9 @@ export class RealmsServiceClient { * 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. - * TODO(@alexander-fenster): link to gax documentation. - * @param {boolean} fallback - Use HTTP fallback mode. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. * In fallback mode, a special browser-compatible transport implementation is used * instead of gRPC transport. In browser context (if the `window` object is defined) * the fallback mode is enabled automatically; set `options.fallback` to `false` @@ -101,7 +107,9 @@ export class RealmsServiceClient { opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; const port = opts?.port || staticMembers.port; const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? typeof window !== 'undefined'; + 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. @@ -380,7 +388,7 @@ export class RealmsServiceClient { // ------------------- getRealm( request: protos.google.cloud.gaming.v1beta.IGetRealmRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1beta.IRealm, @@ -390,7 +398,7 @@ export class RealmsServiceClient { >; getRealm( request: protos.google.cloud.gaming.v1beta.IGetRealmRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.gaming.v1beta.IRealm, protos.google.cloud.gaming.v1beta.IGetRealmRequest | null | undefined, @@ -426,7 +434,7 @@ export class RealmsServiceClient { getRealm( request: protos.google.cloud.gaming.v1beta.IGetRealmRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.gaming.v1beta.IRealm, protos.google.cloud.gaming.v1beta.IGetRealmRequest | null | undefined, @@ -445,12 +453,12 @@ export class RealmsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -465,7 +473,7 @@ export class RealmsServiceClient { } previewRealmUpdate( request: protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, @@ -475,7 +483,7 @@ export class RealmsServiceClient { >; previewRealmUpdate( request: protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, | protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest @@ -524,7 +532,7 @@ export class RealmsServiceClient { previewRealmUpdate( request: protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateResponse, | protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest @@ -547,12 +555,12 @@ export class RealmsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -568,7 +576,7 @@ export class RealmsServiceClient { createRealm( request: protos.google.cloud.gaming.v1beta.ICreateRealmRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -581,7 +589,7 @@ export class RealmsServiceClient { >; createRealm( request: protos.google.cloud.gaming.v1beta.ICreateRealmRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.gaming.v1beta.IRealm, @@ -630,7 +638,7 @@ export class RealmsServiceClient { createRealm( request: protos.google.cloud.gaming.v1beta.ICreateRealmRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.gaming.v1beta.IRealm, @@ -658,12 +666,12 @@ export class RealmsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -715,7 +723,7 @@ export class RealmsServiceClient { } deleteRealm( request: protos.google.cloud.gaming.v1beta.IDeleteRealmRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -728,7 +736,7 @@ export class RealmsServiceClient { >; deleteRealm( request: protos.google.cloud.gaming.v1beta.IDeleteRealmRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.protobuf.IEmpty, @@ -773,7 +781,7 @@ export class RealmsServiceClient { deleteRealm( request: protos.google.cloud.gaming.v1beta.IDeleteRealmRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.protobuf.IEmpty, @@ -801,12 +809,12 @@ export class RealmsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -858,7 +866,7 @@ export class RealmsServiceClient { } updateRealm( request: protos.google.cloud.gaming.v1beta.IUpdateRealmRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -871,7 +879,7 @@ export class RealmsServiceClient { >; updateRealm( request: protos.google.cloud.gaming.v1beta.IUpdateRealmRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.gaming.v1beta.IRealm, @@ -923,7 +931,7 @@ export class RealmsServiceClient { updateRealm( request: protos.google.cloud.gaming.v1beta.IUpdateRealmRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.gaming.v1beta.IRealm, @@ -951,12 +959,12 @@ export class RealmsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1008,7 +1016,7 @@ export class RealmsServiceClient { } listRealms( request: protos.google.cloud.gaming.v1beta.IListRealmsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1beta.IRealm[], @@ -1018,7 +1026,7 @@ export class RealmsServiceClient { >; listRealms( request: protos.google.cloud.gaming.v1beta.IListRealmsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.gaming.v1beta.IListRealmsRequest, protos.google.cloud.gaming.v1beta.IListRealmsResponse | null | undefined, @@ -1071,7 +1079,7 @@ export class RealmsServiceClient { listRealms( request: protos.google.cloud.gaming.v1beta.IListRealmsRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.gaming.v1beta.IListRealmsRequest, | protos.google.cloud.gaming.v1beta.IListRealmsResponse @@ -1092,12 +1100,12 @@ export class RealmsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1146,7 +1154,7 @@ export class RealmsServiceClient { */ listRealmsStream( request?: protos.google.cloud.gaming.v1beta.IListRealmsRequest, - options?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; @@ -1207,7 +1215,7 @@ export class RealmsServiceClient { */ listRealmsAsync( request?: protos.google.cloud.gaming.v1beta.IListRealmsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 5b3f78be425..64c6f2c23bb 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "ee22980eb2c0af179d4e3cee35d13b99f9af2c32" + "sha": "2329129d18747e90074682649e86229ee43bce33" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "4c5071b615d96ef9dfd6a63d8429090f1f2872bb", - "internalRef": "327369997" + "sha": "5587028631d4d743fd906c4eb4e4e4649a7ee5ce", + "internalRef": "343187793" } }, { @@ -96,7 +96,6 @@ "README.md", "api-extractor.json", "linkinator.config.json", - "package-lock.json.742240568", "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", @@ -111,7 +110,6 @@ "protos/protos.json", "renovate.json", "samples/README.md", - "samples/package-lock.json.3225038820", "src/index.ts", "src/v1beta/game_server_clusters_service_client.ts", "src/v1beta/game_server_clusters_service_client_config.json", From b1ad4fffa0805f430ca417ad13fcd8c10aaaf304 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 25 Nov 2020 08:34:22 -0800 Subject: [PATCH 080/180] docs: spelling correction for "targetting" (#138) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/4ae6b577-4a5f-4ba7-885b-7384aaed05b5/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/15013eff642a7e7e855aed5a29e6e83c39beba2a --- packages/google-cloud-gaming/README.md | 2 +- packages/google-cloud-gaming/synth.metadata | 95 +-------------------- 2 files changed, 3 insertions(+), 94 deletions(-) diff --git a/packages/google-cloud-gaming/README.md b/packages/google-cloud-gaming/README.md index 13ee7de5773..cc42bab906e 100644 --- a/packages/google-cloud-gaming/README.md +++ b/packages/google-cloud-gaming/README.md @@ -136,7 +136,7 @@ Our client libraries follow the [Node.js release schedule](https://nodejs.org/en Libraries are compatible with all current _active_ and _maintenance_ versions of Node.js. -Client libraries targetting some end-of-life versions of Node.js are available, and +Client libraries targeting some end-of-life versions of Node.js are available, and can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). The dist-tags follow the naming convention `legacy-(version)`. diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 64c6f2c23bb..3167cec673a 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "2329129d18747e90074682649e86229ee43bce33" + "sha": "3c28ff7c610caf58df0dfbd4b3acd2954ae7f019" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "1f1148d3c7a7a52f0c98077f976bd9b3c948ee2b" + "sha": "15013eff642a7e7e855aed5a29e6e83c39beba2a" } } ], @@ -42,96 +42,5 @@ "generator": "bazel" } } - ], - "generatedFiles": [ - ".eslintignore", - ".eslintrc.json", - ".gitattributes", - ".github/ISSUE_TEMPLATE/bug_report.md", - ".github/ISSUE_TEMPLATE/feature_request.md", - ".github/ISSUE_TEMPLATE/support_request.md", - ".github/PULL_REQUEST_TEMPLATE.md", - ".github/release-please.yml", - ".github/workflows/ci.yaml", - ".gitignore", - ".jsdoc.js", - ".kokoro/.gitattributes", - ".kokoro/common.cfg", - ".kokoro/continuous/node10/common.cfg", - ".kokoro/continuous/node10/docs.cfg", - ".kokoro/continuous/node10/test.cfg", - ".kokoro/continuous/node12/common.cfg", - ".kokoro/continuous/node12/lint.cfg", - ".kokoro/continuous/node12/samples-test.cfg", - ".kokoro/continuous/node12/system-test.cfg", - ".kokoro/continuous/node12/test.cfg", - ".kokoro/docs.sh", - ".kokoro/lint.sh", - ".kokoro/populate-secrets.sh", - ".kokoro/presubmit/node10/common.cfg", - ".kokoro/presubmit/node12/common.cfg", - ".kokoro/presubmit/node12/samples-test.cfg", - ".kokoro/presubmit/node12/system-test.cfg", - ".kokoro/presubmit/node12/test.cfg", - ".kokoro/publish.sh", - ".kokoro/release/docs-devsite.cfg", - ".kokoro/release/docs-devsite.sh", - ".kokoro/release/docs.cfg", - ".kokoro/release/docs.sh", - ".kokoro/release/publish.cfg", - ".kokoro/samples-test.sh", - ".kokoro/system-test.sh", - ".kokoro/test.bat", - ".kokoro/test.sh", - ".kokoro/trampoline.sh", - ".kokoro/trampoline_v2.sh", - ".mocharc.js", - ".nycrc", - ".prettierignore", - ".prettierrc.js", - ".trampolinerc", - "CODE_OF_CONDUCT.md", - "CONTRIBUTING.md", - "LICENSE", - "README.md", - "api-extractor.json", - "linkinator.config.json", - "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", - "protos/protos.d.ts", - "protos/protos.js", - "protos/protos.json", - "renovate.json", - "samples/README.md", - "src/index.ts", - "src/v1beta/game_server_clusters_service_client.ts", - "src/v1beta/game_server_clusters_service_client_config.json", - "src/v1beta/game_server_clusters_service_proto_list.json", - "src/v1beta/game_server_configs_service_client.ts", - "src/v1beta/game_server_configs_service_client_config.json", - "src/v1beta/game_server_configs_service_proto_list.json", - "src/v1beta/game_server_deployments_service_client.ts", - "src/v1beta/game_server_deployments_service_client_config.json", - "src/v1beta/game_server_deployments_service_proto_list.json", - "src/v1beta/index.ts", - "src/v1beta/realms_service_client.ts", - "src/v1beta/realms_service_client_config.json", - "src/v1beta/realms_service_proto_list.json", - "system-test/fixtures/sample/src/index.js", - "system-test/fixtures/sample/src/index.ts", - "system-test/install.ts", - "test/gapic_game_server_clusters_service_v1beta.ts", - "test/gapic_game_server_configs_service_v1beta.ts", - "test/gapic_game_server_deployments_service_v1beta.ts", - "test/gapic_realms_service_v1beta.ts", - "tsconfig.json", - "webpack.config.js" ] } \ No newline at end of file From 824e6c569065af4a53fe71ea3da4fdcbc40439aa Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 2 Dec 2020 19:40:31 +0000 Subject: [PATCH 081/180] chore: release 2.1.2 (#137) :robot: I have created a release \*beep\* \*boop\* --- ### [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)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). --- packages/google-cloud-gaming/CHANGELOG.md | 7 +++++++ packages/google-cloud-gaming/package.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index df6bd31a166..1a1ee1b60b1 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index e66a9ca29d3..abbfc41f7e0 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "2.1.1", + "version": "2.1.2", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index 0fa8ddcac82..c90597a47a5 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^2.1.1" + "@google-cloud/game-servers": "^2.1.2" }, "devDependencies": { "c8": "^7.2.1", From a2d9451626242c508ccebd57af70b2ba16baa64c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 4 Dec 2020 08:56:16 -0800 Subject: [PATCH 082/180] chore: generate GAPIC metadata JSON file (#139) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/4e7abbc6-c648-4473-9499-aa96f63c63a8/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 345596855 Source-Link: https://github.com/googleapis/googleapis/commit/d189e871205fea665a9648f7c4676f027495ccaf --- .../src/v1beta/gapic_metadata.json | 351 ++++++++++++++++++ packages/google-cloud-gaming/synth.metadata | 6 +- 2 files changed, 354 insertions(+), 3 deletions(-) create mode 100644 packages/google-cloud-gaming/src/v1beta/gapic_metadata.json 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/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 3167cec673a..e2a5cb55d3d 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "3c28ff7c610caf58df0dfbd4b3acd2954ae7f019" + "sha": "70b7129e83d24dd25d34d1510809cb578982d442" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5587028631d4d743fd906c4eb4e4e4649a7ee5ce", - "internalRef": "343187793" + "sha": "d189e871205fea665a9648f7c4676f027495ccaf", + "internalRef": "345596855" } }, { From defb719f8a26ebc4673738ed66d8de59e8fa2c7d Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 22 Dec 2020 11:44:11 -0800 Subject: [PATCH 083/180] docs: add instructions for authenticating for system tests (#140) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/910b6b4c-44a8-42e1-939c-9018f9008df4/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/363fe305e9ce34a6cd53951c6ee5f997094b54ee --- packages/google-cloud-gaming/CONTRIBUTING.md | 15 +++++++++++++-- packages/google-cloud-gaming/README.md | 3 +-- packages/google-cloud-gaming/synth.metadata | 4 ++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-gaming/CONTRIBUTING.md b/packages/google-cloud-gaming/CONTRIBUTING.md index f6c4cf010e3..fd7794bb0d7 100644 --- a/packages/google-cloud-gaming/CONTRIBUTING.md +++ b/packages/google-cloud-gaming/CONTRIBUTING.md @@ -37,6 +37,15 @@ accept your pull requests. 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]. @@ -51,11 +60,9 @@ accept your pull requests. npm test # Run sample integration tests. - gcloud auth application-default login npm run samples-test # Run all system tests. - gcloud auth application-default login npm run system-test 1. Lint (and maybe fix) any changes: @@ -63,3 +70,7 @@ accept your pull requests. 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/README.md b/packages/google-cloud-gaming/README.md index cc42bab906e..40f0a59e151 100644 --- a/packages/google-cloud-gaming/README.md +++ b/packages/google-cloud-gaming/README.md @@ -97,8 +97,7 @@ quickstart(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-game-servers/tree/master/samples) directory. The samples' `README.md` -has instructions for running the samples. +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-game-servers/tree/master/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index e2a5cb55d3d..8f8b03ce064 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "70b7129e83d24dd25d34d1510809cb578982d442" + "sha": "6b609ba3cdde80d36544114719ab2cd53d3fbe96" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "15013eff642a7e7e855aed5a29e6e83c39beba2a" + "sha": "363fe305e9ce34a6cd53951c6ee5f997094b54ee" } } ], From 9c3b1b6a922588fcf38c028f514e6d3ff863882a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 7 Jan 2021 11:42:03 -0800 Subject: [PATCH 084/180] docs: update dates (#141) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/29069528-f186-4ec9-92b5-d225fd8530ec/targets - [ ] To automatically regenerate this PR, check this box. --- packages/google-cloud-gaming/.jsdoc.js | 4 ++-- packages/google-cloud-gaming/protos/protos.d.ts | 2 +- packages/google-cloud-gaming/protos/protos.js | 2 +- .../src/v1beta/game_server_clusters_service_client.ts | 2 +- .../src/v1beta/game_server_configs_service_client.ts | 2 +- .../src/v1beta/game_server_deployments_service_client.ts | 2 +- packages/google-cloud-gaming/src/v1beta/index.ts | 2 +- .../google-cloud-gaming/src/v1beta/realms_service_client.ts | 2 +- packages/google-cloud-gaming/synth.metadata | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- packages/google-cloud-gaming/system-test/install.ts | 2 +- .../test/gapic_game_server_clusters_service_v1beta.ts | 2 +- .../test/gapic_game_server_configs_service_v1beta.ts | 2 +- .../test/gapic_game_server_deployments_service_v1beta.ts | 2 +- .../google-cloud-gaming/test/gapic_realms_service_v1beta.ts | 2 +- 16 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/google-cloud-gaming/.jsdoc.js b/packages/google-cloud-gaming/.jsdoc.js index 3054ecec4a7..afa8bc52af2 100644 --- a/packages/google-cloud-gaming/.jsdoc.js +++ b/packages/google-cloud-gaming/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2020 Google LLC', + copyright: 'Copyright 2021 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/game-servers', diff --git a/packages/google-cloud-gaming/protos/protos.d.ts b/packages/google-cloud-gaming/protos/protos.d.ts index f81f1659422..16242466340 100644 --- a/packages/google-cloud-gaming/protos/protos.d.ts +++ b/packages/google-cloud-gaming/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-gaming/protos/protos.js b/packages/google-cloud-gaming/protos/protos.js index 4e649b100f2..c1f3f39590c 100644 --- a/packages/google-cloud-gaming/protos/protos.js +++ b/packages/google-cloud-gaming/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. 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 index 552482b43c6..ca90f2d5d6a 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. 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 index f92ff6e52fd..6a85f456b25 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. 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 index 595304c0b82..5d203ffe3b1 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-gaming/src/v1beta/index.ts b/packages/google-cloud-gaming/src/v1beta/index.ts index 861b577d05e..497ac69df5c 100644 --- a/packages/google-cloud-gaming/src/v1beta/index.ts +++ b/packages/google-cloud-gaming/src/v1beta/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index 467cc809323..6a3349018ca 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 8f8b03ce064..76684d60c80 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "6b609ba3cdde80d36544114719ab2cd53d3fbe96" + "sha": "c567cb0cd044f08d96c25352f1ccca6d9c3bbffe" } }, { 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 index 395eb46082f..76514a01271 100644 --- a/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. 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 index b4ef745f138..2ffd46371fd 100644 --- a/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-gaming/system-test/install.ts b/packages/google-cloud-gaming/system-test/install.ts index 39d90f771de..d2d61c0396f 100644 --- a/packages/google-cloud-gaming/system-test/install.ts +++ b/packages/google-cloud-gaming/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. 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 index 7fea1857878..abece03a561 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. 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 index ff53460b0ed..9c2260d8a62 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. 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 index 9f34191931d..ed7d6f3550b 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts index ca9daa24232..211bf480b9f 100644 --- a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. From a4e9998a87b1773f548123f16aab9be936a74c6f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Fri, 8 Jan 2021 18:40:26 -0800 Subject: [PATCH 085/180] feat: adds style enumeration (#142) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/6097b27f-11d0-4351-8f36-1ff5504fc384/targets - [ ] To automatically regenerate this PR, check this box. --- .../google-cloud-gaming/protos/protos.d.ts | 12 +++ packages/google-cloud-gaming/protos/protos.js | 78 ++++++++++++++++++- .../google-cloud-gaming/protos/protos.json | 13 +++- packages/google-cloud-gaming/synth.metadata | 2 +- 4 files changed, 102 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-gaming/protos/protos.d.ts b/packages/google-cloud-gaming/protos/protos.d.ts index 16242466340..9be4fc61cd3 100644 --- a/packages/google-cloud-gaming/protos/protos.d.ts +++ b/packages/google-cloud-gaming/protos/protos.d.ts @@ -14533,6 +14533,9 @@ export namespace google { /** ResourceDescriptor singular */ singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); } /** Represents a ResourceDescriptor. */ @@ -14562,6 +14565,9 @@ export namespace google { /** 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 @@ -14641,6 +14647,12 @@ export namespace google { ORIGINALLY_SINGLE_PATTERN = 1, FUTURE_MULTI_PATTERN = 2 } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } } /** Properties of a ResourceReference. */ diff --git a/packages/google-cloud-gaming/protos/protos.js b/packages/google-cloud-gaming/protos/protos.js index c1f3f39590c..ac68035da30 100644 --- a/packages/google-cloud-gaming/protos/protos.js +++ b/packages/google-cloud-gaming/protos/protos.js @@ -33988,6 +33988,7 @@ * @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 */ /** @@ -34000,6 +34001,7 @@ */ 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) @@ -34054,6 +34056,14 @@ */ 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 @@ -34091,6 +34101,12 @@ 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; }; @@ -34145,6 +34161,16 @@ 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; @@ -34208,6 +34234,18 @@ 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; }; @@ -34252,6 +34290,23 @@ 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: + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } + } return message; }; @@ -34268,8 +34323,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.pattern = []; + object.style = []; + } if (options.defaults) { object.type = ""; object.nameField = ""; @@ -34292,6 +34349,11 @@ 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]] : message.style[j]; + } return object; }; @@ -34322,6 +34384,20 @@ 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; })(); diff --git a/packages/google-cloud-gaming/protos/protos.json b/packages/google-cloud-gaming/protos/protos.json index 5c0baf5c1f3..b568c6e75f0 100644 --- a/packages/google-cloud-gaming/protos/protos.json +++ b/packages/google-cloud-gaming/protos/protos.json @@ -4095,6 +4095,11 @@ "singular": { "type": "string", "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 } }, "nested": { @@ -4104,6 +4109,12 @@ "ORIGINALLY_SINGLE_PATTERN": 1, "FUTURE_MULTI_PATTERN": 2 } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } } } }, @@ -4139,7 +4150,7 @@ }, "protobuf": { "options": { - "go_package": "github.com/golang/protobuf/protoc-gen-go/descriptor;descriptor", + "go_package": "google.golang.org/protobuf/types/descriptorpb", "java_package": "com.google.protobuf", "java_outer_classname": "DescriptorProtos", "csharp_namespace": "Google.Protobuf.Reflection", diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 76684d60c80..6f2a9979fd2 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "c567cb0cd044f08d96c25352f1ccca6d9c3bbffe" + "sha": "0127714e3f3c2956d6a009cd6720d28eeb8f04f6" } }, { From 87e875e2817eb920991bc5764802c82d72829dca Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 12 Jan 2021 18:36:19 +0000 Subject: [PATCH 086/180] chore: release 2.2.0 (#143) :robot: I have created a release \*beep\* \*boop\* --- ## [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)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-gaming/CHANGELOG.md | 7 +++++++ packages/google-cloud-gaming/package.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index 1a1ee1b60b1..0a8274b93f7 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index abbfc41f7e0..00dcfbbe221 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "2.1.2", + "version": "2.2.0", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index c90597a47a5..e898dd45b9e 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^2.1.2" + "@google-cloud/game-servers": "^2.2.0" }, "devDependencies": { "c8": "^7.2.1", From fe5499beb9a7b98935d7512975b03ce6b2b754aa Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 27 Jan 2021 08:40:22 -0800 Subject: [PATCH 087/180] refactor(nodejs): move build cop to flakybot (#145) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/79c017af-4fff-4b22-8cb4-5c2208642be6/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: https://github.com/googleapis/synthtool/commit/57c23fa5705499a4181095ced81f0ee0933b64f6 --- packages/google-cloud-gaming/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 6f2a9979fd2..9a24fea1f52 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "0127714e3f3c2956d6a009cd6720d28eeb8f04f6" + "sha": "45ba5217ca5a575397a250c1d22b02e5d7f927ec" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "363fe305e9ce34a6cd53951c6ee5f997094b54ee" + "sha": "57c23fa5705499a4181095ced81f0ee0933b64f6" } } ], From 97319143c34a07bb2fee04bb45e669c3d009d51f Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 3 Feb 2021 17:56:10 -0800 Subject: [PATCH 088/180] build: adds UNORDERED_LIST enum (#146) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/2ae671ee-21a8-4bed-96cc-bdcf6b4638b5/targets - [ ] To automatically regenerate this PR, check this box. --- packages/google-cloud-gaming/protos/protos.d.ts | 3 ++- packages/google-cloud-gaming/protos/protos.js | 7 +++++++ packages/google-cloud-gaming/protos/protos.json | 3 ++- packages/google-cloud-gaming/synth.metadata | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-gaming/protos/protos.d.ts b/packages/google-cloud-gaming/protos/protos.d.ts index 9be4fc61cd3..a9f208a9735 100644 --- a/packages/google-cloud-gaming/protos/protos.d.ts +++ b/packages/google-cloud-gaming/protos/protos.d.ts @@ -14171,7 +14171,8 @@ export namespace google { REQUIRED = 2, OUTPUT_ONLY = 3, INPUT_ONLY = 4, - IMMUTABLE = 5 + IMMUTABLE = 5, + UNORDERED_LIST = 6 } /** Properties of a Http. */ diff --git a/packages/google-cloud-gaming/protos/protos.js b/packages/google-cloud-gaming/protos/protos.js index ac68035da30..d662fda4574 100644 --- a/packages/google-cloud-gaming/protos/protos.js +++ b/packages/google-cloud-gaming/protos/protos.js @@ -33060,6 +33060,7 @@ * @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 */ api.FieldBehavior = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -33069,6 +33070,7 @@ values[valuesById[3] = "OUTPUT_ONLY"] = 3; values[valuesById[4] = "INPUT_ONLY"] = 4; values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; return values; })(); @@ -40140,6 +40142,7 @@ case 3: case 4: case 5: + case 6: break; } } @@ -40240,6 +40243,10 @@ case 5: message[".google.api.fieldBehavior"][i] = 5; break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; } } if (object[".google.api.resourceReference"] != null) { diff --git a/packages/google-cloud-gaming/protos/protos.json b/packages/google-cloud-gaming/protos/protos.json index b568c6e75f0..4a866ad2683 100644 --- a/packages/google-cloud-gaming/protos/protos.json +++ b/packages/google-cloud-gaming/protos/protos.json @@ -3963,7 +3963,8 @@ "REQUIRED": 2, "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, - "IMMUTABLE": 5 + "IMMUTABLE": 5, + "UNORDERED_LIST": 6 } }, "http": { diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 9a24fea1f52..3d2170a6cf2 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "45ba5217ca5a575397a250c1d22b02e5d7f927ec" + "sha": "e3bbbb4158b4539881d444d76b9810b331800cb3" } }, { From 94a791de13a2f023cefb6f11f085b0cacc70097f Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 1 Mar 2021 11:47:27 -0800 Subject: [PATCH 089/180] feat(docs): update release level to ga (#147) --- packages/google-cloud-gaming/.repo-metadata.json | 2 +- packages/google-cloud-gaming/README.md | 11 ++++++----- packages/google-cloud-gaming/synth.metadata | 15 ++++----------- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/packages/google-cloud-gaming/.repo-metadata.json b/packages/google-cloud-gaming/.repo-metadata.json index 61f4574e9bd..a8b9dd524b9 100644 --- a/packages/google-cloud-gaming/.repo-metadata.json +++ b/packages/google-cloud-gaming/.repo-metadata.json @@ -4,7 +4,7 @@ "product_documentation": "https://cloud.google.com/game-servers/", "client_documentation": "https://googleapis.dev/nodejs/game-servers/latest", "issue_tracker": "", - "release_level": "beta", + "release_level": "ga", "language": "nodejs", "repo": "googleapis/nodejs-game-servers", "distribution_name": "@google-cloud/game-servers", diff --git a/packages/google-cloud-gaming/README.md b/packages/google-cloud-gaming/README.md index 40f0a59e151..2a069b91d5f 100644 --- a/packages/google-cloud-gaming/README.md +++ b/packages/google-cloud-gaming/README.md @@ -4,7 +4,7 @@ # [Google Cloud Game Servers: Node.js Client](https://github.com/googleapis/nodejs-game-servers) -[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-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) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-game-servers/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-game-servers) @@ -155,11 +155,12 @@ _Legacy Node.js versions are supported as a best effort:_ This library follows [Semantic Versioning](http://semver.org/). +This library is considered to be **General Availability (GA)**. This means it +is 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 **GA** libraries +are addressed with the highest priority. -This library is considered to be in **beta**. This means it is expected to be -mostly stable while we work toward a general availability release; however, -complete stability is not guaranteed. We will address issues and requests -against beta libraries with a high priority. diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 3d2170a6cf2..a8096e7e03f 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -3,23 +3,16 @@ { "git": { "name": ".", - "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "e3bbbb4158b4539881d444d76b9810b331800cb3" + "remote": "git@github.com:googleapis/nodejs-game-servers.git", + "sha": "4bc1ac92ccf31b5f4d52541aaa2e1bd95ce51904" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "d189e871205fea665a9648f7c4676f027495ccaf", - "internalRef": "345596855" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "57c23fa5705499a4181095ced81f0ee0933b64f6" + "sha": "6c023d9fd5e918934ceef500d1574dac410743a9", + "internalRef": "360224166" } } ], From 628cf698a950f4b3c7fd48ba80f7003da2f60970 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 1 Mar 2021 16:22:19 -0800 Subject: [PATCH 090/180] chore: release 2.3.0 (#148) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-gaming/CHANGELOG.md | 7 +++++++ packages/google-cloud-gaming/package.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index 0a8274b93f7..6c2ac39e3cd 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 00dcfbbe221..6bbfd886cb6 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "2.2.0", + "version": "2.3.0", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index e898dd45b9e..39fa4d80239 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^2.2.0" + "@google-cloud/game-servers": "^2.3.0" }, "devDependencies": { "c8": "^7.2.1", From 973e73b86ab00ae463a632e0cc3bcc8f6c216bfb Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Sun, 7 Mar 2021 09:00:21 -0800 Subject: [PATCH 091/180] build: update gapic-generator-typescript to v1.2.10. (#149) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/7d84eafd-4925-434f-9ffd-6407671972cb/targets - [ ] To automatically regenerate this PR, check this box. PiperOrigin-RevId: 361273630 Source-Link: https://github.com/googleapis/googleapis/commit/5477122b3e8037a1dc5bc920536158edbd151dc4 --- packages/google-cloud-gaming/synth.metadata | 15 +++++++++++---- packages/google-cloud-gaming/webpack.config.js | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index a8096e7e03f..b4a14e85c3e 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -3,16 +3,23 @@ { "git": { "name": ".", - "remote": "git@github.com:googleapis/nodejs-game-servers.git", - "sha": "4bc1ac92ccf31b5f4d52541aaa2e1bd95ce51904" + "remote": "https://github.com/googleapis/nodejs-game-servers.git", + "sha": "e8ad595a6e6f81e4250be223668a4bfa9fdfde7a" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "6c023d9fd5e918934ceef500d1574dac410743a9", - "internalRef": "360224166" + "sha": "5477122b3e8037a1dc5bc920536158edbd151dc4", + "internalRef": "361273630" + } + }, + { + "git": { + "name": "synthtool", + "remote": "https://github.com/googleapis/synthtool.git", + "sha": "9583f62749edab8e1a5ccd613fe59cf553c189a1" } } ], diff --git a/packages/google-cloud-gaming/webpack.config.js b/packages/google-cloud-gaming/webpack.config.js index 285a58ef135..3b4f5f16d8c 100644 --- a/packages/google-cloud-gaming/webpack.config.js +++ b/packages/google-cloud-gaming/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. From 455c3af1974a7f517e87b9a18544a5c073364ff0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 23 Mar 2021 17:48:32 +0100 Subject: [PATCH 092/180] chore(deps): update dependency sinon to v10 (#151) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^9.0.1` -> `^10.0.0`](https://renovatebot.com/diffs/npm/sinon/9.2.4/10.0.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/compatibility-slim/9.2.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/10.0.0/confidence-slim/9.2.4)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v10.0.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1000--2021-03-22) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v9.2.4...v10.0.0) ================== - Upgrade nise to 4.1.0 - Use [@​sinonjs/eslint-config](https://togithub.com/sinonjs/eslint-config)[@​4](https://togithub.com/4) => Adopts ES2017 => Drops support for IE 11, Legacy Edge and legacy Safari
--- ### Renovate configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 6bbfd886cb6..82fd56d5f2e 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -44,7 +44,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^9.0.1", + "sinon": "^10.0.0", "ts-loader": "^8.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", From 2b4a82fa417379a6c765214aba3ba10ad0913ea0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 14 Apr 2021 23:08:33 +0200 Subject: [PATCH 093/180] chore(deps): update dependency @types/sinon to v10 (#154) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/sinon](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^9.0.0` -> `^10.0.0`](https://renovatebot.com/diffs/npm/@types%2fsinon/9.0.11/10.0.0) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/compatibility-slim/9.0.11)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fsinon/10.0.0/confidence-slim/9.0.11)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 82fd56d5f2e..6e2767d9956 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -34,7 +34,7 @@ "devDependencies": { "@types/mocha": "^8.0.0", "@types/node": "^12.0.0", - "@types/sinon": "^9.0.0", + "@types/sinon": "^10.0.0", "c8": "^7.0.0", "gts": "^2.0.0", "jsdoc": "^3.5.5", From b93766cb07d5a8530a254dd48bb36f490160d184 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 19 Apr 2021 13:07:38 -0700 Subject: [PATCH 094/180] chore: migrate gaming/{v1, v1beta} to the PHP microgenerator (#155) Committer: @miraleung PiperOrigin-RevId: 368737560 Source-Author: Google APIs Source-Date: Thu Apr 15 16:10:57 2021 -0700 Source-Repo: googleapis/googleapis Source-Sha: 001f72d55eba0da1f651dc252084eb7522fbe19d Source-Link: https://github.com/googleapis/googleapis/commit/001f72d55eba0da1f651dc252084eb7522fbe19d --- .../gaming/v1beta/game_server_clusters.proto | 47 +++++++++------ .../v1beta/game_server_clusters_service.proto | 31 ++++++---- .../gaming/v1beta/game_server_configs.proto | 17 ++++-- .../v1beta/game_server_configs_service.proto | 16 ++++-- .../v1beta/game_server_deployments.proto | 57 ++++++++++++------- .../game_server_deployments_service.proto | 33 +++++++---- .../google/cloud/gaming/v1beta/realms.proto | 24 +++++--- .../cloud/gaming/v1beta/realms_service.proto | 7 ++- .../google-cloud-gaming/protos/protos.json | 3 +- .../game_server_clusters_service_client.ts | 39 +++++++------ .../game_server_configs_service_client.ts | 21 ++++--- .../game_server_deployments_service_client.ts | 40 ++++++------- .../src/v1beta/realms_service_client.ts | 12 ++-- packages/google-cloud-gaming/synth.metadata | 6 +- 14 files changed, 217 insertions(+), 136 deletions(-) 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 index 357ef36ebaa..6816f2cc206 100644 --- 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 @@ -27,6 +27,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;g 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 { @@ -39,14 +40,15 @@ message ListGameServerClustersRequest { } ]; - // 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. + // 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. + // 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. @@ -98,7 +100,8 @@ message CreateGameServerClusterRequest { 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]; + GameServerCluster game_server_cluster = 3 + [(google.api.field_behavior) = REQUIRED]; } // Request message for GameServerClustersService.PreviewCreateGameServerCluster. @@ -116,10 +119,12 @@ message PreviewCreateGameServerClusterRequest { 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]; + 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]; + google.protobuf.Timestamp preview_time = 4 + [(google.api.field_behavior) = OPTIONAL]; } // Response message for @@ -156,7 +161,8 @@ message PreviewDeleteGameServerClusterRequest { ]; // Optional. The target timestamp to compute the preview. - google.protobuf.Timestamp preview_time = 2 [(google.api.field_behavior) = OPTIONAL]; + google.protobuf.Timestamp preview_time = 2 + [(google.api.field_behavior) = OPTIONAL]; } // Response message for @@ -173,7 +179,8 @@ message PreviewDeleteGameServerClusterResponse { 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]; + 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 @@ -181,14 +188,16 @@ message UpdateGameServerClusterRequest { // https: // //developers.google.com/protocol-buffers // // /docs/reference/google.protobuf#fieldmask - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + 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]; + 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 @@ -196,10 +205,12 @@ message PreviewUpdateGameServerClusterRequest { // https: // //developers.google.com/protocol-buffers // // /docs/reference/google.protobuf#fieldmask - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + 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]; + google.protobuf.Timestamp preview_time = 3 + [(google.api.field_behavior) = OPTIONAL]; } // Response message for GameServerClustersService.PreviewUpdateGameServerCluster @@ -254,10 +265,12 @@ message GameServerCluster { 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]; + 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]; + 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. 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 index 935d365f576..18b374b694d 100644 --- 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 @@ -25,15 +25,18 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;g 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"; + 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) { + rpc ListGameServerClusters(ListGameServerClustersRequest) + returns (ListGameServerClustersResponse) { option (google.api.http) = { get: "/v1beta/{parent=projects/*/locations/*/realms/*}/gameServerClusters" }; @@ -41,7 +44,8 @@ service GameServerClustersService { } // Gets details of a single game server cluster. - rpc GetGameServerCluster(GetGameServerClusterRequest) returns (GameServerCluster) { + rpc GetGameServerCluster(GetGameServerClusterRequest) + returns (GameServerCluster) { option (google.api.http) = { get: "/v1beta/{name=projects/*/locations/*/realms/*/gameServerClusters/*}" }; @@ -49,12 +53,14 @@ service GameServerClustersService { } // Creates a new game server cluster in a given project and location. - rpc CreateGameServerCluster(CreateGameServerClusterRequest) returns (google.longrunning.Operation) { + 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.api.method_signature) = + "parent,game_server_cluster,game_server_cluster_id"; option (google.longrunning.operation_info) = { response_type: "GameServerCluster" metadata_type: "OperationMetadata" @@ -63,7 +69,8 @@ service GameServerClustersService { // Previews creation of a new game server cluster in a given project and // location. - rpc PreviewCreateGameServerCluster(PreviewCreateGameServerClusterRequest) returns (PreviewCreateGameServerClusterResponse) { + rpc PreviewCreateGameServerCluster(PreviewCreateGameServerClusterRequest) + returns (PreviewCreateGameServerClusterResponse) { option (google.api.http) = { post: "/v1beta/{parent=projects/*/locations/*/realms/*}/gameServerClusters:previewCreate" body: "game_server_cluster" @@ -71,7 +78,8 @@ service GameServerClustersService { } // Deletes a single game server cluster. - rpc DeleteGameServerCluster(DeleteGameServerClusterRequest) returns (google.longrunning.Operation) { + rpc DeleteGameServerCluster(DeleteGameServerClusterRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1beta/{name=projects/*/locations/*/realms/*/gameServerClusters/*}" }; @@ -83,14 +91,16 @@ service GameServerClustersService { } // Previews deletion of a single game server cluster. - rpc PreviewDeleteGameServerCluster(PreviewDeleteGameServerClusterRequest) returns (PreviewDeleteGameServerClusterResponse) { + 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) { + 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" @@ -103,7 +113,8 @@ service GameServerClustersService { } // Previews updating a GameServerCluster. - rpc PreviewUpdateGameServerCluster(PreviewUpdateGameServerClusterRequest) returns (PreviewUpdateGameServerClusterResponse) { + 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 index 86c6ed293f0..a94b40b33cf 100644 --- 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 @@ -26,6 +26,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;g 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 { @@ -42,11 +43,12 @@ message ListGameServerConfigsRequest { // 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. + // [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. + // 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. @@ -99,7 +101,8 @@ message CreateGameServerConfigRequest { 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]; + GameServerConfig game_server_config = 3 + [(google.api.field_behavior) = REQUIRED]; } // Request message for GameServerConfigsService.DeleteGameServerConfig. @@ -159,10 +162,12 @@ message GameServerConfig { string name = 1; // Output only. The creation time. - google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + 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]; + 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. 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 index 60d2a910f4f..20a2c888eec 100644 --- 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 @@ -25,15 +25,18 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;g 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"; + 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) { + rpc ListGameServerConfigs(ListGameServerConfigsRequest) + returns (ListGameServerConfigsResponse) { option (google.api.http) = { get: "/v1beta/{parent=projects/*/locations/*/gameServerDeployments/*}/configs" }; @@ -41,7 +44,8 @@ service GameServerConfigsService { } // Gets details of a single game server config. - rpc GetGameServerConfig(GetGameServerConfigRequest) returns (GameServerConfig) { + rpc GetGameServerConfig(GetGameServerConfigRequest) + returns (GameServerConfig) { option (google.api.http) = { get: "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*/configs/*}" }; @@ -51,7 +55,8 @@ service GameServerConfigsService { // 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) { + rpc CreateGameServerConfig(CreateGameServerConfigRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta/{parent=projects/*/locations/*/gameServerDeployments/*}/configs" body: "game_server_config" @@ -65,7 +70,8 @@ service GameServerConfigsService { // 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) { + rpc DeleteGameServerConfig(DeleteGameServerConfigRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*/configs/*}" }; 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 index a9a31e3ad44..1dde396bfbf 100644 --- 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 @@ -27,6 +27,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;g 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 { @@ -39,11 +40,11 @@ message ListGameServerDeploymentsRequest { } ]; - // 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. + // 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, @@ -73,7 +74,8 @@ message ListGameServerDeploymentsResponse { // Request message for GameServerDeploymentsService.GetGameServerDeployment. message GetGameServerDeploymentRequest { - // Required. The name of the game server delpoyment to retrieve. Uses the form: + // Required. The name of the game server delpoyment to retrieve. Uses the + // form: // // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. string name = 1 [ @@ -87,7 +89,8 @@ message GetGameServerDeploymentRequest { // Request message for // GameServerDeploymentsService.GetGameServerDeploymentRollout. message GetGameServerDeploymentRolloutRequest { - // Required. The name of the game server delpoyment to retrieve. Uses the form: + // Required. The name of the game server delpoyment to retrieve. Uses the + // form: // // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. string name = 1 [ @@ -113,7 +116,8 @@ message CreateGameServerDeploymentRequest { 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]; + GameServerDeployment game_server_deployment = 3 + [(google.api.field_behavior) = REQUIRED]; } // Request message for GameServerDeploymentsService.DeleteGameServerDeployment. @@ -134,7 +138,8 @@ message DeleteGameServerDeploymentRequest { 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]; + 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 @@ -142,7 +147,8 @@ message UpdateGameServerDeploymentRequest { // https: // //developers.google.com/protocol-buffers // // /docs/reference/google.protobuf#fieldmask - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; } // Request message for @@ -150,7 +156,8 @@ message UpdateGameServerDeploymentRequest { 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]; + 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 @@ -158,7 +165,8 @@ message UpdateGameServerDeploymentRolloutRequest { // https: // //developers.google.com/protocol-buffers // // /docs/reference/google.protobuf#fieldmask - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; } // Request message for GameServerDeploymentsService.FetchDeploymentState. @@ -204,10 +212,12 @@ message GameServerDeployment { string name = 1; // Output only. The creation time. - google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + 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]; + 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. @@ -252,10 +262,12 @@ message GameServerDeploymentRollout { string name = 1; // Output only. The creation time. - google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + 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]; + 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, @@ -276,7 +288,8 @@ message GameServerDeploymentRollout { 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]; + 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 @@ -284,11 +297,13 @@ message PreviewGameServerDeploymentRolloutRequest { // https: // //developers.google.com/protocol-buffers // // /docs/reference/google.protobuf#fieldmask - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; + 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]; + // 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. 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 index c20fbb7fce4..0b3503f46ca 100644 --- 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 @@ -25,15 +25,18 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;g 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"; + 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) { + rpc ListGameServerDeployments(ListGameServerDeploymentsRequest) + returns (ListGameServerDeploymentsResponse) { option (google.api.http) = { get: "/v1beta/{parent=projects/*/locations/*}/gameServerDeployments" }; @@ -41,7 +44,8 @@ service GameServerDeploymentsService { } // Gets details of a single game server deployment. - rpc GetGameServerDeployment(GetGameServerDeploymentRequest) returns (GameServerDeployment) { + rpc GetGameServerDeployment(GetGameServerDeploymentRequest) + returns (GameServerDeployment) { option (google.api.http) = { get: "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*}" }; @@ -49,7 +53,8 @@ service GameServerDeploymentsService { } // Creates a new game server deployment in a given project and location. - rpc CreateGameServerDeployment(CreateGameServerDeploymentRequest) returns (google.longrunning.Operation) { + rpc CreateGameServerDeployment(CreateGameServerDeploymentRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta/{parent=projects/*/locations/*}/gameServerDeployments" body: "game_server_deployment" @@ -62,7 +67,8 @@ service GameServerDeploymentsService { } // Deletes a single game server deployment. - rpc DeleteGameServerDeployment(DeleteGameServerDeploymentRequest) returns (google.longrunning.Operation) { + rpc DeleteGameServerDeployment(DeleteGameServerDeploymentRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*}" }; @@ -74,7 +80,8 @@ service GameServerDeploymentsService { } // Patches a game server deployment. - rpc UpdateGameServerDeployment(UpdateGameServerDeploymentRequest) returns (google.longrunning.Operation) { + rpc UpdateGameServerDeployment(UpdateGameServerDeploymentRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1beta/{game_server_deployment.name=projects/*/locations/*/gameServerDeployments/*}" body: "game_server_deployment" @@ -87,7 +94,8 @@ service GameServerDeploymentsService { } // Gets details a single game server deployment rollout. - rpc GetGameServerDeploymentRollout(GetGameServerDeploymentRolloutRequest) returns (GameServerDeploymentRollout) { + rpc GetGameServerDeploymentRollout(GetGameServerDeploymentRolloutRequest) + returns (GameServerDeploymentRollout) { option (google.api.http) = { get: "/v1beta/{name=projects/*/locations/*/gameServerDeployments/*}/rollout" }; @@ -100,7 +108,9 @@ service GameServerDeploymentsService { // 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) { + rpc UpdateGameServerDeploymentRollout( + UpdateGameServerDeploymentRolloutRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1beta/{rollout.name=projects/*/locations/*/gameServerDeployments/*}/rollout" body: "rollout" @@ -114,7 +124,9 @@ service GameServerDeploymentsService { // Previews the game server deployment rollout. This API does not mutate the // rollout resource. - rpc PreviewGameServerDeploymentRollout(PreviewGameServerDeploymentRolloutRequest) returns (PreviewGameServerDeploymentRolloutResponse) { + rpc PreviewGameServerDeploymentRollout( + PreviewGameServerDeploymentRolloutRequest) + returns (PreviewGameServerDeploymentRolloutResponse) { option (google.api.http) = { patch: "/v1beta/{rollout.name=projects/*/locations/*/gameServerDeployments/*}/rollout:preview" body: "rollout" @@ -124,7 +136,8 @@ service GameServerDeploymentsService { // 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) { + 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 index f07013fb37d..f39fc938a29 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto @@ -27,6 +27,7 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;g 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 { @@ -42,8 +43,8 @@ message ListRealmsRequest { // 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. + // [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, @@ -125,7 +126,8 @@ message UpdateRealmRequest { // https: // //developers.google.com/protocol-buffers // // /docs/reference/google.protobuf#fieldmask - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; } // Request message for RealmsService.PreviewRealmUpdate. @@ -140,10 +142,12 @@ message PreviewRealmUpdateRequest { // https: // //developers.google.com/protocol-buffers // // /docs/reference/google.protobuf#fieldmask - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + 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]; + google.protobuf.Timestamp preview_time = 3 + [(google.api.field_behavior) = OPTIONAL]; } // Response message for RealmsService.PreviewRealmUpdate. @@ -168,16 +172,18 @@ message Realm { string name = 1; // Output only. The creation time. - google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + 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]; + 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: + // 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]; 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 index 446f5f5a9ff..eb6cca9312f 100644 --- 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 @@ -25,12 +25,14 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;g 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"; + 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) { @@ -87,7 +89,8 @@ service RealmsService { } // Previews patches to a single realm. - rpc PreviewRealmUpdate(PreviewRealmUpdateRequest) returns (PreviewRealmUpdateResponse) { + 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.json b/packages/google-cloud-gaming/protos/protos.json index 4a866ad2683..75dbb0c9f79 100644 --- a/packages/google-cloud-gaming/protos/protos.json +++ b/packages/google-cloud-gaming/protos/protos.json @@ -1975,7 +1975,8 @@ "options": { "go_package": "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming", "java_multiple_files": true, - "java_package": "com.google.cloud.gaming.v1beta" + "java_package": "com.google.cloud.gaming.v1beta", + "php_namespace": "Google\\Cloud\\Gaming\\V1beta" }, "nested": { "OperationMetadata": { 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 index ca90f2d5d6a..4892d9f24ca 100644 --- 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 @@ -1322,13 +1322,14 @@ export class GameServerClustersServiceClient { * 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. + * 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. + * 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] @@ -1404,13 +1405,14 @@ export class GameServerClustersServiceClient { * 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. + * 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. + * 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] @@ -1460,13 +1462,14 @@ export class GameServerClustersServiceClient { * 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. + * 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. + * 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] 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 index 6a85f456b25..775878e94d6 100644 --- 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 @@ -825,10 +825,11 @@ export class GameServerConfigsServiceClient { * 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. + * {@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. + * 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] @@ -904,10 +905,11 @@ export class GameServerConfigsServiceClient { * 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. + * {@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. + * 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] @@ -961,10 +963,11 @@ export class GameServerConfigsServiceClient { * 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. + * {@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. + * 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] 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 index 5d203ffe3b1..02cb6da6e7f 100644 --- 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 @@ -458,7 +458,8 @@ export class GameServerDeploymentsServiceClient { * @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: + * Required. The name of the game server delpoyment to retrieve. Uses the + * form: * * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}`. * @param {object} [options] @@ -562,7 +563,8 @@ export class GameServerDeploymentsServiceClient { * @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: + * Required. The name of the game server delpoyment to retrieve. Uses the + * form: * * `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout`. * @param {object} [options] @@ -677,8 +679,8 @@ export class GameServerDeploymentsServiceClient { * //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. + * 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. @@ -1495,11 +1497,11 @@ export class GameServerDeploymentsServiceClient { * 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. + * 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. @@ -1578,11 +1580,11 @@ export class GameServerDeploymentsServiceClient { * 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. + * 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. @@ -1635,11 +1637,11 @@ export class GameServerDeploymentsServiceClient { * 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. + * 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. diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index 6a3349018ca..4e3c3f79c8c 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -1053,8 +1053,8 @@ export class RealmsServiceClient { * 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. + * {@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. @@ -1130,8 +1130,8 @@ export class RealmsServiceClient { * 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. + * {@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. @@ -1187,8 +1187,8 @@ export class RealmsServiceClient { * 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. + * {@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. diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index b4a14e85c3e..e43aeb812bf 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "e8ad595a6e6f81e4250be223668a4bfa9fdfde7a" + "sha": "4c4c9e423af68bc7bb3d556245cead3c8b81dece" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5477122b3e8037a1dc5bc920536158edbd151dc4", - "internalRef": "361273630" + "sha": "001f72d55eba0da1f651dc252084eb7522fbe19d", + "internalRef": "368737560" } }, { From d7e03162ea3a985557d53221e5b22cd6297518b8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 20 Apr 2021 00:56:58 +0200 Subject: [PATCH 095/180] chore(deps): update dependency ts-loader to v9 (#158) [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [ts-loader](https://togithub.com/TypeStrong/ts-loader) | [`^8.0.0` -> `^9.0.0`](https://renovatebot.com/diffs/npm/ts-loader/8.1.0/9.0.0) | [![age](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/compatibility-slim/8.1.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/ts-loader/9.0.0/confidence-slim/8.1.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
TypeStrong/ts-loader ### [`v9.0.0`](https://togithub.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md#v900) [Compare Source](https://togithub.com/TypeStrong/ts-loader/compare/v8.1.0...v9.0.0) Breaking changes: - minimum webpack version: 5 - minimum node version: 12 Changes: - [webpack 5 migration](https://togithub.com/TypeStrong/ts-loader/pull/1251) - thanks [@​johnnyreilly](https://togithub.com/johnnyreilly), [@​jonwallsten](https://togithub.com/jonwallsten), [@​sokra](https://togithub.com/sokra), [@​appzuka](https://togithub.com/appzuka), [@​alexander-akait](https://togithub.com/alexander-akait)
--- ### Configuration :date: **Schedule**: "after 9am and before 3pm" (UTC). :vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied. :recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. :no_bell: **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 6e2767d9956..fd7d7f8f05b 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -45,7 +45,7 @@ "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", "sinon": "^10.0.0", - "ts-loader": "^8.0.0", + "ts-loader": "^9.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", "webpack-cli": "^4.0.0", From 8d4c3bcbe099e74cd5748a950640f85e4fee4d0a Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 20 Apr 2021 11:04:12 -0700 Subject: [PATCH 096/180] chore: regenerate common templates (#157) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/31998b87-0ee7-4b16-8673-c13ace78a04f/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) Source-Link: https://github.com/googleapis/synthtool/commit/c6706ee5d693e9ae5967614170732646590d8374 Source-Link: https://github.com/googleapis/synthtool/commit/b33b0e2056a85fc2264b294f2cf47dcd45e95186 Source-Link: https://github.com/googleapis/synthtool/commit/898b38a6f4fab89a76dfb152480bb034a781331b --- packages/google-cloud-gaming/synth.metadata | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index e43aeb812bf..2708a2dbdec 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "9583f62749edab8e1a5ccd613fe59cf553c189a1" + "sha": "c6706ee5d693e9ae5967614170732646590d8374" } } ], From 4ccddc6f4d9f9e79cc90247eee2ccea0c0693455 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Wed, 28 Apr 2021 16:56:34 -0700 Subject: [PATCH 097/180] build: warn uses when they edit auto-generated files (#160) --- packages/google-cloud-gaming/synth.metadata | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 2708a2dbdec..4c3acb61fef 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "4c4c9e423af68bc7bb3d556245cead3c8b81dece" + "sha": "5aca5d7fc3a2fe615e58e177cf4d66aeb784a17a" } }, { @@ -19,7 +19,7 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "c6706ee5d693e9ae5967614170732646590d8374" + "sha": "e6f3d54be015a394b6ab5a25903ec09062a2b424" } } ], From 36c8b2b3b6ae75ea9b4a12be33931431337e6949 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 29 Apr 2021 09:05:57 -0700 Subject: [PATCH 098/180] changes without context (#161) autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. --- .../google-cloud-gaming/protos/protos.d.ts | 14 +++++----- packages/google-cloud-gaming/protos/protos.js | 28 +++++++++---------- packages/google-cloud-gaming/synth.metadata | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/packages/google-cloud-gaming/protos/protos.d.ts b/packages/google-cloud-gaming/protos/protos.d.ts index a9f208a9735..241333e0704 100644 --- a/packages/google-cloud-gaming/protos/protos.d.ts +++ b/packages/google-cloud-gaming/protos/protos.d.ts @@ -5406,7 +5406,7 @@ export namespace google { public realmsSelector?: (google.cloud.gaming.v1.IRealmSelector|null); /** GameServerConfigOverride configVersion. */ - public configVersion: string; + public configVersion?: (string|null); /** GameServerConfigOverride selector. */ public selector?: "realmsSelector"; @@ -12474,7 +12474,7 @@ export namespace google { public realmsSelector?: (google.cloud.gaming.v1beta.IRealmSelector|null); /** GameServerConfigOverride configVersion. */ - public configVersion: string; + public configVersion?: (string|null); /** GameServerConfigOverride selector. */ public selector?: "realmsSelector"; @@ -14318,19 +14318,19 @@ export namespace google { public selector: string; /** HttpRule get. */ - public get: string; + public get?: (string|null); /** HttpRule put. */ - public put: string; + public put?: (string|null); /** HttpRule post. */ - public post: string; + public post?: (string|null); /** HttpRule delete. */ - public delete: string; + public delete?: (string|null); /** HttpRule patch. */ - public patch: string; + public patch?: (string|null); /** HttpRule custom. */ public custom?: (google.api.ICustomHttpPattern|null); diff --git a/packages/google-cloud-gaming/protos/protos.js b/packages/google-cloud-gaming/protos/protos.js index d662fda4574..09e4bb50921 100644 --- a/packages/google-cloud-gaming/protos/protos.js +++ b/packages/google-cloud-gaming/protos/protos.js @@ -12729,11 +12729,11 @@ /** * GameServerConfigOverride configVersion. - * @member {string} configVersion + * @member {string|null|undefined} configVersion * @memberof google.cloud.gaming.v1.GameServerConfigOverride * @instance */ - GameServerConfigOverride.prototype.configVersion = ""; + GameServerConfigOverride.prototype.configVersion = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -29218,11 +29218,11 @@ /** * GameServerConfigOverride configVersion. - * @member {string} configVersion + * @member {string|null|undefined} configVersion * @memberof google.cloud.gaming.v1beta.GameServerConfigOverride * @instance */ - GameServerConfigOverride.prototype.configVersion = ""; + GameServerConfigOverride.prototype.configVersion = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; @@ -33349,43 +33349,43 @@ /** * HttpRule get. - * @member {string} get + * @member {string|null|undefined} get * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.get = ""; + HttpRule.prototype.get = null; /** * HttpRule put. - * @member {string} put + * @member {string|null|undefined} put * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.put = ""; + HttpRule.prototype.put = null; /** * HttpRule post. - * @member {string} post + * @member {string|null|undefined} post * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.post = ""; + HttpRule.prototype.post = null; /** * HttpRule delete. - * @member {string} delete + * @member {string|null|undefined} delete * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype["delete"] = ""; + HttpRule.prototype["delete"] = null; /** * HttpRule patch. - * @member {string} patch + * @member {string|null|undefined} patch * @memberof google.api.HttpRule * @instance */ - HttpRule.prototype.patch = ""; + HttpRule.prototype.patch = null; /** * HttpRule custom. diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata index 4c3acb61fef..23d712256c5 100644 --- a/packages/google-cloud-gaming/synth.metadata +++ b/packages/google-cloud-gaming/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "5aca5d7fc3a2fe615e58e177cf4d66aeb784a17a" + "sha": "8c4ca5bdb6348bb09924dccb93e3a6021a8610d4" } }, { From 71b94e0b3a251d04c000c10a63bd8dff26b2a843 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 6 May 2021 17:54:10 -0700 Subject: [PATCH 099/180] fix(deps): require google-gax v2.12.0 (#162) --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index fd7d7f8f05b..bd600921c19 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -29,7 +29,7 @@ "api-documenter": "api-documenter yaml --input-folder=temp" }, "dependencies": { - "google-gax": "^2.9.2" + "google-gax": "^2.12.0" }, "devDependencies": { "@types/mocha": "^8.0.0", From 5b140aeb671817960832270b48a0ca24f9dcc2e0 Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Mon, 17 May 2021 17:45:33 -0700 Subject: [PATCH 100/180] chore: migrate to owl bot (#153) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: migrate to owl bot * chore: copy files from googleapis-gen fb91803ccef5d7c695139b22788b309e2197856b * chore: run the post processor * 🦉 Updates from OwlBot * fix: help tests pass * 🦉 Updates from OwlBot * update Docker image * 🦉 Updates from OwlBot Co-authored-by: Owl Bot Co-authored-by: Sofia Leon --- .../google-cloud-gaming/.github/.OwlBot.yaml | 26 + .../google-cloud-gaming/.repo-metadata.json | 15 +- .../{synth.py => owlbot.py} | 18 +- packages/google-cloud-gaming/src/index.ts | 6 +- .../v1/game_server_clusters_service_client.ts | 441 +++---- .../v1/game_server_configs_service_client.ts | 319 ++--- .../game_server_deployments_service_client.ts | 505 ++++---- .../src/v1/gapic_metadata.json | 351 ++++++ packages/google-cloud-gaming/src/v1/index.ts | 2 +- .../src/v1/realms_service_client.ts | 390 ++++--- .../game_server_clusters_service_client.ts | 107 +- .../game_server_configs_service_client.ts | 71 +- .../game_server_deployments_service_client.ts | 133 +-- .../src/v1beta/realms_service_client.ts | 89 +- packages/google-cloud-gaming/synth.metadata | 46 - .../system-test/fixtures/sample/src/index.js | 9 +- .../system-test/fixtures/sample/src/index.ts | 3 +- .../gapic_game_server_clusters_service_v1.ts | 642 +++++----- ...pic_game_server_clusters_service_v1beta.ts | 929 ++++++++------- .../gapic_game_server_configs_service_v1.ts | 473 ++++---- ...apic_game_server_configs_service_v1beta.ts | 645 +++++----- ...apic_game_server_deployments_service_v1.ts | 1039 +++++++++-------- ..._game_server_deployments_service_v1beta.ts | 1037 ++++++++-------- .../test/gapic_realms_service_v1.ts | 173 +-- .../test/gapic_realms_service_v1beta.ts | 171 +-- 25 files changed, 4141 insertions(+), 3499 deletions(-) create mode 100644 packages/google-cloud-gaming/.github/.OwlBot.yaml rename packages/google-cloud-gaming/{synth.py => owlbot.py} (53%) create mode 100644 packages/google-cloud-gaming/src/v1/gapic_metadata.json delete mode 100644 packages/google-cloud-gaming/synth.metadata diff --git a/packages/google-cloud-gaming/.github/.OwlBot.yaml b/packages/google-cloud-gaming/.github/.OwlBot.yaml new file mode 100644 index 00000000000..5603594fbf1 --- /dev/null +++ b/packages/google-cloud-gaming/.github/.OwlBot.yaml @@ -0,0 +1,26 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +docker: + image: gcr.io/repo-automation-bots/owlbot-nodejs:latest + + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/gaming/(v.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 + +begin-after-commit-hash: fb91803ccef5d7c695139b22788b309e2197856b + diff --git a/packages/google-cloud-gaming/.repo-metadata.json b/packages/google-cloud-gaming/.repo-metadata.json index a8b9dd524b9..b1ed7e5e45b 100644 --- a/packages/google-cloud-gaming/.repo-metadata.json +++ b/packages/google-cloud-gaming/.repo-metadata.json @@ -1,13 +1,14 @@ { - "name": "game-servers", - "name_pretty": "Google Cloud Game Servers", - "product_documentation": "https://cloud.google.com/game-servers/", "client_documentation": "https://googleapis.dev/nodejs/game-servers/latest", - "issue_tracker": "", + "product_documentation": "https://cloud.google.com/game-servers/", + "name": "game-servers", + "requires_billing": true, "release_level": "ga", "language": "nodejs", - "repo": "googleapis/nodejs-game-servers", - "distribution_name": "@google-cloud/game-servers", "api_id": "gameservices.googleapis.com", - "requires_billing": true + "distribution_name": "@google-cloud/game-servers", + "repo": "googleapis/nodejs-game-servers", + "issue_tracker": "", + "name_pretty": "Google Cloud Game Servers", + "default_version": "v1" } diff --git a/packages/google-cloud-gaming/synth.py b/packages/google-cloud-gaming/owlbot.py similarity index 53% rename from packages/google-cloud-gaming/synth.py rename to packages/google-cloud-gaming/owlbot.py index 2f98c0d2a92..3b58e346afc 100644 --- a/packages/google-cloud-gaming/synth.py +++ b/packages/google-cloud-gaming/owlbot.py @@ -12,22 +12,6 @@ # 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 as s -import synthtool.gcp as gcp import synthtool.languages.node as node -import logging -logging.basicConfig(level=logging.DEBUG) -AUTOSYNTH_MULTIPLE_COMMITS = True - -# run the gapic generator -gapic = gcp.GAPICBazel() -versions = ['v1', 'v1beta'] -for version in versions: - library = gapic.node_library('gaming', version) -s.copy(library, excludes=['package.json', 'README.md']) -# Copy common templates -common_templates = gcp.CommonTemplates() -templates = common_templates.node_library(source_location='build/src', versions=versions, default_version='v1') -s.copy(templates, excludes=[]) -node.postprocess_gapic_library() +node.owlbot_main(staging_excludes=['package.json', 'README.md', 'CODEOWNERS']) diff --git a/packages/google-cloud-gaming/src/index.ts b/packages/google-cloud-gaming/src/index.ts index 05c94cbb4be..afa0632daeb 100644 --- a/packages/google-cloud-gaming/src/index.ts +++ b/packages/google-cloud-gaming/src/index.ts @@ -16,8 +16,8 @@ // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** -import * as v1 from './v1'; import * as v1beta from './v1beta'; +import * as v1 from './v1'; const GameServerClustersServiceClient = v1.GameServerClustersServiceClient; type GameServerClustersServiceClient = v1.GameServerClustersServiceClient; @@ -30,16 +30,16 @@ const RealmsServiceClient = v1.RealmsServiceClient; type RealmsServiceClient = v1.RealmsServiceClient; export { - v1, v1beta, + v1, GameServerClustersServiceClient, GameServerConfigsServiceClient, GameServerDeploymentsServiceClient, RealmsServiceClient, }; export default { - v1, v1beta, + v1, GameServerClustersServiceClient, GameServerConfigsServiceClient, GameServerDeploymentsServiceClient, 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 index 1b7aae2cffe..1a69e552b8d 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -31,6 +32,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * 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'; import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; @@ -63,8 +69,10 @@ export class GameServerClustersServiceClient { /** * Construct an instance of GameServerClustersServiceClient. * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. + * @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/master/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] @@ -84,44 +92,36 @@ export class GameServerClustersServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. */ - constructor(opts?: ClientOptions) { - // Ensure that options include the service address and port. + // Ensure that options include all the required fields. const staticMembers = this .constructor as typeof GameServerClustersServiceClient; const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; - const port = opts && opts.port ? opts.port : staticMembers.port; + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + 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 (!opts) { - opts = {servicePath, port}; + // 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; } - opts.servicePath = opts.servicePath || servicePath; - opts.port = opts.port || port; - // users can override the config from client side, like retry codes name. - // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 - // The way to override client config for Showcase API: - // - // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} - // const showcaseClient = new showcaseClient({ projectId, customConfig }); - opts.clientConfig = opts.clientConfig || {}; - - // If we're running in browser, it's OK to omit `fallback` since - // google-gax has `browser` field in its `package.json`. - // For Electron (which does not respect `browser` field), - // pass `{fallback: true}` to the GameServerClustersServiceClient constructor. + // Choose either gRPC or proto-over-HTTP implementation of google-gax. this._gaxModule = opts.fallback ? gax.fallback : gax; - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = (this - .constructor as typeof GameServerClustersServiceClient).scopes; + // 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. @@ -130,6 +130,11 @@ export class GameServerClustersServiceClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // 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) { @@ -316,24 +321,27 @@ export class GameServerClustersServiceClient { ]; 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); - }, + 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], - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + descriptor ); this.innerApiCalls[methodName] = apiCall; @@ -344,6 +352,7 @@ export class GameServerClustersServiceClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'gameservices.googleapis.com'; @@ -352,6 +361,7 @@ export class GameServerClustersServiceClient { /** * 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'; @@ -359,6 +369,7 @@ export class GameServerClustersServiceClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -367,6 +378,7 @@ export class GameServerClustersServiceClient { /** * 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']; @@ -376,8 +388,7 @@ export class GameServerClustersServiceClient { getProjectId(callback: Callback): void; /** * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. + * @returns {Promise} A promise that resolves to string containing the project ID. */ getProjectId( callback?: Callback @@ -394,7 +405,7 @@ export class GameServerClustersServiceClient { // ------------------- getGameServerCluster( request: protos.google.cloud.gaming.v1.IGetGameServerClusterRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1.IGameServerCluster, @@ -404,7 +415,7 @@ export class GameServerClustersServiceClient { >; getGameServerCluster( request: protos.google.cloud.gaming.v1.IGetGameServerClusterRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.gaming.v1.IGameServerCluster, | protos.google.cloud.gaming.v1.IGetGameServerClusterRequest @@ -436,12 +447,16 @@ export class GameServerClustersServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getGameServerCluster(request); */ getGameServerCluster( request: protos.google.cloud.gaming.v1.IGetGameServerClusterRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.gaming.v1.IGameServerCluster, | protos.google.cloud.gaming.v1.IGetGameServerClusterRequest @@ -464,27 +479,26 @@ export class GameServerClustersServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getGameServerCluster(request, options, callback); } previewCreateGameServerCluster( request: protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse, @@ -497,7 +511,7 @@ export class GameServerClustersServiceClient { >; previewCreateGameServerCluster( request: protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse, | protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest @@ -535,12 +549,16 @@ export class GameServerClustersServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.previewCreateGameServerCluster(request); */ previewCreateGameServerCluster( request: protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterResponse, | protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest @@ -566,21 +584,20 @@ export class GameServerClustersServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.previewCreateGameServerCluster( request, @@ -590,7 +607,7 @@ export class GameServerClustersServiceClient { } previewDeleteGameServerCluster( request: protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse, @@ -603,7 +620,7 @@ export class GameServerClustersServiceClient { >; previewDeleteGameServerCluster( request: protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse, | protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest @@ -636,12 +653,16 @@ export class GameServerClustersServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.previewDeleteGameServerCluster(request); */ previewDeleteGameServerCluster( request: protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterResponse, | protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest @@ -667,21 +688,20 @@ export class GameServerClustersServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.previewDeleteGameServerCluster( request, @@ -691,7 +711,7 @@ export class GameServerClustersServiceClient { } previewUpdateGameServerCluster( request: protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse, @@ -704,7 +724,7 @@ export class GameServerClustersServiceClient { >; previewUpdateGameServerCluster( request: protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse, | protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest @@ -744,12 +764,16 @@ export class GameServerClustersServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.previewUpdateGameServerCluster(request); */ previewUpdateGameServerCluster( request: protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterResponse, | protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest @@ -775,21 +799,20 @@ export class GameServerClustersServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'game_server_cluster.name': request.gameServerCluster!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'game_server_cluster.name': request.gameServerCluster!.name || '', + }); this.initialize(); return this.innerApiCalls.previewUpdateGameServerCluster( request, @@ -800,7 +823,7 @@ export class GameServerClustersServiceClient { createGameServerCluster( request: protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -813,7 +836,7 @@ export class GameServerClustersServiceClient { >; createGameServerCluster( request: protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.gaming.v1.IGameServerCluster, @@ -849,13 +872,20 @@ export class GameServerClustersServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.createGameServerCluster(request); + * const [response] = await operation.promise(); */ createGameServerCluster( request: protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.gaming.v1.IGameServerCluster, @@ -883,21 +913,20 @@ export class GameServerClustersServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createGameServerCluster( request, @@ -906,18 +935,19 @@ export class GameServerClustersServiceClient { ); } /** - * Check the status of the long running operation returned by the createGameServerCluster() method. + * 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. - * - * @example: - * const decodedOperation = await checkCreateGameServerClusterProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkCreateGameServerClusterProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkCreateGameServerClusterProgress( name: string @@ -943,7 +973,7 @@ export class GameServerClustersServiceClient { } deleteGameServerCluster( request: protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -956,7 +986,7 @@ export class GameServerClustersServiceClient { >; deleteGameServerCluster( request: protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.protobuf.IEmpty, @@ -988,13 +1018,20 @@ export class GameServerClustersServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.deleteGameServerCluster(request); + * const [response] = await operation.promise(); */ deleteGameServerCluster( request: protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.protobuf.IEmpty, @@ -1022,21 +1059,20 @@ export class GameServerClustersServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteGameServerCluster( request, @@ -1045,18 +1081,19 @@ export class GameServerClustersServiceClient { ); } /** - * Check the status of the long running operation returned by the deleteGameServerCluster() method. + * 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. - * - * @example: - * const decodedOperation = await checkDeleteGameServerClusterProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkDeleteGameServerClusterProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkDeleteGameServerClusterProgress( name: string @@ -1082,7 +1119,7 @@ export class GameServerClustersServiceClient { } updateGameServerCluster( request: protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -1095,7 +1132,7 @@ export class GameServerClustersServiceClient { >; updateGameServerCluster( request: protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.gaming.v1.IGameServerCluster, @@ -1134,13 +1171,20 @@ export class GameServerClustersServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.updateGameServerCluster(request); + * const [response] = await operation.promise(); */ updateGameServerCluster( request: protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.gaming.v1.IGameServerCluster, @@ -1168,21 +1212,20 @@ export class GameServerClustersServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'game_server_cluster.name': request.gameServerCluster!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'game_server_cluster.name': request.gameServerCluster!.name || '', + }); this.initialize(); return this.innerApiCalls.updateGameServerCluster( request, @@ -1191,18 +1234,19 @@ export class GameServerClustersServiceClient { ); } /** - * Check the status of the long running operation returned by the updateGameServerCluster() method. + * 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. - * - * @example: - * const decodedOperation = await checkUpdateGameServerClusterProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkUpdateGameServerClusterProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkUpdateGameServerClusterProgress( name: string @@ -1228,7 +1272,7 @@ export class GameServerClustersServiceClient { } listGameServerClusters( request: protos.google.cloud.gaming.v1.IListGameServerClustersRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1.IGameServerCluster[], @@ -1238,7 +1282,7 @@ export class GameServerClustersServiceClient { >; listGameServerClusters( request: protos.google.cloud.gaming.v1.IListGameServerClustersRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.gaming.v1.IListGameServerClustersRequest, | protos.google.cloud.gaming.v1.IListGameServerClustersResponse @@ -1282,24 +1326,19 @@ export class GameServerClustersServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 support auto-pagination by default: it will call the API as many + * 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. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [GameServerCluster]{@link google.cloud.gaming.v1.GameServerCluster} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListGameServerClustersRequest]{@link google.cloud.gaming.v1.ListGameServerClustersRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListGameServerClustersResponse]{@link google.cloud.gaming.v1.ListGameServerClustersResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.gaming.v1.IListGameServerClustersRequest, | protos.google.cloud.gaming.v1.IListGameServerClustersResponse @@ -1322,21 +1361,20 @@ export class GameServerClustersServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listGameServerClusters( request, @@ -1346,18 +1384,7 @@ export class GameServerClustersServiceClient { } /** - * Equivalent to {@link listGameServerClusters}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listGameServerClusters} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * 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 @@ -1380,20 +1407,26 @@ export class GameServerClustersServiceClient { * 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?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGameServerClusters.createStream( @@ -1404,10 +1437,9 @@ export class GameServerClustersServiceClient { } /** - * Equivalent to {@link listGameServerClusters}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * 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 @@ -1429,27 +1461,37 @@ export class GameServerClustersServiceClient { * @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 conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * 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 + * const iterable = client.listGameServerClustersAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listGameServerClustersAsync( request?: protos.google.cloud.gaming.v1.IListGameServerClustersRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGameServerClusters.asyncIterate( this.innerApiCalls['listGameServerClusters'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -1783,9 +1825,10 @@ export class GameServerClustersServiceClient { } /** - * Terminate the GRPC channel and close the client. + * 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 { this.initialize(); 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 index 02f943ab4bd..2804b998e60 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -31,6 +32,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * 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'; import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; @@ -62,8 +68,10 @@ export class GameServerConfigsServiceClient { /** * Construct an instance of GameServerConfigsServiceClient. * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. + * @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/master/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] @@ -83,44 +91,36 @@ export class GameServerConfigsServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. */ - constructor(opts?: ClientOptions) { - // Ensure that options include the service address and port. + // Ensure that options include all the required fields. const staticMembers = this .constructor as typeof GameServerConfigsServiceClient; const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; - const port = opts && opts.port ? opts.port : staticMembers.port; + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + 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 (!opts) { - opts = {servicePath, port}; + // 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; } - opts.servicePath = opts.servicePath || servicePath; - opts.port = opts.port || port; - - // users can override the config from client side, like retry codes name. - // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 - // The way to override client config for Showcase API: - // - // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} - // const showcaseClient = new showcaseClient({ projectId, customConfig }); - opts.clientConfig = opts.clientConfig || {}; - // If we're running in browser, it's OK to omit `fallback` since - // google-gax has `browser` field in its `package.json`. - // For Electron (which does not respect `browser` field), - // pass `{fallback: true}` to the GameServerConfigsServiceClient constructor. + // Choose either gRPC or proto-over-HTTP implementation of google-gax. this._gaxModule = opts.fallback ? gax.fallback : gax; - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = (this - .constructor as typeof GameServerConfigsServiceClient).scopes; + // 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. @@ -129,6 +129,11 @@ export class GameServerConfigsServiceClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // 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) { @@ -295,24 +300,27 @@ export class GameServerConfigsServiceClient { ]; 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); - }, + 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], - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + descriptor ); this.innerApiCalls[methodName] = apiCall; @@ -323,6 +331,7 @@ export class GameServerConfigsServiceClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'gameservices.googleapis.com'; @@ -331,6 +340,7 @@ export class GameServerConfigsServiceClient { /** * 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'; @@ -338,6 +348,7 @@ export class GameServerConfigsServiceClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -346,6 +357,7 @@ export class GameServerConfigsServiceClient { /** * 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']; @@ -355,8 +367,7 @@ export class GameServerConfigsServiceClient { getProjectId(callback: Callback): void; /** * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. + * @returns {Promise} A promise that resolves to string containing the project ID. */ getProjectId( callback?: Callback @@ -373,7 +384,7 @@ export class GameServerConfigsServiceClient { // ------------------- getGameServerConfig( request: protos.google.cloud.gaming.v1.IGetGameServerConfigRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1.IGameServerConfig, @@ -383,7 +394,7 @@ export class GameServerConfigsServiceClient { >; getGameServerConfig( request: protos.google.cloud.gaming.v1.IGetGameServerConfigRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.gaming.v1.IGameServerConfig, | protos.google.cloud.gaming.v1.IGetGameServerConfigRequest @@ -415,12 +426,16 @@ export class GameServerConfigsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getGameServerConfig(request); */ getGameServerConfig( request: protos.google.cloud.gaming.v1.IGetGameServerConfigRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.gaming.v1.IGameServerConfig, | protos.google.cloud.gaming.v1.IGetGameServerConfigRequest @@ -443,28 +458,27 @@ export class GameServerConfigsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getGameServerConfig(request, options, callback); } createGameServerConfig( request: protos.google.cloud.gaming.v1.ICreateGameServerConfigRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -477,7 +491,7 @@ export class GameServerConfigsServiceClient { >; createGameServerConfig( request: protos.google.cloud.gaming.v1.ICreateGameServerConfigRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.gaming.v1.IGameServerConfig, @@ -516,13 +530,20 @@ export class GameServerConfigsServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.createGameServerConfig(request); + * const [response] = await operation.promise(); */ createGameServerConfig( request: protos.google.cloud.gaming.v1.ICreateGameServerConfigRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.gaming.v1.IGameServerConfig, @@ -550,21 +571,20 @@ export class GameServerConfigsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createGameServerConfig( request, @@ -573,18 +593,19 @@ export class GameServerConfigsServiceClient { ); } /** - * Check the status of the long running operation returned by the createGameServerConfig() method. + * 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. - * - * @example: - * const decodedOperation = await checkCreateGameServerConfigProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkCreateGameServerConfigProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkCreateGameServerConfigProgress( name: string @@ -610,7 +631,7 @@ export class GameServerConfigsServiceClient { } deleteGameServerConfig( request: protos.google.cloud.gaming.v1.IDeleteGameServerConfigRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -623,7 +644,7 @@ export class GameServerConfigsServiceClient { >; deleteGameServerConfig( request: protos.google.cloud.gaming.v1.IDeleteGameServerConfigRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.protobuf.IEmpty, @@ -657,13 +678,20 @@ export class GameServerConfigsServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.deleteGameServerConfig(request); + * const [response] = await operation.promise(); */ deleteGameServerConfig( request: protos.google.cloud.gaming.v1.IDeleteGameServerConfigRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.protobuf.IEmpty, @@ -691,21 +719,20 @@ export class GameServerConfigsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteGameServerConfig( request, @@ -714,18 +741,19 @@ export class GameServerConfigsServiceClient { ); } /** - * Check the status of the long running operation returned by the deleteGameServerConfig() method. + * 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. - * - * @example: - * const decodedOperation = await checkDeleteGameServerConfigProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkDeleteGameServerConfigProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkDeleteGameServerConfigProgress( name: string @@ -751,7 +779,7 @@ export class GameServerConfigsServiceClient { } listGameServerConfigs( request: protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1.IGameServerConfig[], @@ -761,7 +789,7 @@ export class GameServerConfigsServiceClient { >; listGameServerConfigs( request: protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, | protos.google.cloud.gaming.v1.IListGameServerConfigsResponse @@ -807,24 +835,19 @@ export class GameServerConfigsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 support auto-pagination by default: it will call the API as many + * 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. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [GameServerConfig]{@link google.cloud.gaming.v1.GameServerConfig} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListGameServerConfigsRequest]{@link google.cloud.gaming.v1.ListGameServerConfigsRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListGameServerConfigsResponse]{@link google.cloud.gaming.v1.ListGameServerConfigsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, | protos.google.cloud.gaming.v1.IListGameServerConfigsResponse @@ -847,38 +870,26 @@ export class GameServerConfigsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listGameServerConfigs(request, options, callback); } /** - * Equivalent to {@link listGameServerConfigs}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listGameServerConfigs} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * 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 @@ -902,20 +913,26 @@ export class GameServerConfigsServiceClient { * 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?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGameServerConfigs.createStream( @@ -926,10 +943,9 @@ export class GameServerConfigsServiceClient { } /** - * Equivalent to {@link listGameServerConfigs}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * 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 @@ -952,27 +968,37 @@ export class GameServerConfigsServiceClient { * @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 conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * 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 + * const iterable = client.listGameServerConfigsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listGameServerConfigsAsync( request?: protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGameServerConfigs.asyncIterate( this.innerApiCalls['listGameServerConfigs'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -1306,9 +1332,10 @@ export class GameServerConfigsServiceClient { } /** - * Terminate the GRPC channel and close the client. + * 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 { this.initialize(); 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 index 7a4fbc41935..e0d7581c542 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -31,6 +32,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * 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'; import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; @@ -63,8 +69,10 @@ export class GameServerDeploymentsServiceClient { /** * Construct an instance of GameServerDeploymentsServiceClient. * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. + * @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/master/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] @@ -84,44 +92,36 @@ export class GameServerDeploymentsServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. */ - constructor(opts?: ClientOptions) { - // Ensure that options include the service address and port. + // Ensure that options include all the required fields. const staticMembers = this .constructor as typeof GameServerDeploymentsServiceClient; const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; - const port = opts && opts.port ? opts.port : staticMembers.port; + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + 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 (!opts) { - opts = {servicePath, port}; + // 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; } - opts.servicePath = opts.servicePath || servicePath; - opts.port = opts.port || port; - - // users can override the config from client side, like retry codes name. - // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 - // The way to override client config for Showcase API: - // - // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} - // const showcaseClient = new showcaseClient({ projectId, customConfig }); - opts.clientConfig = opts.clientConfig || {}; - // If we're running in browser, it's OK to omit `fallback` since - // google-gax has `browser` field in its `package.json`. - // For Electron (which does not respect `browser` field), - // pass `{fallback: true}` to the GameServerDeploymentsServiceClient constructor. + // Choose either gRPC or proto-over-HTTP implementation of google-gax. this._gaxModule = opts.fallback ? gax.fallback : gax; - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = (this - .constructor as typeof GameServerDeploymentsServiceClient).scopes; + // 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. @@ -130,6 +130,11 @@ export class GameServerDeploymentsServiceClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // 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) { @@ -262,15 +267,16 @@ export class GameServerDeploymentsServiceClient { updateGameServerDeploymentMetadata ) ), - updateGameServerDeploymentRollout: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateGameServerDeploymentRolloutResponse.decode.bind( - updateGameServerDeploymentRolloutResponse + updateGameServerDeploymentRollout: + new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateGameServerDeploymentRolloutResponse.decode.bind( + updateGameServerDeploymentRolloutResponse + ), + updateGameServerDeploymentRolloutMetadata.decode.bind( + updateGameServerDeploymentRolloutMetadata + ) ), - updateGameServerDeploymentRolloutMetadata.decode.bind( - updateGameServerDeploymentRolloutMetadata - ) - ), }; // Put together the default options sent with requests. @@ -332,24 +338,27 @@ export class GameServerDeploymentsServiceClient { ]; 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); - }, + 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], - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + descriptor ); this.innerApiCalls[methodName] = apiCall; @@ -360,6 +369,7 @@ export class GameServerDeploymentsServiceClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'gameservices.googleapis.com'; @@ -368,6 +378,7 @@ export class GameServerDeploymentsServiceClient { /** * 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'; @@ -375,6 +386,7 @@ export class GameServerDeploymentsServiceClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -383,6 +395,7 @@ export class GameServerDeploymentsServiceClient { /** * 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']; @@ -392,8 +405,7 @@ export class GameServerDeploymentsServiceClient { getProjectId(callback: Callback): void; /** * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. + * @returns {Promise} A promise that resolves to string containing the project ID. */ getProjectId( callback?: Callback @@ -410,7 +422,7 @@ export class GameServerDeploymentsServiceClient { // ------------------- getGameServerDeployment( request: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1.IGameServerDeployment, @@ -420,7 +432,7 @@ export class GameServerDeploymentsServiceClient { >; getGameServerDeployment( request: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.gaming.v1.IGameServerDeployment, | protos.google.cloud.gaming.v1.IGetGameServerDeploymentRequest @@ -452,12 +464,16 @@ export class GameServerDeploymentsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getGameServerDeployment(request); */ getGameServerDeployment( request: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.gaming.v1.IGameServerDeployment, | protos.google.cloud.gaming.v1.IGetGameServerDeploymentRequest @@ -480,21 +496,20 @@ export class GameServerDeploymentsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getGameServerDeployment( request, @@ -504,7 +519,7 @@ export class GameServerDeploymentsServiceClient { } getGameServerDeploymentRollout( request: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1.IGameServerDeploymentRollout, @@ -517,7 +532,7 @@ export class GameServerDeploymentsServiceClient { >; getGameServerDeploymentRollout( request: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.gaming.v1.IGameServerDeploymentRollout, | protos.google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest @@ -549,12 +564,16 @@ export class GameServerDeploymentsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getGameServerDeploymentRollout(request); */ getGameServerDeploymentRollout( request: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.gaming.v1.IGameServerDeploymentRollout, | protos.google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest @@ -580,21 +599,20 @@ export class GameServerDeploymentsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getGameServerDeploymentRollout( request, @@ -604,7 +622,7 @@ export class GameServerDeploymentsServiceClient { } previewGameServerDeploymentRollout( request: protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutResponse, @@ -617,7 +635,7 @@ export class GameServerDeploymentsServiceClient { >; previewGameServerDeploymentRollout( request: protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutResponse, | protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest @@ -659,12 +677,16 @@ export class GameServerDeploymentsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.previewGameServerDeploymentRollout(request); */ previewGameServerDeploymentRollout( request: protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutResponse, | protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest @@ -690,21 +712,20 @@ export class GameServerDeploymentsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'rollout.name': request.rollout!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'rollout.name': request.rollout!.name || '', + }); this.initialize(); return this.innerApiCalls.previewGameServerDeploymentRollout( request, @@ -714,7 +735,7 @@ export class GameServerDeploymentsServiceClient { } fetchDeploymentState( request: protos.google.cloud.gaming.v1.IFetchDeploymentStateRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1.IFetchDeploymentStateResponse, @@ -724,7 +745,7 @@ export class GameServerDeploymentsServiceClient { >; fetchDeploymentState( request: protos.google.cloud.gaming.v1.IFetchDeploymentStateRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.gaming.v1.IFetchDeploymentStateResponse, | protos.google.cloud.gaming.v1.IFetchDeploymentStateRequest @@ -758,12 +779,16 @@ export class GameServerDeploymentsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.fetchDeploymentState(request); */ fetchDeploymentState( request: protos.google.cloud.gaming.v1.IFetchDeploymentStateRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.gaming.v1.IFetchDeploymentStateResponse, | protos.google.cloud.gaming.v1.IFetchDeploymentStateRequest @@ -786,28 +811,27 @@ export class GameServerDeploymentsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.fetchDeploymentState(request, options, callback); } createGameServerDeployment( request: protos.google.cloud.gaming.v1.ICreateGameServerDeploymentRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -820,7 +844,7 @@ export class GameServerDeploymentsServiceClient { >; createGameServerDeployment( request: protos.google.cloud.gaming.v1.ICreateGameServerDeploymentRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.gaming.v1.IGameServerDeployment, @@ -856,13 +880,20 @@ export class GameServerDeploymentsServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.createGameServerDeployment(request); + * const [response] = await operation.promise(); */ createGameServerDeployment( request: protos.google.cloud.gaming.v1.ICreateGameServerDeploymentRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.gaming.v1.IGameServerDeployment, @@ -890,21 +921,20 @@ export class GameServerDeploymentsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createGameServerDeployment( request, @@ -913,18 +943,19 @@ export class GameServerDeploymentsServiceClient { ); } /** - * Check the status of the long running operation returned by the createGameServerDeployment() method. + * 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. - * - * @example: - * const decodedOperation = await checkCreateGameServerDeploymentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkCreateGameServerDeploymentProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkCreateGameServerDeploymentProgress( name: string @@ -950,7 +981,7 @@ export class GameServerDeploymentsServiceClient { } deleteGameServerDeployment( request: protos.google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -963,7 +994,7 @@ export class GameServerDeploymentsServiceClient { >; deleteGameServerDeployment( request: protos.google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.protobuf.IEmpty, @@ -996,13 +1027,20 @@ export class GameServerDeploymentsServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.deleteGameServerDeployment(request); + * const [response] = await operation.promise(); */ deleteGameServerDeployment( request: protos.google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.protobuf.IEmpty, @@ -1030,21 +1068,20 @@ export class GameServerDeploymentsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteGameServerDeployment( request, @@ -1053,18 +1090,19 @@ export class GameServerDeploymentsServiceClient { ); } /** - * Check the status of the long running operation returned by the deleteGameServerDeployment() method. + * 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. - * - * @example: - * const decodedOperation = await checkDeleteGameServerDeploymentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkDeleteGameServerDeploymentProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkDeleteGameServerDeploymentProgress( name: string @@ -1090,7 +1128,7 @@ export class GameServerDeploymentsServiceClient { } updateGameServerDeployment( request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -1103,7 +1141,7 @@ export class GameServerDeploymentsServiceClient { >; updateGameServerDeployment( request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.gaming.v1.IGameServerDeployment, @@ -1142,13 +1180,20 @@ export class GameServerDeploymentsServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.updateGameServerDeployment(request); + * const [response] = await operation.promise(); */ updateGameServerDeployment( request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.gaming.v1.IGameServerDeployment, @@ -1176,21 +1221,20 @@ export class GameServerDeploymentsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'game_server_deployment.name': request.gameServerDeployment!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'game_server_deployment.name': request.gameServerDeployment!.name || '', + }); this.initialize(); return this.innerApiCalls.updateGameServerDeployment( request, @@ -1199,18 +1243,19 @@ export class GameServerDeploymentsServiceClient { ); } /** - * Check the status of the long running operation returned by the updateGameServerDeployment() method. + * 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. - * - * @example: - * const decodedOperation = await checkUpdateGameServerDeploymentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkUpdateGameServerDeploymentProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkUpdateGameServerDeploymentProgress( name: string @@ -1236,7 +1281,7 @@ export class GameServerDeploymentsServiceClient { } updateGameServerDeploymentRollout( request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -1249,7 +1294,7 @@ export class GameServerDeploymentsServiceClient { >; updateGameServerDeploymentRollout( request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.gaming.v1.IGameServerDeployment, @@ -1293,13 +1338,20 @@ export class GameServerDeploymentsServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.updateGameServerDeploymentRollout(request); + * const [response] = await operation.promise(); */ updateGameServerDeploymentRollout( request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.gaming.v1.IGameServerDeployment, @@ -1327,21 +1379,20 @@ export class GameServerDeploymentsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'rollout.name': request.rollout!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'rollout.name': request.rollout!.name || '', + }); this.initialize(); return this.innerApiCalls.updateGameServerDeploymentRollout( request, @@ -1350,18 +1401,19 @@ export class GameServerDeploymentsServiceClient { ); } /** - * Check the status of the long running operation returned by the updateGameServerDeploymentRollout() method. + * 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. - * - * @example: - * const decodedOperation = await checkUpdateGameServerDeploymentRolloutProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkUpdateGameServerDeploymentRolloutProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkUpdateGameServerDeploymentRolloutProgress( name: string @@ -1387,7 +1439,7 @@ export class GameServerDeploymentsServiceClient { } listGameServerDeployments( request: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1.IGameServerDeployment[], @@ -1397,7 +1449,7 @@ export class GameServerDeploymentsServiceClient { >; listGameServerDeployments( request: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, | protos.google.cloud.gaming.v1.IListGameServerDeploymentsResponse @@ -1442,24 +1494,19 @@ export class GameServerDeploymentsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 support auto-pagination by default: it will call the API as many + * 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. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [GameServerDeployment]{@link google.cloud.gaming.v1.GameServerDeployment} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListGameServerDeploymentsRequest]{@link google.cloud.gaming.v1.ListGameServerDeploymentsRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListGameServerDeploymentsResponse]{@link google.cloud.gaming.v1.ListGameServerDeploymentsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, | protos.google.cloud.gaming.v1.IListGameServerDeploymentsResponse @@ -1482,21 +1529,20 @@ export class GameServerDeploymentsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listGameServerDeployments( request, @@ -1506,18 +1552,7 @@ export class GameServerDeploymentsServiceClient { } /** - * Equivalent to {@link listGameServerDeployments}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listGameServerDeployments} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * 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 @@ -1541,20 +1576,26 @@ export class GameServerDeploymentsServiceClient { * 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?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGameServerDeployments.createStream( @@ -1565,10 +1606,9 @@ export class GameServerDeploymentsServiceClient { } /** - * Equivalent to {@link listGameServerDeployments}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * 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 @@ -1591,27 +1631,37 @@ export class GameServerDeploymentsServiceClient { * @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 conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * 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 + * const iterable = client.listGameServerDeploymentsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listGameServerDeploymentsAsync( request?: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGameServerDeployments.asyncIterate( this.innerApiCalls['listGameServerDeployments'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -1945,9 +1995,10 @@ export class GameServerDeploymentsServiceClient { } /** - * Terminate the GRPC channel and close the client. + * 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 { this.initialize(); 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..0df0d679864 --- /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": "gaming", + "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 index 861b577d05e..497ac69df5c 100644 --- a/packages/google-cloud-gaming/src/v1/index.ts +++ b/packages/google-cloud-gaming/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-gaming/src/v1/realms_service_client.ts b/packages/google-cloud-gaming/src/v1/realms_service_client.ts index 00a71bdf402..44a8b04e2cb 100644 --- a/packages/google-cloud-gaming/src/v1/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1/realms_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -16,6 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** +/* global window */ import * as gax from 'google-gax'; import { Callback, @@ -31,6 +32,11 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; +/** + * 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'; import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; @@ -63,8 +69,10 @@ export class RealmsServiceClient { /** * Construct an instance of RealmsServiceClient. * - * @param {object} [options] - The configuration object. See the subsequent - * parameters for more details. + * @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/master/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] @@ -84,42 +92,35 @@ export class RealmsServiceClient { * your project ID will be detected automatically. * @param {string} [options.apiEndpoint] - The domain name of the * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. */ - constructor(opts?: ClientOptions) { - // Ensure that options include the service address and port. + // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof RealmsServiceClient; const servicePath = - opts && opts.servicePath - ? opts.servicePath - : opts && opts.apiEndpoint - ? opts.apiEndpoint - : staticMembers.servicePath; - const port = opts && opts.port ? opts.port : staticMembers.port; + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + 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 (!opts) { - opts = {servicePath, port}; + // 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; } - opts.servicePath = opts.servicePath || servicePath; - opts.port = opts.port || port; - // users can override the config from client side, like retry codes name. - // The detailed structure of the clientConfig can be found here: https://github.com/googleapis/gax-nodejs/blob/master/src/gax.ts#L546 - // The way to override client config for Showcase API: - // - // const customConfig = {"interfaces": {"google.showcase.v1beta1.Echo": {"methods": {"Echo": {"retry_codes_name": "idempotent", "retry_params_name": "default"}}}}} - // const showcaseClient = new showcaseClient({ projectId, customConfig }); - opts.clientConfig = opts.clientConfig || {}; - - // If we're running in browser, it's OK to omit `fallback` since - // google-gax has `browser` field in its `package.json`. - // For Electron (which does not respect `browser` field), - // pass `{fallback: true}` to the RealmsServiceClient constructor. + // Choose either gRPC or proto-over-HTTP implementation of google-gax. this._gaxModule = opts.fallback ? gax.fallback : gax; - // Create a `gaxGrpc` object, with any grpc-specific options - // sent to the client. - opts.scopes = (this.constructor as typeof RealmsServiceClient).scopes; + // 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. @@ -128,6 +129,11 @@ export class RealmsServiceClient { // Save the auth object to the client, for use by other methods. this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + // 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) { @@ -299,24 +305,27 @@ export class RealmsServiceClient { ]; 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); - }, + 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], - this.descriptors.page[methodName] || - this.descriptors.stream[methodName] || - this.descriptors.longrunning[methodName] + descriptor ); this.innerApiCalls[methodName] = apiCall; @@ -327,6 +336,7 @@ export class RealmsServiceClient { /** * The DNS address for this API service. + * @returns {string} The DNS address for this service. */ static get servicePath() { return 'gameservices.googleapis.com'; @@ -335,6 +345,7 @@ export class RealmsServiceClient { /** * 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'; @@ -342,6 +353,7 @@ export class RealmsServiceClient { /** * The port for this API service. + * @returns {number} The default port for this service. */ static get port() { return 443; @@ -350,6 +362,7 @@ export class RealmsServiceClient { /** * 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']; @@ -359,8 +372,7 @@ export class RealmsServiceClient { getProjectId(callback: Callback): void; /** * Return the project ID used by this class. - * @param {function(Error, string)} callback - the callback to - * be called with the current project Id. + * @returns {Promise} A promise that resolves to string containing the project ID. */ getProjectId( callback?: Callback @@ -377,7 +389,7 @@ export class RealmsServiceClient { // ------------------- getRealm( request: protos.google.cloud.gaming.v1.IGetRealmRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1.IRealm, @@ -387,7 +399,7 @@ export class RealmsServiceClient { >; getRealm( request: protos.google.cloud.gaming.v1.IGetRealmRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.gaming.v1.IRealm, protos.google.cloud.gaming.v1.IGetRealmRequest | null | undefined, @@ -414,12 +426,16 @@ export class RealmsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getRealm(request); */ getRealm( request: protos.google.cloud.gaming.v1.IGetRealmRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.gaming.v1.IRealm, protos.google.cloud.gaming.v1.IGetRealmRequest | null | undefined, @@ -438,27 +454,26 @@ export class RealmsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getRealm(request, options, callback); } previewRealmUpdate( request: protos.google.cloud.gaming.v1.IPreviewRealmUpdateRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1.IPreviewRealmUpdateResponse, @@ -468,7 +483,7 @@ export class RealmsServiceClient { >; previewRealmUpdate( request: protos.google.cloud.gaming.v1.IPreviewRealmUpdateRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< protos.google.cloud.gaming.v1.IPreviewRealmUpdateResponse, | protos.google.cloud.gaming.v1.IPreviewRealmUpdateRequest @@ -508,12 +523,16 @@ export class RealmsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.previewRealmUpdate(request); */ previewRealmUpdate( request: protos.google.cloud.gaming.v1.IPreviewRealmUpdateRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< protos.google.cloud.gaming.v1.IPreviewRealmUpdateResponse, | protos.google.cloud.gaming.v1.IPreviewRealmUpdateRequest @@ -536,28 +555,27 @@ export class RealmsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'realm.name': request.realm!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'realm.name': request.realm!.name || '', + }); this.initialize(); return this.innerApiCalls.previewRealmUpdate(request, options, callback); } createRealm( request: protos.google.cloud.gaming.v1.ICreateRealmRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -570,7 +588,7 @@ export class RealmsServiceClient { >; createRealm( request: protos.google.cloud.gaming.v1.ICreateRealmRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.gaming.v1.IRealm, @@ -606,13 +624,20 @@ export class RealmsServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.createRealm(request); + * const [response] = await operation.promise(); */ createRealm( request: protos.google.cloud.gaming.v1.ICreateRealmRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.gaming.v1.IRealm, @@ -640,37 +665,37 @@ export class RealmsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createRealm(request, options, callback); } /** - * Check the status of the long running operation returned by the createRealm() method. + * 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. - * - * @example: - * const decodedOperation = await checkCreateRealmProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkCreateRealmProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkCreateRealmProgress( name: string @@ -696,7 +721,7 @@ export class RealmsServiceClient { } deleteRealm( request: protos.google.cloud.gaming.v1.IDeleteRealmRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -709,7 +734,7 @@ export class RealmsServiceClient { >; deleteRealm( request: protos.google.cloud.gaming.v1.IDeleteRealmRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.protobuf.IEmpty, @@ -741,13 +766,20 @@ export class RealmsServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.deleteRealm(request); + * const [response] = await operation.promise(); */ deleteRealm( request: protos.google.cloud.gaming.v1.IDeleteRealmRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.protobuf.IEmpty, @@ -775,37 +807,37 @@ export class RealmsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteRealm(request, options, callback); } /** - * Check the status of the long running operation returned by the deleteRealm() method. + * 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. - * - * @example: - * const decodedOperation = await checkDeleteRealmProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkDeleteRealmProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkDeleteRealmProgress( name: string @@ -831,7 +863,7 @@ export class RealmsServiceClient { } updateRealm( request: protos.google.cloud.gaming.v1.IUpdateRealmRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ LROperation< @@ -844,7 +876,7 @@ export class RealmsServiceClient { >; updateRealm( request: protos.google.cloud.gaming.v1.IUpdateRealmRequest, - options: gax.CallOptions, + options: CallOptions, callback: Callback< LROperation< protos.google.cloud.gaming.v1.IRealm, @@ -883,13 +915,20 @@ export class RealmsServiceClient { * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Operation]{@link google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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 + * const [operation] = await client.updateRealm(request); + * const [response] = await operation.promise(); */ updateRealm( request: protos.google.cloud.gaming.v1.IUpdateRealmRequest, optionsOrCallback?: - | gax.CallOptions + | CallOptions | Callback< LROperation< protos.google.cloud.gaming.v1.IRealm, @@ -917,37 +956,37 @@ export class RealmsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'realm.name': request.realm!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.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 the updateRealm() method. + * 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. - * - * @example: - * const decodedOperation = await checkUpdateRealmProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - * + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkUpdateRealmProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); */ async checkUpdateRealmProgress( name: string @@ -973,7 +1012,7 @@ export class RealmsServiceClient { } listRealms( request: protos.google.cloud.gaming.v1.IListRealmsRequest, - options?: gax.CallOptions + options?: CallOptions ): Promise< [ protos.google.cloud.gaming.v1.IRealm[], @@ -983,7 +1022,7 @@ export class RealmsServiceClient { >; listRealms( request: protos.google.cloud.gaming.v1.IListRealmsRequest, - options: gax.CallOptions, + options: CallOptions, callback: PaginationCallback< protos.google.cloud.gaming.v1.IListRealmsRequest, protos.google.cloud.gaming.v1.IListRealmsResponse | null | undefined, @@ -1024,24 +1063,19 @@ export class RealmsServiceClient { * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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 support auto-pagination by default: it will call the API as many + * 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. - * - * When autoPaginate: false is specified through options, the array has three elements. - * The first element is Array of [Realm]{@link google.cloud.gaming.v1.Realm} that corresponds to - * the one page received from the API server. - * If the second element is not null it contains the request object of type [ListRealmsRequest]{@link google.cloud.gaming.v1.ListRealmsRequest} - * that can be used to obtain the next page of the results. - * If it is null, the next page does not exist. - * The third element contains the raw response received from the API server. Its type is - * [ListRealmsResponse]{@link google.cloud.gaming.v1.ListRealmsResponse}. - * - * The promise has a method named "cancel" which cancels the ongoing API call. + * 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, optionsOrCallback?: - | gax.CallOptions + | CallOptions | PaginationCallback< protos.google.cloud.gaming.v1.IListRealmsRequest, protos.google.cloud.gaming.v1.IListRealmsResponse | null | undefined, @@ -1060,38 +1094,26 @@ export class RealmsServiceClient { ] > | void { request = request || {}; - let options: gax.CallOptions; + let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; } else { - options = optionsOrCallback as gax.CallOptions; + options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listRealms(request, options, callback); } /** - * Equivalent to {@link listRealms}, but returns a NodeJS Stream object. - * - * This fetches the paged responses for {@link listRealms} continuously - * and invokes the callback registered for 'data' event for each element in the - * responses. - * - * The returned object has 'end' method when no more elements are required. - * - * autoPaginate option will be ignored. - * - * @see {@link https://nodejs.org/api/stream.html} - * + * 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 @@ -1115,20 +1137,26 @@ export class RealmsServiceClient { * 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?: gax.CallOptions + options?: CallOptions ): Transform { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listRealms.createStream( @@ -1139,10 +1167,9 @@ export class RealmsServiceClient { } /** - * Equivalent to {@link listRealms}, but returns an iterable object. - * - * for-await-of syntax is used with the iterable to recursively get response element on-demand. + * 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 @@ -1165,27 +1192,37 @@ export class RealmsServiceClient { * @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 conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * 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 + * const iterable = client.listRealmsAsync(request); + * for await (const response of iterable) { + * // process response + * } */ listRealmsAsync( request?: protos.google.cloud.gaming.v1.IListRealmsRequest, - options?: gax.CallOptions + options?: CallOptions ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listRealms.asyncIterate( this.innerApiCalls['listRealms'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } @@ -1519,9 +1556,10 @@ export class RealmsServiceClient { } /** - * Terminate the GRPC channel and close the client. + * 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 { this.initialize(); 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 index 4892d9f24ca..7e72d9b3e90 100644 --- 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 @@ -321,13 +321,14 @@ export class GameServerClustersServiceClient { ]; 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); - }, + 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; } @@ -494,11 +495,10 @@ export class GameServerClustersServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getGameServerCluster(request, options, callback); } @@ -600,11 +600,10 @@ export class GameServerClustersServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.previewCreateGameServerCluster( request, @@ -705,11 +704,10 @@ export class GameServerClustersServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.previewDeleteGameServerCluster( request, @@ -817,11 +815,10 @@ export class GameServerClustersServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'game_server_cluster.name': request.gameServerCluster!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'game_server_cluster.name': request.gameServerCluster!.name || '', + }); this.initialize(); return this.innerApiCalls.previewUpdateGameServerCluster( request, @@ -932,11 +929,10 @@ export class GameServerClustersServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createGameServerCluster( request, @@ -1079,11 +1075,10 @@ export class GameServerClustersServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteGameServerCluster( request, @@ -1233,11 +1228,10 @@ export class GameServerClustersServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'game_server_cluster.name': request.gameServerCluster!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'game_server_cluster.name': request.gameServerCluster!.name || '', + }); this.initialize(); return this.innerApiCalls.updateGameServerCluster( request, @@ -1384,11 +1378,10 @@ export class GameServerClustersServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listGameServerClusters( request, @@ -1438,11 +1431,10 @@ export class GameServerClustersServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGameServerClusters.createStream( @@ -1499,17 +1491,16 @@ export class GameServerClustersServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGameServerClusters.asyncIterate( this.innerApiCalls['listGameServerClusters'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } 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 index 775878e94d6..ca50217c914 100644 --- 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 @@ -301,13 +301,14 @@ export class GameServerConfigsServiceClient { ]; 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); - }, + 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; } @@ -468,11 +469,10 @@ export class GameServerConfigsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getGameServerConfig(request, options, callback); } @@ -582,11 +582,10 @@ export class GameServerConfigsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createGameServerConfig( request, @@ -731,11 +730,10 @@ export class GameServerConfigsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteGameServerConfig( request, @@ -884,11 +882,10 @@ export class GameServerConfigsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listGameServerConfigs(request, options, callback); } @@ -935,11 +932,10 @@ export class GameServerConfigsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGameServerConfigs.createStream( @@ -997,17 +993,16 @@ export class GameServerConfigsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGameServerConfigs.asyncIterate( this.innerApiCalls['listGameServerConfigs'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } 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 index 02cb6da6e7f..42ecf270cd1 100644 --- 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 @@ -267,15 +267,16 @@ export class GameServerDeploymentsServiceClient { updateGameServerDeploymentMetadata ) ), - updateGameServerDeploymentRollout: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateGameServerDeploymentRolloutResponse.decode.bind( - updateGameServerDeploymentRolloutResponse + updateGameServerDeploymentRollout: + new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateGameServerDeploymentRolloutResponse.decode.bind( + updateGameServerDeploymentRolloutResponse + ), + updateGameServerDeploymentRolloutMetadata.decode.bind( + updateGameServerDeploymentRolloutMetadata + ) ), - updateGameServerDeploymentRolloutMetadata.decode.bind( - updateGameServerDeploymentRolloutMetadata - ) - ), }; // Put together the default options sent with requests. @@ -337,13 +338,14 @@ export class GameServerDeploymentsServiceClient { ]; 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); - }, + 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; } @@ -511,11 +513,10 @@ export class GameServerDeploymentsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getGameServerDeployment( request, @@ -616,11 +617,10 @@ export class GameServerDeploymentsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getGameServerDeploymentRollout( request, @@ -730,11 +730,10 @@ export class GameServerDeploymentsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'rollout.name': request.rollout!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'rollout.name': request.rollout!.name || '', + }); this.initialize(); return this.innerApiCalls.previewGameServerDeploymentRollout( request, @@ -836,11 +835,10 @@ export class GameServerDeploymentsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.fetchDeploymentState(request, options, callback); } @@ -947,11 +945,10 @@ export class GameServerDeploymentsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createGameServerDeployment( request, @@ -1095,11 +1092,10 @@ export class GameServerDeploymentsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteGameServerDeployment( request, @@ -1249,11 +1245,10 @@ export class GameServerDeploymentsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'game_server_deployment.name': request.gameServerDeployment!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'game_server_deployment.name': request.gameServerDeployment!.name || '', + }); this.initialize(); return this.innerApiCalls.updateGameServerDeployment( request, @@ -1408,11 +1403,10 @@ export class GameServerDeploymentsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'rollout.name': request.rollout!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'rollout.name': request.rollout!.name || '', + }); this.initialize(); return this.innerApiCalls.updateGameServerDeploymentRollout( request, @@ -1559,11 +1553,10 @@ export class GameServerDeploymentsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listGameServerDeployments( request, @@ -1613,11 +1606,10 @@ export class GameServerDeploymentsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGameServerDeployments.createStream( @@ -1674,17 +1666,16 @@ export class GameServerDeploymentsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listGameServerDeployments.asyncIterate( this.innerApiCalls['listGameServerDeployments'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index 4e3c3f79c8c..09168de20e5 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -305,13 +305,14 @@ export class RealmsServiceClient { ]; 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); - }, + 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; } @@ -463,11 +464,10 @@ export class RealmsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getRealm(request, options, callback); } @@ -565,11 +565,10 @@ export class RealmsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'realm.name': request.realm!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'realm.name': request.realm!.name || '', + }); this.initialize(); return this.innerApiCalls.previewRealmUpdate(request, options, callback); } @@ -676,11 +675,10 @@ export class RealmsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createRealm(request, options, callback); } @@ -819,11 +817,10 @@ export class RealmsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - name: request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteRealm(request, options, callback); } @@ -969,11 +966,10 @@ export class RealmsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'realm.name': request.realm!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'realm.name': request.realm!.name || '', + }); this.initialize(); return this.innerApiCalls.updateRealm(request, options, callback); } @@ -1110,11 +1106,10 @@ export class RealmsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listRealms(request, options, callback); } @@ -1160,11 +1155,10 @@ export class RealmsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listRealms.createStream( @@ -1221,17 +1215,16 @@ export class RealmsServiceClient { options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - parent: request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const callSettings = new gax.CallSettings(options); this.initialize(); return this.descriptors.page.listRealms.asyncIterate( this.innerApiCalls['listRealms'] as GaxCall, - (request as unknown) as RequestType, + request as unknown as RequestType, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-gaming/synth.metadata b/packages/google-cloud-gaming/synth.metadata deleted file mode 100644 index 23d712256c5..00000000000 --- a/packages/google-cloud-gaming/synth.metadata +++ /dev/null @@ -1,46 +0,0 @@ -{ - "sources": [ - { - "git": { - "name": ".", - "remote": "https://github.com/googleapis/nodejs-game-servers.git", - "sha": "8c4ca5bdb6348bb09924dccb93e3a6021a8610d4" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "001f72d55eba0da1f651dc252084eb7522fbe19d", - "internalRef": "368737560" - } - }, - { - "git": { - "name": "synthtool", - "remote": "https://github.com/googleapis/synthtool.git", - "sha": "e6f3d54be015a394b6ab5a25903ec09062a2b424" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "gaming", - "apiVersion": "v1", - "language": "nodejs", - "generator": "bazel" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "gaming", - "apiVersion": "v1beta", - "language": "nodejs", - "generator": "bazel" - } - } - ] -} \ No newline at end of file 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 index 76514a01271..08fcf40d666 100644 --- a/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.js @@ -20,9 +20,12 @@ 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 gameServerClustersServiceClient = + new gaming.GameServerClustersServiceClient(); + const gameServerConfigsServiceClient = + new gaming.GameServerConfigsServiceClient(); + const gameServerDeploymentsServiceClient = + new gaming.GameServerDeploymentsServiceClient(); const realmsServiceClient = new gaming.RealmsServiceClient(); } 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 index 2ffd46371fd..86f5b7f598b 100644 --- a/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.ts @@ -51,7 +51,8 @@ function main() { const gameServerConfigsServiceClient = new GameServerConfigsServiceClient(); doStuffWithGameServerConfigsServiceClient(gameServerConfigsServiceClient); // check that the client instance can be created - const gameServerDeploymentsServiceClient = new GameServerDeploymentsServiceClient(); + const gameServerDeploymentsServiceClient = + new GameServerDeploymentsServiceClient(); doStuffWithGameServerDeploymentsServiceClient( gameServerDeploymentsServiceClient ); 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 index 58aa189c571..4652b8ea7ad 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + 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; @@ -168,49 +167,46 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('should create a client with no option', () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient(); + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient(); assert(client); }); it('should create a client with gRPC fallback', () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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( - { + 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', () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.close(); }); it('has getProjectId method', async () => { const fakeProjectId = 'fake-project-id'; - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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); @@ -219,12 +215,11 @@ describe('v1.GameServerClustersServiceClient', () => { it('has getProjectId method with callback', async () => { const fakeProjectId = 'fake-project-id'; - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.auth.getProjectId = sinon .stub() .callsArgWith(0, null, fakeProjectId); @@ -243,12 +238,11 @@ describe('v1.GameServerClustersServiceClient', () => { describe('getGameServerCluster', () => { it('invokes getGameServerCluster without error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -265,9 +259,8 @@ describe('v1.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerCluster() ); - client.innerApiCalls.getGameServerCluster = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getGameServerCluster = + stubSimpleCall(expectedResponse); const [response] = await client.getGameServerCluster(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -278,12 +271,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes getGameServerCluster without error using callback', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -300,9 +292,8 @@ describe('v1.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerCluster() ); - client.innerApiCalls.getGameServerCluster = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getGameServerCluster = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getGameServerCluster( request, @@ -328,12 +319,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes getGameServerCluster with error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -363,12 +353,11 @@ describe('v1.GameServerClustersServiceClient', () => { describe('previewCreateGameServerCluster', () => { it('invokes previewCreateGameServerCluster without error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -385,9 +374,8 @@ describe('v1.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse() ); - client.innerApiCalls.previewCreateGameServerCluster = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.previewCreateGameServerCluster = + stubSimpleCall(expectedResponse); const [response] = await client.previewCreateGameServerCluster(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -398,12 +386,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes previewCreateGameServerCluster without error using callback', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -420,9 +407,8 @@ describe('v1.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse() ); - client.innerApiCalls.previewCreateGameServerCluster = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.previewCreateGameServerCluster = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.previewCreateGameServerCluster( request, @@ -448,12 +434,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes previewCreateGameServerCluster with error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -486,12 +471,11 @@ describe('v1.GameServerClustersServiceClient', () => { describe('previewDeleteGameServerCluster', () => { it('invokes previewDeleteGameServerCluster without error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -508,9 +492,8 @@ describe('v1.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse() ); - client.innerApiCalls.previewDeleteGameServerCluster = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.previewDeleteGameServerCluster = + stubSimpleCall(expectedResponse); const [response] = await client.previewDeleteGameServerCluster(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -521,12 +504,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes previewDeleteGameServerCluster without error using callback', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -543,9 +525,8 @@ describe('v1.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse() ); - client.innerApiCalls.previewDeleteGameServerCluster = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.previewDeleteGameServerCluster = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.previewDeleteGameServerCluster( request, @@ -571,12 +552,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes previewDeleteGameServerCluster with error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -609,12 +589,11 @@ describe('v1.GameServerClustersServiceClient', () => { describe('previewUpdateGameServerCluster', () => { it('invokes previewUpdateGameServerCluster without error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -632,9 +611,8 @@ describe('v1.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse() ); - client.innerApiCalls.previewUpdateGameServerCluster = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.previewUpdateGameServerCluster = + stubSimpleCall(expectedResponse); const [response] = await client.previewUpdateGameServerCluster(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -645,12 +623,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes previewUpdateGameServerCluster without error using callback', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -668,9 +645,8 @@ describe('v1.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse() ); - client.innerApiCalls.previewUpdateGameServerCluster = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.previewUpdateGameServerCluster = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.previewUpdateGameServerCluster( request, @@ -696,12 +672,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes previewUpdateGameServerCluster with error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -735,12 +710,11 @@ describe('v1.GameServerClustersServiceClient', () => { describe('createGameServerCluster', () => { it('invokes createGameServerCluster without error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -757,9 +731,8 @@ describe('v1.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createGameServerCluster = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.createGameServerCluster = + stubLongRunningCall(expectedResponse); const [operation] = await client.createGameServerCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -771,12 +744,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes createGameServerCluster without error using callback', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -793,9 +765,8 @@ describe('v1.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createGameServerCluster = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createGameServerCluster = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createGameServerCluster( request, @@ -828,12 +799,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes createGameServerCluster with call error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -864,12 +834,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes createGameServerCluster with LRO error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -899,12 +868,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes checkCreateGameServerClusterProgress without error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -914,21 +882,21 @@ describe('v1.GameServerClustersServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateGameServerClusterProgress( - expectedResponse.name - ); + 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( - { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const expectedError = new Error('expected'); @@ -946,12 +914,11 @@ describe('v1.GameServerClustersServiceClient', () => { describe('deleteGameServerCluster', () => { it('invokes deleteGameServerCluster without error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -968,9 +935,8 @@ describe('v1.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteGameServerCluster = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.deleteGameServerCluster = + stubLongRunningCall(expectedResponse); const [operation] = await client.deleteGameServerCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -982,12 +948,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes deleteGameServerCluster without error using callback', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -1004,9 +969,8 @@ describe('v1.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteGameServerCluster = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteGameServerCluster = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteGameServerCluster( request, @@ -1039,12 +1003,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes deleteGameServerCluster with call error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -1075,12 +1038,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes deleteGameServerCluster with LRO error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -1110,12 +1072,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes checkDeleteGameServerClusterProgress without error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -1125,21 +1086,21 @@ describe('v1.GameServerClustersServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteGameServerClusterProgress( - expectedResponse.name - ); + 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( - { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const expectedError = new Error('expected'); @@ -1157,12 +1118,11 @@ describe('v1.GameServerClustersServiceClient', () => { describe('updateGameServerCluster', () => { it('invokes updateGameServerCluster without error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -1180,9 +1140,8 @@ describe('v1.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateGameServerCluster = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.updateGameServerCluster = + stubLongRunningCall(expectedResponse); const [operation] = await client.updateGameServerCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -1194,12 +1153,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes updateGameServerCluster without error using callback', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -1217,9 +1175,8 @@ describe('v1.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateGameServerCluster = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateGameServerCluster = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateGameServerCluster( request, @@ -1252,12 +1209,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes updateGameServerCluster with call error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -1289,12 +1245,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes updateGameServerCluster with LRO error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -1325,12 +1280,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes checkUpdateGameServerClusterProgress without error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -1340,21 +1294,21 @@ describe('v1.GameServerClustersServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateGameServerClusterProgress( - expectedResponse.name - ); + 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( - { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const expectedError = new Error('expected'); @@ -1372,12 +1326,11 @@ describe('v1.GameServerClustersServiceClient', () => { describe('listGameServerClusters', () => { it('invokes listGameServerClusters without error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -1402,9 +1355,8 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.GameServerCluster() ), ]; - client.innerApiCalls.listGameServerClusters = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.listGameServerClusters = + stubSimpleCall(expectedResponse); const [response] = await client.listGameServerClusters(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1415,12 +1367,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes listGameServerClusters without error using callback', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -1445,9 +1396,8 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.GameServerCluster() ), ]; - client.innerApiCalls.listGameServerClusters = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listGameServerClusters = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listGameServerClusters( request, @@ -1473,12 +1423,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes listGameServerClusters with error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -1509,12 +1458,11 @@ describe('v1.GameServerClustersServiceClient', () => { }); it('invokes listGameServerClustersStream without error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -1532,9 +1480,8 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.GameServerCluster() ), ]; - client.descriptors.page.listGameServerClusters.createStream = stubPageStreamingCall( - expectedResponse - ); + 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[] = []; @@ -1554,27 +1501,28 @@ describe('v1.GameServerClustersServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listGameServerClusters - .createStream as SinonStub) + ( + client.descriptors.page.listGameServerClusters + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listGameServerClusters, request) ); assert.strictEqual( - (client.descriptors.page.listGameServerClusters - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerClusters + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('invokes listGameServerClustersStream with error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -1582,10 +1530,8 @@ describe('v1.GameServerClustersServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listGameServerClusters.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + 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[] = []; @@ -1604,27 +1550,28 @@ describe('v1.GameServerClustersServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listGameServerClusters - .createStream as SinonStub) + ( + client.descriptors.page.listGameServerClusters + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listGameServerClusters, request) ); assert.strictEqual( - (client.descriptors.page.listGameServerClusters - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerClusters + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('uses async iteration with listGameServerClusters without error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -1642,9 +1589,8 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.GameServerCluster() ), ]; - client.descriptors.page.listGameServerClusters.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + 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) { @@ -1652,26 +1598,27 @@ describe('v1.GameServerClustersServiceClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listGameServerClusters - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listGameServerClusters + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listGameServerClusters - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerClusters + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('uses async iteration with listGameServerClusters with error', async () => { - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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() @@ -1679,27 +1626,28 @@ describe('v1.GameServerClustersServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listGameServerClusters.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + 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[] = []; + 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], + ( + client.descriptors.page.listGameServerClusters + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listGameServerClusters - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerClusters + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1714,12 +1662,11 @@ describe('v1.GameServerClustersServiceClient', () => { realm: 'realmValue', cluster: 'clusterValue', }; - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.gameServerClusterPathTemplate.render = sinon .stub() @@ -1737,8 +1684,10 @@ describe('v1.GameServerClustersServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -1748,8 +1697,10 @@ describe('v1.GameServerClustersServiceClient', () => { const result = client.matchProjectFromGameServerClusterName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1759,8 +1710,10 @@ describe('v1.GameServerClustersServiceClient', () => { const result = client.matchLocationFromGameServerClusterName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1770,8 +1723,10 @@ describe('v1.GameServerClustersServiceClient', () => { const result = client.matchRealmFromGameServerClusterName(fakePath); assert.strictEqual(result, 'realmValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1781,8 +1736,10 @@ describe('v1.GameServerClustersServiceClient', () => { const result = client.matchClusterFromGameServerClusterName(fakePath); assert.strictEqual(result, 'clusterValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1797,12 +1754,11 @@ describe('v1.GameServerClustersServiceClient', () => { deployment: 'deploymentValue', config: 'configValue', }; - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.gameServerConfigPathTemplate.render = sinon .stub() @@ -1820,8 +1776,10 @@ describe('v1.GameServerClustersServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -1875,12 +1833,11 @@ describe('v1.GameServerClustersServiceClient', () => { location: 'locationValue', deployment: 'deploymentValue', }; - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.gameServerDeploymentPathTemplate.render = sinon .stub() @@ -1897,47 +1854,52 @@ describe('v1.GameServerClustersServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromGameServerDeploymentName', () => { - const result = client.matchProjectFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchProjectFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchLocationFromGameServerDeploymentName', () => { - const result = client.matchLocationFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchLocationFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchDeploymentFromGameServerDeploymentName', () => { - const result = client.matchDeploymentFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchDeploymentFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'deploymentValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1951,16 +1913,14 @@ describe('v1.GameServerClustersServiceClient', () => { location: 'locationValue', deployment: 'deploymentValue', }; - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + 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.render = + sinon.stub().returns(fakePath); client.pathTemplates.gameServerDeploymentRolloutPathTemplate.match = sinon .stub() .returns(expectedParameters); @@ -1973,47 +1933,52 @@ describe('v1.GameServerClustersServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromGameServerDeploymentRolloutName', () => { - const result = client.matchProjectFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchProjectFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchLocationFromGameServerDeploymentRolloutName', () => { - const result = client.matchLocationFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchLocationFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchDeploymentFromGameServerDeploymentRolloutName', () => { - const result = client.matchDeploymentFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchDeploymentFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'deploymentValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2027,12 +1992,11 @@ describe('v1.GameServerClustersServiceClient', () => { location: 'locationValue', realm: 'realmValue', }; - const client = new gameserverclustersserviceModule.v1.GameServerClustersServiceClient( - { + const client = + new gameserverclustersserviceModule.v1.GameServerClustersServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.realmPathTemplate.render = sinon .stub() 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 index abece03a561..e4f036f2fe2 100644 --- 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 @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + 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; @@ -169,49 +168,54 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('should create a client with no option', () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient(); + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient(); assert(client); }); it('should create a client with gRPC fallback', () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - fallback: true, - } - ); + 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', - } - ); + 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', () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.close(); }); 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', - } - ); + 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); @@ -220,12 +224,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { 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', - } - ); + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.auth.getProjectId = sinon .stub() .callsArgWith(0, null, fakeProjectId); @@ -244,12 +249,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { describe('getGameServerCluster', () => { it('invokes getGameServerCluster without error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -266,9 +272,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerCluster() ); - client.innerApiCalls.getGameServerCluster = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getGameServerCluster = + stubSimpleCall(expectedResponse); const [response] = await client.getGameServerCluster(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -279,12 +284,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes getGameServerCluster without error using callback', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -301,9 +307,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerCluster() ); - client.innerApiCalls.getGameServerCluster = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getGameServerCluster = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getGameServerCluster( request, @@ -329,12 +334,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes getGameServerCluster with error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -364,12 +370,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { describe('previewCreateGameServerCluster', () => { it('invokes previewCreateGameServerCluster without error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -386,9 +393,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse() ); - client.innerApiCalls.previewCreateGameServerCluster = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.previewCreateGameServerCluster = + stubSimpleCall(expectedResponse); const [response] = await client.previewCreateGameServerCluster(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -399,12 +405,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes previewCreateGameServerCluster without error using callback', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -421,9 +428,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse() ); - client.innerApiCalls.previewCreateGameServerCluster = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.previewCreateGameServerCluster = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.previewCreateGameServerCluster( request, @@ -449,12 +455,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes previewCreateGameServerCluster with error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -487,12 +494,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { describe('previewDeleteGameServerCluster', () => { it('invokes previewDeleteGameServerCluster without error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -509,9 +517,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse() ); - client.innerApiCalls.previewDeleteGameServerCluster = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.previewDeleteGameServerCluster = + stubSimpleCall(expectedResponse); const [response] = await client.previewDeleteGameServerCluster(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -522,12 +529,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes previewDeleteGameServerCluster without error using callback', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -544,9 +552,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse() ); - client.innerApiCalls.previewDeleteGameServerCluster = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.previewDeleteGameServerCluster = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.previewDeleteGameServerCluster( request, @@ -572,12 +579,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes previewDeleteGameServerCluster with error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -610,12 +618,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { describe('previewUpdateGameServerCluster', () => { it('invokes previewUpdateGameServerCluster without error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -633,9 +642,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse() ); - client.innerApiCalls.previewUpdateGameServerCluster = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.previewUpdateGameServerCluster = + stubSimpleCall(expectedResponse); const [response] = await client.previewUpdateGameServerCluster(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -646,12 +654,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes previewUpdateGameServerCluster without error using callback', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -669,9 +678,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse() ); - client.innerApiCalls.previewUpdateGameServerCluster = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.previewUpdateGameServerCluster = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.previewUpdateGameServerCluster( request, @@ -697,12 +705,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes previewUpdateGameServerCluster with error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -736,12 +745,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { describe('createGameServerCluster', () => { it('invokes createGameServerCluster without error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -758,9 +768,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createGameServerCluster = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.createGameServerCluster = + stubLongRunningCall(expectedResponse); const [operation] = await client.createGameServerCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -772,12 +781,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes createGameServerCluster without error using callback', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -794,9 +804,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createGameServerCluster = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createGameServerCluster = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createGameServerCluster( request, @@ -829,12 +838,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes createGameServerCluster with call error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -865,12 +875,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes createGameServerCluster with LRO error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -900,12 +911,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes checkCreateGameServerClusterProgress without error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -915,21 +927,23 @@ describe('v1beta.GameServerClustersServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateGameServerClusterProgress( - expectedResponse.name - ); + 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', - } - ); + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const expectedError = new Error('expected'); @@ -947,12 +961,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { describe('deleteGameServerCluster', () => { it('invokes deleteGameServerCluster without error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -969,9 +984,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteGameServerCluster = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.deleteGameServerCluster = + stubLongRunningCall(expectedResponse); const [operation] = await client.deleteGameServerCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -983,12 +997,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes deleteGameServerCluster without error using callback', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1005,9 +1020,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteGameServerCluster = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteGameServerCluster = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteGameServerCluster( request, @@ -1040,12 +1054,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes deleteGameServerCluster with call error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1076,12 +1091,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes deleteGameServerCluster with LRO error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1111,12 +1127,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes checkDeleteGameServerClusterProgress without error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1126,21 +1143,23 @@ describe('v1beta.GameServerClustersServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteGameServerClusterProgress( - expectedResponse.name - ); + 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', - } - ); + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const expectedError = new Error('expected'); @@ -1158,12 +1177,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { describe('updateGameServerCluster', () => { it('invokes updateGameServerCluster without error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1181,9 +1201,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateGameServerCluster = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.updateGameServerCluster = + stubLongRunningCall(expectedResponse); const [operation] = await client.updateGameServerCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -1195,12 +1214,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes updateGameServerCluster without error using callback', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1218,9 +1238,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateGameServerCluster = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateGameServerCluster = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateGameServerCluster( request, @@ -1253,12 +1272,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes updateGameServerCluster with call error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1290,12 +1310,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes updateGameServerCluster with LRO error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1326,12 +1347,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes checkUpdateGameServerClusterProgress without error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1341,21 +1363,23 @@ describe('v1beta.GameServerClustersServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateGameServerClusterProgress( - expectedResponse.name - ); + 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', - } - ); + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const expectedError = new Error('expected'); @@ -1373,12 +1397,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { describe('listGameServerClusters', () => { it('invokes listGameServerClusters without error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1403,9 +1428,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.GameServerCluster() ), ]; - client.innerApiCalls.listGameServerClusters = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.listGameServerClusters = + stubSimpleCall(expectedResponse); const [response] = await client.listGameServerClusters(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1416,12 +1440,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes listGameServerClusters without error using callback', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1446,9 +1471,8 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.GameServerCluster() ), ]; - client.innerApiCalls.listGameServerClusters = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listGameServerClusters = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listGameServerClusters( request, @@ -1476,12 +1500,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes listGameServerClusters with error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1512,12 +1537,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); it('invokes listGameServerClustersStream without error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1535,12 +1561,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.GameServerCluster() ), ]; - client.descriptors.page.listGameServerClusters.createStream = stubPageStreamingCall( - expectedResponse - ); + 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[] = []; + const responses: protos.google.cloud.gaming.v1beta.GameServerCluster[] = + []; stream.on( 'data', (response: protos.google.cloud.gaming.v1beta.GameServerCluster) => { @@ -1557,27 +1583,30 @@ describe('v1beta.GameServerClustersServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listGameServerClusters - .createStream as SinonStub) + ( + client.descriptors.page.listGameServerClusters + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listGameServerClusters, request) ); assert.strictEqual( - (client.descriptors.page.listGameServerClusters - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerClusters + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('invokes listGameServerClustersStream with error', async () => { - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1585,13 +1614,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listGameServerClusters.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + 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[] = []; + const responses: protos.google.cloud.gaming.v1beta.GameServerCluster[] = + []; stream.on( 'data', (response: protos.google.cloud.gaming.v1beta.GameServerCluster) => { @@ -1607,27 +1635,30 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listGameServerClusters - .createStream as SinonStub) + ( + client.descriptors.page.listGameServerClusters + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listGameServerClusters, request) ); assert.strictEqual( - (client.descriptors.page.listGameServerClusters - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerClusters + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], 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', - } - ); + 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() @@ -1645,36 +1676,39 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.GameServerCluster() ), ]; - client.descriptors.page.listGameServerClusters.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.gaming.v1beta.IGameServerCluster[] = []; + 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], + ( + client.descriptors.page.listGameServerClusters + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listGameServerClusters - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerClusters + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], 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', - } - ); + 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() @@ -1682,27 +1716,28 @@ describe('v1beta.GameServerClustersServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listGameServerClusters.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + 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[] = []; + 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], + ( + client.descriptors.page.listGameServerClusters + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listGameServerClusters - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerClusters + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1717,12 +1752,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { realm: 'realmValue', cluster: 'clusterValue', }; - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.gameServerClusterPathTemplate.render = sinon .stub() @@ -1740,8 +1776,10 @@ describe('v1beta.GameServerClustersServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -1751,8 +1789,10 @@ describe('v1beta.GameServerClustersServiceClient', () => { const result = client.matchProjectFromGameServerClusterName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1762,8 +1802,10 @@ describe('v1beta.GameServerClustersServiceClient', () => { const result = client.matchLocationFromGameServerClusterName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1773,8 +1815,10 @@ describe('v1beta.GameServerClustersServiceClient', () => { const result = client.matchRealmFromGameServerClusterName(fakePath); assert.strictEqual(result, 'realmValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1784,8 +1828,10 @@ describe('v1beta.GameServerClustersServiceClient', () => { const result = client.matchClusterFromGameServerClusterName(fakePath); assert.strictEqual(result, 'clusterValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1800,12 +1846,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { deployment: 'deploymentValue', config: 'configValue', }; - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.gameServerConfigPathTemplate.render = sinon .stub() @@ -1823,8 +1870,10 @@ describe('v1beta.GameServerClustersServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -1878,12 +1927,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { location: 'locationValue', deployment: 'deploymentValue', }; - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.gameServerDeploymentPathTemplate.render = sinon .stub() @@ -1900,47 +1950,52 @@ describe('v1beta.GameServerClustersServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromGameServerDeploymentName', () => { - const result = client.matchProjectFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchProjectFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchLocationFromGameServerDeploymentName', () => { - const result = client.matchLocationFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchLocationFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchDeploymentFromGameServerDeploymentName', () => { - const result = client.matchDeploymentFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchDeploymentFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'deploymentValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1954,16 +2009,16 @@ describe('v1beta.GameServerClustersServiceClient', () => { location: 'locationValue', deployment: 'deploymentValue', }; - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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.render = + sinon.stub().returns(fakePath); client.pathTemplates.gameServerDeploymentRolloutPathTemplate.match = sinon .stub() .returns(expectedParameters); @@ -1976,47 +2031,52 @@ describe('v1beta.GameServerClustersServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromGameServerDeploymentRolloutName', () => { - const result = client.matchProjectFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchProjectFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchLocationFromGameServerDeploymentRolloutName', () => { - const result = client.matchLocationFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchLocationFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchDeploymentFromGameServerDeploymentRolloutName', () => { - const result = client.matchDeploymentFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchDeploymentFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'deploymentValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2030,12 +2090,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { location: 'locationValue', realm: 'realmValue', }; - const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.realmPathTemplate.render = sinon .stub() 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 index 090728f0dfd..179a1836da5 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + 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; @@ -168,49 +167,46 @@ describe('v1.GameServerConfigsServiceClient', () => { }); it('should create a client with no option', () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient(); + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient(); assert(client); }); it('should create a client with gRPC fallback', () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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( - { + 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', () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.close(); }); it('has getProjectId method', async () => { const fakeProjectId = 'fake-project-id'; - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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); @@ -219,12 +215,11 @@ describe('v1.GameServerConfigsServiceClient', () => { it('has getProjectId method with callback', async () => { const fakeProjectId = 'fake-project-id'; - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.auth.getProjectId = sinon .stub() .callsArgWith(0, null, fakeProjectId); @@ -243,12 +238,11 @@ describe('v1.GameServerConfigsServiceClient', () => { describe('getGameServerConfig', () => { it('invokes getGameServerConfig without error', async () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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() @@ -265,9 +259,8 @@ describe('v1.GameServerConfigsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerConfig() ); - client.innerApiCalls.getGameServerConfig = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getGameServerConfig = + stubSimpleCall(expectedResponse); const [response] = await client.getGameServerConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -278,12 +271,11 @@ describe('v1.GameServerConfigsServiceClient', () => { }); it('invokes getGameServerConfig without error using callback', async () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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() @@ -300,9 +292,8 @@ describe('v1.GameServerConfigsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerConfig() ); - client.innerApiCalls.getGameServerConfig = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getGameServerConfig = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getGameServerConfig( request, @@ -328,12 +319,11 @@ describe('v1.GameServerConfigsServiceClient', () => { }); it('invokes getGameServerConfig with error', async () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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() @@ -363,12 +353,11 @@ describe('v1.GameServerConfigsServiceClient', () => { describe('createGameServerConfig', () => { it('invokes createGameServerConfig without error', async () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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() @@ -385,9 +374,8 @@ describe('v1.GameServerConfigsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createGameServerConfig = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.createGameServerConfig = + stubLongRunningCall(expectedResponse); const [operation] = await client.createGameServerConfig(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -399,12 +387,11 @@ describe('v1.GameServerConfigsServiceClient', () => { }); it('invokes createGameServerConfig without error using callback', async () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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() @@ -421,9 +408,8 @@ describe('v1.GameServerConfigsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createGameServerConfig = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createGameServerConfig = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createGameServerConfig( request, @@ -456,12 +442,11 @@ describe('v1.GameServerConfigsServiceClient', () => { }); it('invokes createGameServerConfig with call error', async () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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() @@ -492,12 +477,11 @@ describe('v1.GameServerConfigsServiceClient', () => { }); it('invokes createGameServerConfig with LRO error', async () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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() @@ -527,12 +511,11 @@ describe('v1.GameServerConfigsServiceClient', () => { }); it('invokes checkCreateGameServerConfigProgress without error', async () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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() @@ -551,12 +534,11 @@ describe('v1.GameServerConfigsServiceClient', () => { }); it('invokes checkCreateGameServerConfigProgress with error', async () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const expectedError = new Error('expected'); @@ -574,12 +556,11 @@ describe('v1.GameServerConfigsServiceClient', () => { describe('deleteGameServerConfig', () => { it('invokes deleteGameServerConfig without error', async () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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() @@ -596,9 +577,8 @@ describe('v1.GameServerConfigsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteGameServerConfig = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.deleteGameServerConfig = + stubLongRunningCall(expectedResponse); const [operation] = await client.deleteGameServerConfig(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -610,12 +590,11 @@ describe('v1.GameServerConfigsServiceClient', () => { }); it('invokes deleteGameServerConfig without error using callback', async () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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() @@ -632,9 +611,8 @@ describe('v1.GameServerConfigsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteGameServerConfig = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteGameServerConfig = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteGameServerConfig( request, @@ -667,12 +645,11 @@ describe('v1.GameServerConfigsServiceClient', () => { }); it('invokes deleteGameServerConfig with call error', async () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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() @@ -703,12 +680,11 @@ describe('v1.GameServerConfigsServiceClient', () => { }); it('invokes deleteGameServerConfig with LRO error', async () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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() @@ -738,12 +714,11 @@ describe('v1.GameServerConfigsServiceClient', () => { }); it('invokes checkDeleteGameServerConfigProgress without error', async () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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() @@ -762,12 +737,11 @@ describe('v1.GameServerConfigsServiceClient', () => { }); it('invokes checkDeleteGameServerConfigProgress with error', async () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); const expectedError = new Error('expected'); @@ -785,12 +759,11 @@ describe('v1.GameServerConfigsServiceClient', () => { describe('listGameServerConfigs', () => { it('invokes listGameServerConfigs without error', async () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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() @@ -815,9 +788,8 @@ describe('v1.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1.GameServerConfig() ), ]; - client.innerApiCalls.listGameServerConfigs = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.listGameServerConfigs = + stubSimpleCall(expectedResponse); const [response] = await client.listGameServerConfigs(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -828,12 +800,11 @@ describe('v1.GameServerConfigsServiceClient', () => { }); it('invokes listGameServerConfigs without error using callback', async () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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() @@ -858,9 +829,8 @@ describe('v1.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1.GameServerConfig() ), ]; - client.innerApiCalls.listGameServerConfigs = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listGameServerConfigs = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listGameServerConfigs( request, @@ -886,12 +856,11 @@ describe('v1.GameServerConfigsServiceClient', () => { }); it('invokes listGameServerConfigs with error', async () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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() @@ -922,12 +891,11 @@ describe('v1.GameServerConfigsServiceClient', () => { }); it('invokes listGameServerConfigsStream without error', async () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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() @@ -945,9 +913,8 @@ describe('v1.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1.GameServerConfig() ), ]; - client.descriptors.page.listGameServerConfigs.createStream = stubPageStreamingCall( - expectedResponse - ); + 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[] = []; @@ -967,27 +934,28 @@ describe('v1.GameServerConfigsServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listGameServerConfigs - .createStream as SinonStub) + ( + client.descriptors.page.listGameServerConfigs + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listGameServerConfigs, request) ); assert.strictEqual( - (client.descriptors.page.listGameServerConfigs - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerConfigs + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('invokes listGameServerConfigsStream with error', async () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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() @@ -995,10 +963,8 @@ describe('v1.GameServerConfigsServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listGameServerConfigs.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + 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[] = []; @@ -1017,27 +983,28 @@ describe('v1.GameServerConfigsServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listGameServerConfigs - .createStream as SinonStub) + ( + client.descriptors.page.listGameServerConfigs + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listGameServerConfigs, request) ); assert.strictEqual( - (client.descriptors.page.listGameServerConfigs - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerConfigs + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('uses async iteration with listGameServerConfigs without error', async () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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() @@ -1055,9 +1022,8 @@ describe('v1.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1.GameServerConfig() ), ]; - client.descriptors.page.listGameServerConfigs.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + 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) { @@ -1065,26 +1031,27 @@ describe('v1.GameServerConfigsServiceClient', () => { } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listGameServerConfigs - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listGameServerConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listGameServerConfigs - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerConfigs + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('uses async iteration with listGameServerConfigs with error', async () => { - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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() @@ -1092,10 +1059,8 @@ describe('v1.GameServerConfigsServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listGameServerConfigs.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + 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[] = []; @@ -1104,15 +1069,17 @@ describe('v1.GameServerConfigsServiceClient', () => { } }); assert.deepStrictEqual( - (client.descriptors.page.listGameServerConfigs - .asyncIterate as SinonStub).getCall(0).args[1], + ( + client.descriptors.page.listGameServerConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listGameServerConfigs - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerConfigs + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1127,12 +1094,11 @@ describe('v1.GameServerConfigsServiceClient', () => { realm: 'realmValue', cluster: 'clusterValue', }; - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.gameServerClusterPathTemplate.render = sinon .stub() @@ -1150,8 +1116,10 @@ describe('v1.GameServerConfigsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -1161,8 +1129,10 @@ describe('v1.GameServerConfigsServiceClient', () => { const result = client.matchProjectFromGameServerClusterName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1172,8 +1142,10 @@ describe('v1.GameServerConfigsServiceClient', () => { const result = client.matchLocationFromGameServerClusterName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1183,8 +1155,10 @@ describe('v1.GameServerConfigsServiceClient', () => { const result = client.matchRealmFromGameServerClusterName(fakePath); assert.strictEqual(result, 'realmValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1194,8 +1168,10 @@ describe('v1.GameServerConfigsServiceClient', () => { const result = client.matchClusterFromGameServerClusterName(fakePath); assert.strictEqual(result, 'clusterValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1210,12 +1186,11 @@ describe('v1.GameServerConfigsServiceClient', () => { deployment: 'deploymentValue', config: 'configValue', }; - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.gameServerConfigPathTemplate.render = sinon .stub() @@ -1233,8 +1208,10 @@ describe('v1.GameServerConfigsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -1288,12 +1265,11 @@ describe('v1.GameServerConfigsServiceClient', () => { location: 'locationValue', deployment: 'deploymentValue', }; - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.gameServerDeploymentPathTemplate.render = sinon .stub() @@ -1310,47 +1286,52 @@ describe('v1.GameServerConfigsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromGameServerDeploymentName', () => { - const result = client.matchProjectFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchProjectFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchLocationFromGameServerDeploymentName', () => { - const result = client.matchLocationFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchLocationFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchDeploymentFromGameServerDeploymentName', () => { - const result = client.matchDeploymentFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchDeploymentFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'deploymentValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1364,16 +1345,14 @@ describe('v1.GameServerConfigsServiceClient', () => { location: 'locationValue', deployment: 'deploymentValue', }; - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + 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.render = + sinon.stub().returns(fakePath); client.pathTemplates.gameServerDeploymentRolloutPathTemplate.match = sinon .stub() .returns(expectedParameters); @@ -1386,47 +1365,52 @@ describe('v1.GameServerConfigsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromGameServerDeploymentRolloutName', () => { - const result = client.matchProjectFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchProjectFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchLocationFromGameServerDeploymentRolloutName', () => { - const result = client.matchLocationFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchLocationFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchDeploymentFromGameServerDeploymentRolloutName', () => { - const result = client.matchDeploymentFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchDeploymentFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'deploymentValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1440,12 +1424,11 @@ describe('v1.GameServerConfigsServiceClient', () => { location: 'locationValue', realm: 'realmValue', }; - const client = new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient( - { + const client = + new gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.initialize(); client.pathTemplates.realmPathTemplate.render = sinon .stub() 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 index 9c2260d8a62..02172636575 100644 --- 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 @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + 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; @@ -168,49 +167,46 @@ describe('v1beta.GameServerConfigsServiceClient', () => { }); it('should create a client with no option', () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient(); + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient(); assert(client); }); it('should create a client with gRPC fallback', () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { + 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( - { + 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', () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.close(); }); it('has getProjectId method', async () => { const fakeProjectId = 'fake-project-id'; - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { + 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); @@ -219,12 +215,11 @@ describe('v1beta.GameServerConfigsServiceClient', () => { it('has getProjectId method with callback', async () => { const fakeProjectId = 'fake-project-id'; - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', - } - ); + }); client.auth.getProjectId = sinon .stub() .callsArgWith(0, null, fakeProjectId); @@ -243,12 +238,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { describe('getGameServerConfig', () => { it('invokes getGameServerConfig without error', async () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -265,9 +261,8 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerConfig() ); - client.innerApiCalls.getGameServerConfig = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getGameServerConfig = + stubSimpleCall(expectedResponse); const [response] = await client.getGameServerConfig(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -278,12 +273,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { }); it('invokes getGameServerConfig without error using callback', async () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -300,9 +296,8 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerConfig() ); - client.innerApiCalls.getGameServerConfig = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getGameServerConfig = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getGameServerConfig( request, @@ -328,12 +323,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { }); it('invokes getGameServerConfig with error', async () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -363,12 +359,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { describe('createGameServerConfig', () => { it('invokes createGameServerConfig without error', async () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -385,9 +382,8 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createGameServerConfig = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.createGameServerConfig = + stubLongRunningCall(expectedResponse); const [operation] = await client.createGameServerConfig(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -399,12 +395,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { }); it('invokes createGameServerConfig without error using callback', async () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -421,9 +418,8 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createGameServerConfig = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createGameServerConfig = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createGameServerConfig( request, @@ -456,12 +452,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { }); it('invokes createGameServerConfig with call error', async () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -492,12 +489,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { }); it('invokes createGameServerConfig with LRO error', async () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -527,12 +525,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { }); it('invokes checkCreateGameServerConfigProgress without error', async () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -551,12 +550,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { }); it('invokes checkCreateGameServerConfigProgress with error', async () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const expectedError = new Error('expected'); @@ -574,12 +574,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { describe('deleteGameServerConfig', () => { it('invokes deleteGameServerConfig without error', async () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -596,9 +597,8 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteGameServerConfig = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.deleteGameServerConfig = + stubLongRunningCall(expectedResponse); const [operation] = await client.deleteGameServerConfig(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -610,12 +610,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { }); it('invokes deleteGameServerConfig without error using callback', async () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -632,9 +633,8 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteGameServerConfig = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteGameServerConfig = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteGameServerConfig( request, @@ -667,12 +667,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { }); it('invokes deleteGameServerConfig with call error', async () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -703,12 +704,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { }); it('invokes deleteGameServerConfig with LRO error', async () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -738,12 +740,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { }); it('invokes checkDeleteGameServerConfigProgress without error', async () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -762,12 +765,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { }); it('invokes checkDeleteGameServerConfigProgress with error', async () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const expectedError = new Error('expected'); @@ -785,12 +789,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { describe('listGameServerConfigs', () => { it('invokes listGameServerConfigs without error', async () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -815,9 +820,8 @@ describe('v1beta.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1beta.GameServerConfig() ), ]; - client.innerApiCalls.listGameServerConfigs = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.listGameServerConfigs = + stubSimpleCall(expectedResponse); const [response] = await client.listGameServerConfigs(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -828,12 +832,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { }); it('invokes listGameServerConfigs without error using callback', async () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -858,9 +863,8 @@ describe('v1beta.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1beta.GameServerConfig() ), ]; - client.innerApiCalls.listGameServerConfigs = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listGameServerConfigs = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listGameServerConfigs( request, @@ -888,12 +892,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { }); it('invokes listGameServerConfigs with error', async () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -924,12 +929,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { }); it('invokes listGameServerConfigsStream without error', async () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -947,12 +953,12 @@ describe('v1beta.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1beta.GameServerConfig() ), ]; - client.descriptors.page.listGameServerConfigs.createStream = stubPageStreamingCall( - expectedResponse - ); + 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[] = []; + const responses: protos.google.cloud.gaming.v1beta.GameServerConfig[] = + []; stream.on( 'data', (response: protos.google.cloud.gaming.v1beta.GameServerConfig) => { @@ -969,27 +975,30 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listGameServerConfigs - .createStream as SinonStub) + ( + client.descriptors.page.listGameServerConfigs + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listGameServerConfigs, request) ); assert.strictEqual( - (client.descriptors.page.listGameServerConfigs - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerConfigs + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('invokes listGameServerConfigsStream with error', async () => { - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -997,13 +1006,12 @@ describe('v1beta.GameServerConfigsServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listGameServerConfigs.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + 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[] = []; + const responses: protos.google.cloud.gaming.v1beta.GameServerConfig[] = + []; stream.on( 'data', (response: protos.google.cloud.gaming.v1beta.GameServerConfig) => { @@ -1019,27 +1027,30 @@ describe('v1beta.GameServerConfigsServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listGameServerConfigs - .createStream as SinonStub) + ( + client.descriptors.page.listGameServerConfigs + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listGameServerConfigs, request) ); assert.strictEqual( - (client.descriptors.page.listGameServerConfigs - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerConfigs + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], 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', - } - ); + 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() @@ -1057,36 +1068,39 @@ describe('v1beta.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1beta.GameServerConfig() ), ]; - client.descriptors.page.listGameServerConfigs.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.gaming.v1beta.IGameServerConfig[] = []; + 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], + ( + client.descriptors.page.listGameServerConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listGameServerConfigs - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerConfigs + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], 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', - } - ); + 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() @@ -1094,27 +1108,28 @@ describe('v1beta.GameServerConfigsServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listGameServerConfigs.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + 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[] = []; + 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], + ( + client.descriptors.page.listGameServerConfigs + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listGameServerConfigs - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerConfigs + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1129,12 +1144,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { realm: 'realmValue', cluster: 'clusterValue', }; - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.gameServerClusterPathTemplate.render = sinon .stub() @@ -1152,8 +1168,10 @@ describe('v1beta.GameServerConfigsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -1163,8 +1181,10 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const result = client.matchProjectFromGameServerClusterName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1174,8 +1194,10 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const result = client.matchLocationFromGameServerClusterName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1185,8 +1207,10 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const result = client.matchRealmFromGameServerClusterName(fakePath); assert.strictEqual(result, 'realmValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1196,8 +1220,10 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const result = client.matchClusterFromGameServerClusterName(fakePath); assert.strictEqual(result, 'clusterValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1212,12 +1238,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { deployment: 'deploymentValue', config: 'configValue', }; - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.gameServerConfigPathTemplate.render = sinon .stub() @@ -1235,8 +1262,10 @@ describe('v1beta.GameServerConfigsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -1290,12 +1319,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { location: 'locationValue', deployment: 'deploymentValue', }; - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.gameServerDeploymentPathTemplate.render = sinon .stub() @@ -1312,47 +1342,52 @@ describe('v1beta.GameServerConfigsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromGameServerDeploymentName', () => { - const result = client.matchProjectFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchProjectFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchLocationFromGameServerDeploymentName', () => { - const result = client.matchLocationFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchLocationFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchDeploymentFromGameServerDeploymentName', () => { - const result = client.matchDeploymentFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchDeploymentFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'deploymentValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1366,16 +1401,16 @@ describe('v1beta.GameServerConfigsServiceClient', () => { location: 'locationValue', deployment: 'deploymentValue', }; - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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.render = + sinon.stub().returns(fakePath); client.pathTemplates.gameServerDeploymentRolloutPathTemplate.match = sinon .stub() .returns(expectedParameters); @@ -1388,47 +1423,52 @@ describe('v1beta.GameServerConfigsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromGameServerDeploymentRolloutName', () => { - const result = client.matchProjectFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchProjectFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchLocationFromGameServerDeploymentRolloutName', () => { - const result = client.matchLocationFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchLocationFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchDeploymentFromGameServerDeploymentRolloutName', () => { - const result = client.matchDeploymentFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchDeploymentFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'deploymentValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1442,12 +1482,13 @@ describe('v1beta.GameServerConfigsServiceClient', () => { location: 'locationValue', realm: 'realmValue', }; - const client = new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.realmPathTemplate.render = sinon .stub() 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 index b61109c3136..6798bbe5872 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + 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; @@ -169,49 +168,54 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('should create a client with no option', () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient(); + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient(); assert(client); }); it('should create a client with gRPC fallback', () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - fallback: true, - } - ); + 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', - } - ); + 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', () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.close(); }); 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', - } - ); + 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); @@ -220,12 +224,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { 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', - } - ); + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.auth.getProjectId = sinon .stub() .callsArgWith(0, null, fakeProjectId); @@ -244,12 +249,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { describe('getGameServerDeployment', () => { it('invokes getGameServerDeployment without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -266,9 +272,8 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerDeployment() ); - client.innerApiCalls.getGameServerDeployment = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getGameServerDeployment = + stubSimpleCall(expectedResponse); const [response] = await client.getGameServerDeployment(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -279,12 +284,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes getGameServerDeployment without error using callback', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -301,9 +307,8 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerDeployment() ); - client.innerApiCalls.getGameServerDeployment = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getGameServerDeployment = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getGameServerDeployment( request, @@ -329,12 +334,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes getGameServerDeployment with error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -367,12 +373,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { describe('getGameServerDeploymentRollout', () => { it('invokes getGameServerDeploymentRollout without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -389,9 +396,8 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerDeploymentRollout() ); - client.innerApiCalls.getGameServerDeploymentRollout = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getGameServerDeploymentRollout = + stubSimpleCall(expectedResponse); const [response] = await client.getGameServerDeploymentRollout(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -402,12 +408,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes getGameServerDeploymentRollout without error using callback', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -424,9 +431,8 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerDeploymentRollout() ); - client.innerApiCalls.getGameServerDeploymentRollout = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getGameServerDeploymentRollout = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getGameServerDeploymentRollout( request, @@ -452,12 +458,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes getGameServerDeploymentRollout with error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -490,12 +497,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { describe('previewGameServerDeploymentRollout', () => { it('invokes previewGameServerDeploymentRollout without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -513,9 +521,8 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse() ); - client.innerApiCalls.previewGameServerDeploymentRollout = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.previewGameServerDeploymentRollout = + stubSimpleCall(expectedResponse); const [response] = await client.previewGameServerDeploymentRollout( request ); @@ -528,12 +535,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes previewGameServerDeploymentRollout without error using callback', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -551,9 +559,8 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse() ); - client.innerApiCalls.previewGameServerDeploymentRollout = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.previewGameServerDeploymentRollout = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.previewGameServerDeploymentRollout( request, @@ -579,12 +586,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes previewGameServerDeploymentRollout with error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -618,12 +626,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { describe('fetchDeploymentState', () => { it('invokes fetchDeploymentState without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -640,9 +649,8 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.FetchDeploymentStateResponse() ); - client.innerApiCalls.fetchDeploymentState = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.fetchDeploymentState = + stubSimpleCall(expectedResponse); const [response] = await client.fetchDeploymentState(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -653,12 +661,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes fetchDeploymentState without error using callback', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -675,9 +684,8 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.FetchDeploymentStateResponse() ); - client.innerApiCalls.fetchDeploymentState = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.fetchDeploymentState = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.fetchDeploymentState( request, @@ -703,12 +711,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes fetchDeploymentState with error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -738,12 +747,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { describe('createGameServerDeployment', () => { it('invokes createGameServerDeployment without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -760,9 +770,8 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createGameServerDeployment = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.createGameServerDeployment = + stubLongRunningCall(expectedResponse); const [operation] = await client.createGameServerDeployment(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -774,12 +783,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes createGameServerDeployment without error using callback', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -796,9 +806,8 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createGameServerDeployment = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createGameServerDeployment = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createGameServerDeployment( request, @@ -831,12 +840,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes createGameServerDeployment with call error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -867,12 +877,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes createGameServerDeployment with LRO error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -902,12 +913,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes checkCreateGameServerDeploymentProgress without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -917,21 +929,23 @@ describe('v1.GameServerDeploymentsServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateGameServerDeploymentProgress( - expectedResponse.name - ); + 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', - } - ); + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const expectedError = new Error('expected'); @@ -949,12 +963,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { describe('deleteGameServerDeployment', () => { it('invokes deleteGameServerDeployment without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -971,9 +986,8 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteGameServerDeployment = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.deleteGameServerDeployment = + stubLongRunningCall(expectedResponse); const [operation] = await client.deleteGameServerDeployment(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -985,12 +999,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes deleteGameServerDeployment without error using callback', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1007,9 +1022,8 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteGameServerDeployment = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteGameServerDeployment = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteGameServerDeployment( request, @@ -1042,12 +1056,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes deleteGameServerDeployment with call error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1078,12 +1093,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes deleteGameServerDeployment with LRO error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1113,12 +1129,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes checkDeleteGameServerDeploymentProgress without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1128,21 +1145,23 @@ describe('v1.GameServerDeploymentsServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteGameServerDeploymentProgress( - expectedResponse.name - ); + 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', - } - ); + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const expectedError = new Error('expected'); @@ -1160,12 +1179,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { describe('updateGameServerDeployment', () => { it('invokes updateGameServerDeployment without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1183,9 +1203,8 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateGameServerDeployment = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.updateGameServerDeployment = + stubLongRunningCall(expectedResponse); const [operation] = await client.updateGameServerDeployment(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -1197,12 +1216,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes updateGameServerDeployment without error using callback', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1220,9 +1240,8 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateGameServerDeployment = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateGameServerDeployment = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateGameServerDeployment( request, @@ -1255,12 +1274,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes updateGameServerDeployment with call error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1292,12 +1312,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes updateGameServerDeployment with LRO error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1328,12 +1349,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes checkUpdateGameServerDeploymentProgress without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1343,21 +1365,23 @@ describe('v1.GameServerDeploymentsServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateGameServerDeploymentProgress( - expectedResponse.name - ); + 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', - } - ); + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const expectedError = new Error('expected'); @@ -1375,12 +1399,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { describe('updateGameServerDeploymentRollout', () => { it('invokes updateGameServerDeploymentRollout without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1398,9 +1423,8 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateGameServerDeploymentRollout = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.updateGameServerDeploymentRollout = + stubLongRunningCall(expectedResponse); const [operation] = await client.updateGameServerDeploymentRollout( request ); @@ -1414,12 +1438,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes updateGameServerDeploymentRollout without error using callback', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1437,9 +1462,8 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateGameServerDeploymentRollout = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateGameServerDeploymentRollout = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateGameServerDeploymentRollout( request, @@ -1472,12 +1496,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes updateGameServerDeploymentRollout with call error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1493,10 +1518,8 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.updateGameServerDeploymentRollout = stubLongRunningCall( - undefined, - expectedError - ); + client.innerApiCalls.updateGameServerDeploymentRollout = + stubLongRunningCall(undefined, expectedError); await assert.rejects( client.updateGameServerDeploymentRollout(request), expectedError @@ -1509,12 +1532,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes updateGameServerDeploymentRollout with LRO error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1530,11 +1554,8 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.updateGameServerDeploymentRollout = stubLongRunningCall( - undefined, - undefined, - expectedError - ); + client.innerApiCalls.updateGameServerDeploymentRollout = + stubLongRunningCall(undefined, undefined, expectedError); const [operation] = await client.updateGameServerDeploymentRollout( request ); @@ -1547,12 +1568,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes checkUpdateGameServerDeploymentRolloutProgress without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1562,21 +1584,23 @@ describe('v1.GameServerDeploymentsServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateGameServerDeploymentRolloutProgress( - expectedResponse.name - ); + 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', - } - ); + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const expectedError = new Error('expected'); @@ -1594,12 +1618,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { describe('listGameServerDeployments', () => { it('invokes listGameServerDeployments without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1624,9 +1649,8 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.GameServerDeployment() ), ]; - client.innerApiCalls.listGameServerDeployments = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.listGameServerDeployments = + stubSimpleCall(expectedResponse); const [response] = await client.listGameServerDeployments(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1637,12 +1661,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes listGameServerDeployments without error using callback', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1667,9 +1692,8 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.GameServerDeployment() ), ]; - client.innerApiCalls.listGameServerDeployments = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listGameServerDeployments = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listGameServerDeployments( request, @@ -1697,12 +1721,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes listGameServerDeployments with error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1733,12 +1758,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); it('invokes listGameServerDeploymentsStream without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1756,12 +1782,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.GameServerDeployment() ), ]; - client.descriptors.page.listGameServerDeployments.createStream = stubPageStreamingCall( - expectedResponse - ); + 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[] = []; + const responses: protos.google.cloud.gaming.v1.GameServerDeployment[] = + []; stream.on( 'data', (response: protos.google.cloud.gaming.v1.GameServerDeployment) => { @@ -1778,27 +1804,30 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listGameServerDeployments - .createStream as SinonStub) + ( + client.descriptors.page.listGameServerDeployments + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listGameServerDeployments, request) ); assert.strictEqual( - (client.descriptors.page.listGameServerDeployments - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerDeployments + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('invokes listGameServerDeploymentsStream with error', async () => { - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1806,13 +1835,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listGameServerDeployments.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + 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[] = []; + const responses: protos.google.cloud.gaming.v1.GameServerDeployment[] = + []; stream.on( 'data', (response: protos.google.cloud.gaming.v1.GameServerDeployment) => { @@ -1828,27 +1856,30 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listGameServerDeployments - .createStream as SinonStub) + ( + client.descriptors.page.listGameServerDeployments + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listGameServerDeployments, request) ); assert.strictEqual( - (client.descriptors.page.listGameServerDeployments - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerDeployments + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], 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', - } - ); + 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() @@ -1866,36 +1897,39 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.GameServerDeployment() ), ]; - client.descriptors.page.listGameServerDeployments.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.gaming.v1.IGameServerDeployment[] = []; + 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], + ( + client.descriptors.page.listGameServerDeployments + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listGameServerDeployments - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerDeployments + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], 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', - } - ); + 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() @@ -1903,27 +1937,28 @@ describe('v1.GameServerDeploymentsServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listGameServerDeployments.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + 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[] = []; + 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], + ( + client.descriptors.page.listGameServerDeployments + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listGameServerDeployments - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerDeployments + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1938,12 +1973,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { realm: 'realmValue', cluster: 'clusterValue', }; - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.gameServerClusterPathTemplate.render = sinon .stub() @@ -1961,8 +1997,10 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -1972,8 +2010,10 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const result = client.matchProjectFromGameServerClusterName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1983,8 +2023,10 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const result = client.matchLocationFromGameServerClusterName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1994,8 +2036,10 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const result = client.matchRealmFromGameServerClusterName(fakePath); assert.strictEqual(result, 'realmValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2005,8 +2049,10 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const result = client.matchClusterFromGameServerClusterName(fakePath); assert.strictEqual(result, 'clusterValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2021,12 +2067,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { deployment: 'deploymentValue', config: 'configValue', }; - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.gameServerConfigPathTemplate.render = sinon .stub() @@ -2044,8 +2091,10 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -2099,12 +2148,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { location: 'locationValue', deployment: 'deploymentValue', }; - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.gameServerDeploymentPathTemplate.render = sinon .stub() @@ -2121,47 +2171,52 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromGameServerDeploymentName', () => { - const result = client.matchProjectFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchProjectFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchLocationFromGameServerDeploymentName', () => { - const result = client.matchLocationFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchLocationFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchDeploymentFromGameServerDeploymentName', () => { - const result = client.matchDeploymentFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchDeploymentFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'deploymentValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2175,16 +2230,16 @@ describe('v1.GameServerDeploymentsServiceClient', () => { location: 'locationValue', deployment: 'deploymentValue', }; - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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.render = + sinon.stub().returns(fakePath); client.pathTemplates.gameServerDeploymentRolloutPathTemplate.match = sinon .stub() .returns(expectedParameters); @@ -2197,47 +2252,52 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromGameServerDeploymentRolloutName', () => { - const result = client.matchProjectFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchProjectFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchLocationFromGameServerDeploymentRolloutName', () => { - const result = client.matchLocationFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchLocationFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchDeploymentFromGameServerDeploymentRolloutName', () => { - const result = client.matchDeploymentFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchDeploymentFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'deploymentValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2251,12 +2311,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { location: 'locationValue', realm: 'realmValue', }; - const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.realmPathTemplate.render = sinon .stub() 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 index ed7d6f3550b..cee5b2ccc0d 100644 --- 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 @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + 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; @@ -169,49 +168,54 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('should create a client with no option', () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient(); + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient(); assert(client); }); it('should create a client with gRPC fallback', () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - fallback: true, - } - ); + 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', - } - ); + 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', () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.close(); }); 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', - } - ); + 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); @@ -220,12 +224,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { 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', - } - ); + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.auth.getProjectId = sinon .stub() .callsArgWith(0, null, fakeProjectId); @@ -244,12 +249,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { describe('getGameServerDeployment', () => { it('invokes getGameServerDeployment without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -266,9 +272,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerDeployment() ); - client.innerApiCalls.getGameServerDeployment = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getGameServerDeployment = + stubSimpleCall(expectedResponse); const [response] = await client.getGameServerDeployment(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -279,12 +284,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes getGameServerDeployment without error using callback', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -301,9 +307,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerDeployment() ); - client.innerApiCalls.getGameServerDeployment = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getGameServerDeployment = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getGameServerDeployment( request, @@ -329,12 +334,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes getGameServerDeployment with error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -367,12 +373,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { describe('getGameServerDeploymentRollout', () => { it('invokes getGameServerDeploymentRollout without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -389,9 +396,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerDeploymentRollout() ); - client.innerApiCalls.getGameServerDeploymentRollout = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.getGameServerDeploymentRollout = + stubSimpleCall(expectedResponse); const [response] = await client.getGameServerDeploymentRollout(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -402,12 +408,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes getGameServerDeploymentRollout without error using callback', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -424,9 +431,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerDeploymentRollout() ); - client.innerApiCalls.getGameServerDeploymentRollout = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getGameServerDeploymentRollout = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getGameServerDeploymentRollout( request, @@ -452,12 +458,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes getGameServerDeploymentRollout with error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -490,12 +497,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { describe('previewGameServerDeploymentRollout', () => { it('invokes previewGameServerDeploymentRollout without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -513,9 +521,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse() ); - client.innerApiCalls.previewGameServerDeploymentRollout = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.previewGameServerDeploymentRollout = + stubSimpleCall(expectedResponse); const [response] = await client.previewGameServerDeploymentRollout( request ); @@ -528,12 +535,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes previewGameServerDeploymentRollout without error using callback', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -551,9 +559,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse() ); - client.innerApiCalls.previewGameServerDeploymentRollout = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.previewGameServerDeploymentRollout = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.previewGameServerDeploymentRollout( request, @@ -579,12 +586,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes previewGameServerDeploymentRollout with error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -618,12 +626,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { describe('fetchDeploymentState', () => { it('invokes fetchDeploymentState without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -640,9 +649,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.FetchDeploymentStateResponse() ); - client.innerApiCalls.fetchDeploymentState = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.fetchDeploymentState = + stubSimpleCall(expectedResponse); const [response] = await client.fetchDeploymentState(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -653,12 +661,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes fetchDeploymentState without error using callback', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -675,9 +684,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.FetchDeploymentStateResponse() ); - client.innerApiCalls.fetchDeploymentState = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.fetchDeploymentState = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.fetchDeploymentState( request, @@ -703,12 +711,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes fetchDeploymentState with error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -738,12 +747,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { describe('createGameServerDeployment', () => { it('invokes createGameServerDeployment without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -760,9 +770,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createGameServerDeployment = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.createGameServerDeployment = + stubLongRunningCall(expectedResponse); const [operation] = await client.createGameServerDeployment(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -774,12 +783,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes createGameServerDeployment without error using callback', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -796,9 +806,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createGameServerDeployment = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createGameServerDeployment = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createGameServerDeployment( request, @@ -831,12 +840,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes createGameServerDeployment with call error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -867,12 +877,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes createGameServerDeployment with LRO error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -902,12 +913,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes checkCreateGameServerDeploymentProgress without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -917,21 +929,23 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateGameServerDeploymentProgress( - expectedResponse.name - ); + 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', - } - ); + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const expectedError = new Error('expected'); @@ -949,12 +963,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { describe('deleteGameServerDeployment', () => { it('invokes deleteGameServerDeployment without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -971,9 +986,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteGameServerDeployment = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.deleteGameServerDeployment = + stubLongRunningCall(expectedResponse); const [operation] = await client.deleteGameServerDeployment(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -985,12 +999,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes deleteGameServerDeployment without error using callback', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1007,9 +1022,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteGameServerDeployment = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteGameServerDeployment = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteGameServerDeployment( request, @@ -1042,12 +1056,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes deleteGameServerDeployment with call error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1078,12 +1093,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes deleteGameServerDeployment with LRO error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1113,12 +1129,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes checkDeleteGameServerDeploymentProgress without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1128,21 +1145,23 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteGameServerDeploymentProgress( - expectedResponse.name - ); + 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', - } - ); + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const expectedError = new Error('expected'); @@ -1160,12 +1179,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { describe('updateGameServerDeployment', () => { it('invokes updateGameServerDeployment without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1183,9 +1203,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateGameServerDeployment = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.updateGameServerDeployment = + stubLongRunningCall(expectedResponse); const [operation] = await client.updateGameServerDeployment(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); @@ -1197,12 +1216,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes updateGameServerDeployment without error using callback', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1220,9 +1240,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateGameServerDeployment = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateGameServerDeployment = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateGameServerDeployment( request, @@ -1255,12 +1274,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes updateGameServerDeployment with call error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1292,12 +1312,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes updateGameServerDeployment with LRO error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1328,12 +1349,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes checkUpdateGameServerDeploymentProgress without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1343,21 +1365,23 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateGameServerDeploymentProgress( - expectedResponse.name - ); + 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', - } - ); + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const expectedError = new Error('expected'); @@ -1375,12 +1399,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { describe('updateGameServerDeploymentRollout', () => { it('invokes updateGameServerDeploymentRollout without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1398,9 +1423,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateGameServerDeploymentRollout = stubLongRunningCall( - expectedResponse - ); + client.innerApiCalls.updateGameServerDeploymentRollout = + stubLongRunningCall(expectedResponse); const [operation] = await client.updateGameServerDeploymentRollout( request ); @@ -1414,12 +1438,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes updateGameServerDeploymentRollout without error using callback', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1437,9 +1462,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateGameServerDeploymentRollout = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateGameServerDeploymentRollout = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateGameServerDeploymentRollout( request, @@ -1472,12 +1496,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes updateGameServerDeploymentRollout with call error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1493,10 +1518,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.updateGameServerDeploymentRollout = stubLongRunningCall( - undefined, - expectedError - ); + client.innerApiCalls.updateGameServerDeploymentRollout = + stubLongRunningCall(undefined, expectedError); await assert.rejects( client.updateGameServerDeploymentRollout(request), expectedError @@ -1509,12 +1532,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes updateGameServerDeploymentRollout with LRO error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1530,11 +1554,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }, }; const expectedError = new Error('expected'); - client.innerApiCalls.updateGameServerDeploymentRollout = stubLongRunningCall( - undefined, - undefined, - expectedError - ); + client.innerApiCalls.updateGameServerDeploymentRollout = + stubLongRunningCall(undefined, undefined, expectedError); const [operation] = await client.updateGameServerDeploymentRollout( request ); @@ -1547,12 +1568,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes checkUpdateGameServerDeploymentRolloutProgress without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1562,21 +1584,23 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateGameServerDeploymentRolloutProgress( - expectedResponse.name - ); + 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', - } - ); + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); const expectedError = new Error('expected'); @@ -1594,12 +1618,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { describe('listGameServerDeployments', () => { it('invokes listGameServerDeployments without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1624,9 +1649,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.GameServerDeployment() ), ]; - client.innerApiCalls.listGameServerDeployments = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.listGameServerDeployments = + stubSimpleCall(expectedResponse); const [response] = await client.listGameServerDeployments(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -1637,12 +1661,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes listGameServerDeployments without error using callback', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1667,9 +1692,8 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.GameServerDeployment() ), ]; - client.innerApiCalls.listGameServerDeployments = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listGameServerDeployments = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listGameServerDeployments( request, @@ -1697,12 +1721,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes listGameServerDeployments with error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1733,12 +1758,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); it('invokes listGameServerDeploymentsStream without error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1756,12 +1782,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.GameServerDeployment() ), ]; - client.descriptors.page.listGameServerDeployments.createStream = stubPageStreamingCall( - expectedResponse - ); + 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[] = []; + const responses: protos.google.cloud.gaming.v1beta.GameServerDeployment[] = + []; stream.on( 'data', ( @@ -1780,27 +1806,30 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listGameServerDeployments - .createStream as SinonStub) + ( + client.descriptors.page.listGameServerDeployments + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listGameServerDeployments, request) ); assert.strictEqual( - (client.descriptors.page.listGameServerDeployments - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerDeployments + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); it('invokes listGameServerDeploymentsStream with error', async () => { - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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() @@ -1808,13 +1837,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listGameServerDeployments.createStream = stubPageStreamingCall( - undefined, - expectedError - ); + 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[] = []; + const responses: protos.google.cloud.gaming.v1beta.GameServerDeployment[] = + []; stream.on( 'data', ( @@ -1832,27 +1860,30 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listGameServerDeployments - .createStream as SinonStub) + ( + client.descriptors.page.listGameServerDeployments + .createStream as SinonStub + ) .getCall(0) .calledWith(client.innerApiCalls.listGameServerDeployments, request) ); assert.strictEqual( - (client.descriptors.page.listGameServerDeployments - .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerDeployments + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], 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', - } - ); + 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() @@ -1870,36 +1901,39 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.GameServerDeployment() ), ]; - client.descriptors.page.listGameServerDeployments.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); - const responses: protos.google.cloud.gaming.v1beta.IGameServerDeployment[] = []; + 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], + ( + client.descriptors.page.listGameServerDeployments + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listGameServerDeployments - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerDeployments + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], 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', - } - ); + 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() @@ -1907,27 +1941,28 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { request.parent = ''; const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('expected'); - client.descriptors.page.listGameServerDeployments.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); + 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[] = []; + 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], + ( + client.descriptors.page.listGameServerDeployments + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert.strictEqual( - (client.descriptors.page.listGameServerDeployments - .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ - 'x-goog-request-params' - ], + ( + client.descriptors.page.listGameServerDeployments + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], expectedHeaderRequestParams ); }); @@ -1942,12 +1977,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { realm: 'realmValue', cluster: 'clusterValue', }; - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.gameServerClusterPathTemplate.render = sinon .stub() @@ -1965,8 +2001,10 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -1976,8 +2014,10 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const result = client.matchProjectFromGameServerClusterName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1987,8 +2027,10 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const result = client.matchLocationFromGameServerClusterName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1998,8 +2040,10 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const result = client.matchRealmFromGameServerClusterName(fakePath); assert.strictEqual(result, 'realmValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2009,8 +2053,10 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const result = client.matchClusterFromGameServerClusterName(fakePath); assert.strictEqual(result, 'clusterValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2025,12 +2071,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { deployment: 'deploymentValue', config: 'configValue', }; - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.gameServerConfigPathTemplate.render = sinon .stub() @@ -2048,8 +2095,10 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -2103,12 +2152,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { location: 'locationValue', deployment: 'deploymentValue', }; - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.gameServerDeploymentPathTemplate.render = sinon .stub() @@ -2125,47 +2175,52 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromGameServerDeploymentName', () => { - const result = client.matchProjectFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchProjectFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchLocationFromGameServerDeploymentName', () => { - const result = client.matchLocationFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchLocationFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchDeploymentFromGameServerDeploymentName', () => { - const result = client.matchDeploymentFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchDeploymentFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'deploymentValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2179,16 +2234,16 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { location: 'locationValue', deployment: 'deploymentValue', }; - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + 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.render = + sinon.stub().returns(fakePath); client.pathTemplates.gameServerDeploymentRolloutPathTemplate.match = sinon .stub() .returns(expectedParameters); @@ -2201,47 +2256,52 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromGameServerDeploymentRolloutName', () => { - const result = client.matchProjectFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchProjectFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchLocationFromGameServerDeploymentRolloutName', () => { - const result = client.matchLocationFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchLocationFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchDeploymentFromGameServerDeploymentRolloutName', () => { - const result = client.matchDeploymentFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchDeploymentFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'deploymentValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -2255,12 +2315,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { location: 'locationValue', realm: 'realmValue', }; - const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( - { - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - } - ); + const client = + new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); client.initialize(); client.pathTemplates.realmPathTemplate.render = sinon .stub() diff --git a/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts b/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts index 868b90b09d1..12c02763ee7 100644 --- a/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + 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; @@ -279,9 +278,8 @@ describe('v1.RealmsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.Realm() ); - client.innerApiCalls.getRealm = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getRealm = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getRealm( request, @@ -358,9 +356,8 @@ describe('v1.RealmsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewRealmUpdateResponse() ); - client.innerApiCalls.previewRealmUpdate = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.previewRealmUpdate = + stubSimpleCall(expectedResponse); const [response] = await client.previewRealmUpdate(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -392,9 +389,8 @@ describe('v1.RealmsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewRealmUpdateResponse() ); - client.innerApiCalls.previewRealmUpdate = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.previewRealmUpdate = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.previewRealmUpdate( request, @@ -506,9 +502,8 @@ describe('v1.RealmsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createRealm = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createRealm = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createRealm( request, @@ -697,9 +692,8 @@ describe('v1.RealmsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteRealm = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteRealm = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteRealm( request, @@ -890,9 +884,8 @@ describe('v1.RealmsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateRealm = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateRealm = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateRealm( request, @@ -1086,9 +1079,8 @@ describe('v1.RealmsServiceClient', () => { generateSampleMessage(new protos.google.cloud.gaming.v1.Realm()), generateSampleMessage(new protos.google.cloud.gaming.v1.Realm()), ]; - client.innerApiCalls.listRealms = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listRealms = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listRealms( request, @@ -1160,9 +1152,8 @@ describe('v1.RealmsServiceClient', () => { generateSampleMessage(new protos.google.cloud.gaming.v1.Realm()), generateSampleMessage(new protos.google.cloud.gaming.v1.Realm()), ]; - client.descriptors.page.listRealms.createStream = stubPageStreamingCall( - expectedResponse - ); + 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[] = []; @@ -1250,9 +1241,8 @@ describe('v1.RealmsServiceClient', () => { generateSampleMessage(new protos.google.cloud.gaming.v1.Realm()), generateSampleMessage(new protos.google.cloud.gaming.v1.Realm()), ]; - client.descriptors.page.listRealms.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + 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) { @@ -1341,8 +1331,10 @@ describe('v1.RealmsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -1352,8 +1344,10 @@ describe('v1.RealmsServiceClient', () => { const result = client.matchProjectFromGameServerClusterName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1363,8 +1357,10 @@ describe('v1.RealmsServiceClient', () => { const result = client.matchLocationFromGameServerClusterName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1374,8 +1370,10 @@ describe('v1.RealmsServiceClient', () => { const result = client.matchRealmFromGameServerClusterName(fakePath); assert.strictEqual(result, 'realmValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1385,8 +1383,10 @@ describe('v1.RealmsServiceClient', () => { const result = client.matchClusterFromGameServerClusterName(fakePath); assert.strictEqual(result, 'clusterValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1422,8 +1422,10 @@ describe('v1.RealmsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -1497,47 +1499,52 @@ describe('v1.RealmsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromGameServerDeploymentName', () => { - const result = client.matchProjectFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchProjectFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchLocationFromGameServerDeploymentName', () => { - const result = client.matchLocationFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchLocationFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchDeploymentFromGameServerDeploymentName', () => { - const result = client.matchDeploymentFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchDeploymentFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'deploymentValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1556,9 +1563,8 @@ describe('v1.RealmsServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.gameServerDeploymentRolloutPathTemplate.render = sinon - .stub() - .returns(fakePath); + client.pathTemplates.gameServerDeploymentRolloutPathTemplate.render = + sinon.stub().returns(fakePath); client.pathTemplates.gameServerDeploymentRolloutPathTemplate.match = sinon .stub() .returns(expectedParameters); @@ -1571,47 +1577,52 @@ describe('v1.RealmsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromGameServerDeploymentRolloutName', () => { - const result = client.matchProjectFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchProjectFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchLocationFromGameServerDeploymentRolloutName', () => { - const result = client.matchLocationFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchLocationFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchDeploymentFromGameServerDeploymentRolloutName', () => { - const result = client.matchDeploymentFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchDeploymentFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'deploymentValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .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 index 211bf480b9f..d983b06edbc 100644 --- a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts @@ -28,10 +28,9 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message).toObject( - instance as protobuf.Message, - {defaults: true} - ); + 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; @@ -281,9 +280,8 @@ describe('v1beta.RealmsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.Realm() ); - client.innerApiCalls.getRealm = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.getRealm = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.getRealm( request, @@ -360,9 +358,8 @@ describe('v1beta.RealmsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewRealmUpdateResponse() ); - client.innerApiCalls.previewRealmUpdate = stubSimpleCall( - expectedResponse - ); + client.innerApiCalls.previewRealmUpdate = + stubSimpleCall(expectedResponse); const [response] = await client.previewRealmUpdate(request); assert.deepStrictEqual(response, expectedResponse); assert( @@ -394,9 +391,8 @@ describe('v1beta.RealmsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewRealmUpdateResponse() ); - client.innerApiCalls.previewRealmUpdate = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.previewRealmUpdate = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.previewRealmUpdate( request, @@ -508,9 +504,8 @@ describe('v1beta.RealmsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createRealm = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.createRealm = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.createRealm( request, @@ -699,9 +694,8 @@ describe('v1beta.RealmsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteRealm = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.deleteRealm = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.deleteRealm( request, @@ -892,9 +886,8 @@ describe('v1beta.RealmsServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateRealm = stubLongRunningCallWithCallback( - expectedResponse - ); + client.innerApiCalls.updateRealm = + stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.updateRealm( request, @@ -1088,9 +1081,8 @@ describe('v1beta.RealmsServiceClient', () => { generateSampleMessage(new protos.google.cloud.gaming.v1beta.Realm()), generateSampleMessage(new protos.google.cloud.gaming.v1beta.Realm()), ]; - client.innerApiCalls.listRealms = stubSimpleCallWithCallback( - expectedResponse - ); + client.innerApiCalls.listRealms = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { client.listRealms( request, @@ -1162,9 +1154,8 @@ describe('v1beta.RealmsServiceClient', () => { generateSampleMessage(new protos.google.cloud.gaming.v1beta.Realm()), generateSampleMessage(new protos.google.cloud.gaming.v1beta.Realm()), ]; - client.descriptors.page.listRealms.createStream = stubPageStreamingCall( - expectedResponse - ); + 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[] = []; @@ -1258,9 +1249,8 @@ describe('v1beta.RealmsServiceClient', () => { generateSampleMessage(new protos.google.cloud.gaming.v1beta.Realm()), generateSampleMessage(new protos.google.cloud.gaming.v1beta.Realm()), ]; - client.descriptors.page.listRealms.asyncIterate = stubAsyncIterationCall( - expectedResponse - ); + 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) { @@ -1349,8 +1339,10 @@ describe('v1beta.RealmsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -1360,8 +1352,10 @@ describe('v1beta.RealmsServiceClient', () => { const result = client.matchProjectFromGameServerClusterName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1371,8 +1365,10 @@ describe('v1beta.RealmsServiceClient', () => { const result = client.matchLocationFromGameServerClusterName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1382,8 +1378,10 @@ describe('v1beta.RealmsServiceClient', () => { const result = client.matchRealmFromGameServerClusterName(fakePath); assert.strictEqual(result, 'realmValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1393,8 +1391,10 @@ describe('v1beta.RealmsServiceClient', () => { const result = client.matchClusterFromGameServerClusterName(fakePath); assert.strictEqual(result, 'clusterValue'); assert( - (client.pathTemplates.gameServerClusterPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerClusterPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1430,8 +1430,10 @@ describe('v1beta.RealmsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerConfigPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerConfigPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); @@ -1505,47 +1507,52 @@ describe('v1beta.RealmsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromGameServerDeploymentName', () => { - const result = client.matchProjectFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchProjectFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchLocationFromGameServerDeploymentName', () => { - const result = client.matchLocationFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchLocationFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchDeploymentFromGameServerDeploymentName', () => { - const result = client.matchDeploymentFromGameServerDeploymentName( - fakePath - ); + const result = + client.matchDeploymentFromGameServerDeploymentName(fakePath); assert.strictEqual(result, 'deploymentValue'); assert( - (client.pathTemplates.gameServerDeploymentPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); @@ -1564,9 +1571,8 @@ describe('v1beta.RealmsServiceClient', () => { projectId: 'bogus', }); client.initialize(); - client.pathTemplates.gameServerDeploymentRolloutPathTemplate.render = sinon - .stub() - .returns(fakePath); + client.pathTemplates.gameServerDeploymentRolloutPathTemplate.render = + sinon.stub().returns(fakePath); client.pathTemplates.gameServerDeploymentRolloutPathTemplate.match = sinon .stub() .returns(expectedParameters); @@ -1579,47 +1585,52 @@ describe('v1beta.RealmsServiceClient', () => { ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .render as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .render as SinonStub + ) .getCall(-1) .calledWith(expectedParameters) ); }); it('matchProjectFromGameServerDeploymentRolloutName', () => { - const result = client.matchProjectFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchProjectFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchLocationFromGameServerDeploymentRolloutName', () => { - const result = client.matchLocationFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchLocationFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); }); it('matchDeploymentFromGameServerDeploymentRolloutName', () => { - const result = client.matchDeploymentFromGameServerDeploymentRolloutName( - fakePath - ); + const result = + client.matchDeploymentFromGameServerDeploymentRolloutName(fakePath); assert.strictEqual(result, 'deploymentValue'); assert( - (client.pathTemplates.gameServerDeploymentRolloutPathTemplate - .match as SinonStub) + ( + client.pathTemplates.gameServerDeploymentRolloutPathTemplate + .match as SinonStub + ) .getCall(-1) .calledWith(fakePath) ); From 44262c99b50535bd334d514967ef5ee19dd8a769 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Wed, 19 May 2021 13:19:16 -0600 Subject: [PATCH 101/180] build: ignore CODEOWNERS file temporarily to test auto-approve.yml (#168) * build: ignore CODEOWNERS file temporarily to test auto-approve.yml Co-authored-by: Owl Bot --- packages/google-cloud-gaming/owlbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/owlbot.py b/packages/google-cloud-gaming/owlbot.py index 3b58e346afc..5969c1654f4 100644 --- a/packages/google-cloud-gaming/owlbot.py +++ b/packages/google-cloud-gaming/owlbot.py @@ -14,4 +14,4 @@ """This script is used to synthesize generated parts of this library.""" import synthtool.languages.node as node -node.owlbot_main(staging_excludes=['package.json', 'README.md', 'CODEOWNERS']) +node.owlbot_main(staging_excludes=['package.json', 'README.md', '.github/CODEOWNERS']) From b85e3c633de54aef63a05ca96dbbe08b9bbbf2f2 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Wed, 19 May 2021 18:49:20 -0600 Subject: [PATCH 102/180] build: add auto-approve (#170) * build: add auto-approve Co-authored-by: Owl Bot --- packages/google-cloud-gaming/owlbot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/owlbot.py b/packages/google-cloud-gaming/owlbot.py index 5969c1654f4..0c22665a217 100644 --- a/packages/google-cloud-gaming/owlbot.py +++ b/packages/google-cloud-gaming/owlbot.py @@ -14,4 +14,5 @@ """This script is used to synthesize generated parts of this library.""" import synthtool.languages.node as node -node.owlbot_main(staging_excludes=['package.json', 'README.md', '.github/CODEOWNERS']) +node.owlbot_main(staging_excludes=['package.json', 'README.md'], templates_excludes=['.github/CODEOWNERS']) + From 233491eb24c40909097d2311cb93dec02a791663 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 20 May 2021 00:56:04 +0000 Subject: [PATCH 103/180] chore: release 2.3.1 (#163) :robot: I have created a release \*beep\* \*boop\* --- ### [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)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-gaming/CHANGELOG.md | 7 +++++++ packages/google-cloud-gaming/package.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index 6c2ac39e3cd..d959dd213b9 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index bd600921c19..87ff60c0c65 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "2.3.0", + "version": "2.3.1", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index 39fa4d80239..b120a2ad559 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^2.3.0" + "@google-cloud/game-servers": "^2.3.1" }, "devDependencies": { "c8": "^7.2.1", From 92e6f54851fd8e29e6b609fad0eaca82709a7631 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 21 May 2021 19:06:26 +0200 Subject: [PATCH 104/180] chore(deps): update dependency @types/node to v14 (#172) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^12.0.0` -> `^14.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/12.20.13/14.17.0) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/compatibility-slim/12.20.13)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/14.17.0/confidence-slim/12.20.13)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻️ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 87ff60c0c65..3710e0a37e2 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -33,7 +33,7 @@ }, "devDependencies": { "@types/mocha": "^8.0.0", - "@types/node": "^12.0.0", + "@types/node": "^14.0.0", "@types/sinon": "^10.0.0", "c8": "^7.0.0", "gts": "^2.0.0", From 98c900bb0ff3f42699b4b331f795ff2c71aabb00 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Mon, 24 May 2021 16:04:03 -0700 Subject: [PATCH 105/180] fix: use require() to load JSON protos (#164) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/73a79139-85db-471d-a219-ed6f688acc77/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) PiperOrigin-RevId: 372468161 Source-Link: https://github.com/googleapis/googleapis/commit/75880c3e6a6aa2597400582848e81bbbfac51dea --- .../game_server_clusters_service_client.ts | 26 +++---------------- .../game_server_configs_service_client.ts | 26 +++---------------- .../game_server_deployments_service_client.ts | 26 +++---------------- .../src/v1beta/realms_service_client.ts | 26 +++---------------- 4 files changed, 16 insertions(+), 88 deletions(-) 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 index 7e72d9b3e90..493ec86dc93 100644 --- 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 @@ -32,6 +32,7 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; 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`. @@ -149,22 +150,7 @@ export class GameServerClustersServiceClient { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath - ); + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. @@ -198,15 +184,11 @@ export class GameServerClustersServiceClient { ), }; + 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 protoFilesRoot = opts.fallback - ? this._gaxModule.protobuf.Root.fromJSON( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - ) - : this._gaxModule.protobuf.loadSync(nodejsProtoPath); this.operationsClient = this._gaxModule .lro({ 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 index ca50217c914..526a6b551ec 100644 --- 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 @@ -32,6 +32,7 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; 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`. @@ -148,22 +149,7 @@ export class GameServerConfigsServiceClient { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath - ); + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. @@ -197,15 +183,11 @@ export class GameServerConfigsServiceClient { ), }; + 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 protoFilesRoot = opts.fallback - ? this._gaxModule.protobuf.Root.fromJSON( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - ) - : this._gaxModule.protobuf.loadSync(nodejsProtoPath); this.operationsClient = this._gaxModule .lro({ 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 index 42ecf270cd1..1dceed5c676 100644 --- 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 @@ -32,6 +32,7 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; 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`. @@ -149,22 +150,7 @@ export class GameServerDeploymentsServiceClient { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath - ); + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. @@ -198,15 +184,11 @@ export class GameServerDeploymentsServiceClient { ), }; + 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 protoFilesRoot = opts.fallback - ? this._gaxModule.protobuf.Root.fromJSON( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - ) - : this._gaxModule.protobuf.loadSync(nodejsProtoPath); this.operationsClient = this._gaxModule .lro({ diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index 09168de20e5..4ec29c3840e 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -32,6 +32,7 @@ import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; 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`. @@ -148,22 +149,7 @@ export class RealmsServiceClient { clientHeader.push(`${opts.libName}/${opts.libVersion}`); } // Load the applicable protos. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath - ); + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. @@ -197,15 +183,11 @@ export class RealmsServiceClient { ), }; + 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 protoFilesRoot = opts.fallback - ? this._gaxModule.protobuf.Root.fromJSON( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - ) - : this._gaxModule.protobuf.loadSync(nodejsProtoPath); this.operationsClient = this._gaxModule .lro({ From 0f97a7c471b16c9273dcf191e2dca40ef2396748 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 24 May 2021 23:10:02 +0000 Subject: [PATCH 106/180] chore: release 2.3.2 (#173) :robot: I have created a release \*beep\* \*boop\* --- ### [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)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-gaming/CHANGELOG.md | 7 +++++++ packages/google-cloud-gaming/package.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index d959dd213b9..68ce1173406 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 3710e0a37e2..2d5942734d3 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "2.3.1", + "version": "2.3.2", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index b120a2ad559..639c3a8d8b5 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^2.3.1" + "@google-cloud/game-servers": "^2.3.2" }, "devDependencies": { "c8": "^7.2.1", From 9b929ffd294984a72eae6351db713d5a883be956 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 25 May 2021 17:54:33 +0200 Subject: [PATCH 107/180] chore(deps): update dependency sinon to v11 (#174) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^10.0.0` -> `^11.0.0`](https://renovatebot.com/diffs/npm/sinon/10.0.0/11.1.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/compatibility-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/confidence-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v11.1.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1110--2021-05-25) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v11.0.0...31be9a5d5a4762ef01cb195f29024616dfee9ce8) \================== - Add sinon.promise() implementation ([#​2369](https://togithub.com/sinonjs/sinon/issues/2369)) - Set wrappedMethod on getters/setters ([#​2378](https://togithub.com/sinonjs/sinon/issues/2378)) - \[Docs] Update fake-server usage & descriptions ([#​2365](https://togithub.com/sinonjs/sinon/issues/2365)) - Fake docs improvement ([#​2360](https://togithub.com/sinonjs/sinon/issues/2360)) - Update nise to 5.1.0 (fixed [#​2318](https://togithub.com/sinonjs/sinon/issues/2318)) ### [`v11.0.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1100--2021-05-24) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v10.0.1...v11.0.0) \================== - Explicitly use samsam 6.0.2 with fix for [#​2345](https://togithub.com/sinonjs/sinon/issues/2345) - Update most packages ([#​2371](https://togithub.com/sinonjs/sinon/issues/2371)) - Update compatibility docs ([#​2366](https://togithub.com/sinonjs/sinon/issues/2366)) - Update packages (includes breaking fake-timers change, see [#​2352](https://togithub.com/sinonjs/sinon/issues/2352)) - Warn of potential memory leaks ([#​2357](https://togithub.com/sinonjs/sinon/issues/2357)) - Fix clock test errors ### [`v10.0.1`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1001--2021-04-08) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v10.0.0...v10.0.1) \================== - Upgrade sinon components (bumps y18n to 4.0.1) - Bump y18n from 4.0.0 to 4.0.1
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻️ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 2d5942734d3..89febe5fe47 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -44,7 +44,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^10.0.0", + "sinon": "^11.0.0", "ts-loader": "^9.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", From 2b8378463c1c5d25ccd55808cfad635c676f8659 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 29 May 2021 20:52:02 +0000 Subject: [PATCH 108/180] chore: make generate_index_ts() deterministic (#176) Fixes https://github.com/googleapis/synthtool/issues/1103 Source-Link: https://github.com/googleapis/synthtool/commit/c3e41da0fa256ad7f6b4bc76b9d069dedecdfef4 Post-Processor: gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:e37a815333a6f3e14d8532efe90cba8aa0d34210f8c0fdbdd9e6a34dcbe51e96 --- packages/google-cloud-gaming/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-gaming/src/index.ts b/packages/google-cloud-gaming/src/index.ts index afa0632daeb..05c94cbb4be 100644 --- a/packages/google-cloud-gaming/src/index.ts +++ b/packages/google-cloud-gaming/src/index.ts @@ -16,8 +16,8 @@ // ** https://github.com/googleapis/synthtool ** // ** All changes to this file may be overwritten. ** -import * as v1beta from './v1beta'; import * as v1 from './v1'; +import * as v1beta from './v1beta'; const GameServerClustersServiceClient = v1.GameServerClustersServiceClient; type GameServerClustersServiceClient = v1.GameServerClustersServiceClient; @@ -30,16 +30,16 @@ const RealmsServiceClient = v1.RealmsServiceClient; type RealmsServiceClient = v1.RealmsServiceClient; export { - v1beta, v1, + v1beta, GameServerClustersServiceClient, GameServerConfigsServiceClient, GameServerDeploymentsServiceClient, RealmsServiceClient, }; export default { - v1beta, v1, + v1beta, GameServerClustersServiceClient, GameServerConfigsServiceClient, GameServerDeploymentsServiceClient, From 44041fcb3703e0ae6b5beff89755e30181f7d175 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 10 Jun 2021 00:28:05 +0000 Subject: [PATCH 109/180] fix: GoogleAdsError missing using generator version after 1.3.0 (#175) [PR](https://github.com/googleapis/gapic-generator-typescript/pull/878) within updated gapic-generator-typescript version 1.4.0 Committer: @summer-ji-eng PiperOrigin-RevId: 375759421 Source-Link: https://github.com/googleapis/googleapis/commit/95fa72fdd0d69b02d72c33b37d1e4cc66d4b1446 Source-Link: https://github.com/googleapis/googleapis-gen/commit/f40a34377ad488a7c2bc3992b3c8d5faf5a15c46 --- .../v1/game_server_clusters_service_client.ts | 29 ++++--------------- .../v1/game_server_configs_service_client.ts | 29 ++++--------------- .../game_server_deployments_service_client.ts | 29 ++++--------------- .../src/v1/realms_service_client.ts | 29 ++++--------------- .../game_server_clusters_service_client.ts | 3 +- .../game_server_configs_service_client.ts | 3 +- .../game_server_deployments_service_client.ts | 3 +- .../src/v1beta/realms_service_client.ts | 3 +- 8 files changed, 32 insertions(+), 96 deletions(-) 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 index 1a69e552b8d..9254366b36b 100644 --- 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 @@ -27,11 +27,11 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; -import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; 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`. @@ -144,27 +144,14 @@ export class GameServerClustersServiceClient { } 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. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath - ); + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. @@ -198,15 +185,11 @@ export class GameServerClustersServiceClient { ), }; + 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 protoFilesRoot = opts.fallback - ? this._gaxModule.protobuf.Root.fromJSON( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - ) - : this._gaxModule.protobuf.loadSync(nodejsProtoPath); this.operationsClient = this._gaxModule .lro({ 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 index 2804b998e60..3c32f0491e9 100644 --- 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 @@ -27,11 +27,11 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; -import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; 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`. @@ -143,27 +143,14 @@ export class GameServerConfigsServiceClient { } 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. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath - ); + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. @@ -197,15 +184,11 @@ export class GameServerConfigsServiceClient { ), }; + 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 protoFilesRoot = opts.fallback - ? this._gaxModule.protobuf.Root.fromJSON( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - ) - : this._gaxModule.protobuf.loadSync(nodejsProtoPath); this.operationsClient = this._gaxModule .lro({ 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 index e0d7581c542..cb2f0f3f563 100644 --- 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 @@ -27,11 +27,11 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; -import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; 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`. @@ -144,27 +144,14 @@ export class GameServerDeploymentsServiceClient { } 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. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath - ); + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. @@ -198,15 +185,11 @@ export class GameServerDeploymentsServiceClient { ), }; + 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 protoFilesRoot = opts.fallback - ? this._gaxModule.protobuf.Root.fromJSON( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - ) - : this._gaxModule.protobuf.loadSync(nodejsProtoPath); this.operationsClient = this._gaxModule .lro({ diff --git a/packages/google-cloud-gaming/src/v1/realms_service_client.ts b/packages/google-cloud-gaming/src/v1/realms_service_client.ts index 44a8b04e2cb..d344372dde4 100644 --- a/packages/google-cloud-gaming/src/v1/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1/realms_service_client.ts @@ -27,11 +27,11 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; -import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; 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`. @@ -143,27 +143,14 @@ export class RealmsServiceClient { } 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. - // For Node.js, pass the path to JSON proto file. - // For browsers, pass the JSON content. - - const nodejsProtoPath = path.join( - __dirname, - '..', - '..', - 'protos', - 'protos.json' - ); - this._protos = this._gaxGrpc.loadProto( - opts.fallback - ? // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - : nodejsProtoPath - ); + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); // This API contains "path templates"; forward-slash-separated // identifiers to uniquely identify resources within the API. @@ -197,15 +184,11 @@ export class RealmsServiceClient { ), }; + 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 protoFilesRoot = opts.fallback - ? this._gaxModule.protobuf.Root.fromJSON( - // eslint-disable-next-line @typescript-eslint/no-var-requires - require('../../protos/protos.json') - ) - : this._gaxModule.protobuf.loadSync(nodejsProtoPath); this.operationsClient = this._gaxModule .lro({ 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 index 493ec86dc93..794a8afc850 100644 --- 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 @@ -27,7 +27,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; -import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; @@ -145,6 +144,8 @@ export class GameServerClustersServiceClient { } 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}`); 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 index 526a6b551ec..966d6d183bd 100644 --- 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 @@ -27,7 +27,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; -import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; @@ -144,6 +143,8 @@ export class GameServerConfigsServiceClient { } 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}`); 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 index 1dceed5c676..69a7e5367db 100644 --- 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 @@ -27,7 +27,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; -import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; @@ -145,6 +144,8 @@ export class GameServerDeploymentsServiceClient { } 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}`); diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index 4ec29c3840e..915b28d98cb 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -27,7 +27,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; -import * as path from 'path'; import {Transform} from 'stream'; import {RequestType} from 'google-gax/build/src/apitypes'; @@ -144,6 +143,8 @@ export class RealmsServiceClient { } 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}`); From 536370e3d03f05a16f67374a0ab3c62cdf65726f Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 10 Jun 2021 00:34:05 +0000 Subject: [PATCH 110/180] chore: release 2.3.3 (#180) :robot: I have created a release \*beep\* \*boop\* --- ### [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)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-gaming/CHANGELOG.md | 7 +++++++ packages/google-cloud-gaming/package.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index 68ce1173406..e1d2ff3c6fb 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 89febe5fe47..4de794779c4 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "2.3.2", + "version": "2.3.3", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index 639c3a8d8b5..84cd65e15ff 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^2.3.2" + "@google-cloud/game-servers": "^2.3.3" }, "devDependencies": { "c8": "^7.2.1", From 9bbc1982075c24aaf31abe838931385af6815feb Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Thu, 10 Jun 2021 23:00:44 +0200 Subject: [PATCH 111/180] chore(nodejs): remove api-extractor dependencies (#183) --- packages/google-cloud-gaming/package.json | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 4de794779c4..148bbfc4974 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -24,9 +24,7 @@ "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", "test": "c8 mocha build/test", "prelint": "cd samples; npm link ../; npm install", - "precompile": "gts clean", - "api-extractor": "api-extractor run --local", - "api-documenter": "api-documenter yaml --input-folder=temp" + "precompile": "gts clean" }, "dependencies": { "google-gax": "^2.12.0" @@ -48,9 +46,7 @@ "ts-loader": "^9.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", - "webpack-cli": "^4.0.0", - "@microsoft/api-documenter": "^7.8.10", - "@microsoft/api-extractor": "^7.8.10" + "webpack-cli": "^4.0.0" }, "engines": { "node": ">=10" From dd99c5cdd36436e70d6cad4db3d3f25038d84b3f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 14 Jun 2021 20:58:11 +0000 Subject: [PATCH 112/180] build: typo in package_name field (#185) PiperOrigin-RevId: 378532398 Source-Link: https://github.com/googleapis/googleapis/commit/7e7ec3748e2e12e86584f8f111044a586ea34df7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/1656d906920cfc37885375cb6f23424d420873b9 --- packages/google-cloud-gaming/src/v1/gapic_metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/src/v1/gapic_metadata.json b/packages/google-cloud-gaming/src/v1/gapic_metadata.json index 0df0d679864..8b66a5bfe79 100644 --- a/packages/google-cloud-gaming/src/v1/gapic_metadata.json +++ b/packages/google-cloud-gaming/src/v1/gapic_metadata.json @@ -3,7 +3,7 @@ "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", "language": "typescript", "protoPackage": "google.cloud.gaming.v1", - "libraryPackage": "gaming", + "libraryPackage": "@google-cloud/game-servers", "services": { "GameServerClustersService": { "clients": { From a37cdb62f0a4f082656d22356f10e2d8a3789c4a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 22 Jun 2021 20:20:21 +0000 Subject: [PATCH 113/180] fix: make request optional in all cases (#186) ... chore: update gapic-generator-ruby to the latest commit chore: release gapic-generator-typescript 1.5.0 Committer: @miraleung PiperOrigin-RevId: 380641501 Source-Link: https://github.com/googleapis/googleapis/commit/076f7e9f0b258bdb54338895d7251b202e8f0de3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/27e4c88b4048e5f56508d4e1aa417d60a3380892 --- .../v1/game_server_clusters_service_client.ts | 32 ++++++++--------- .../v1/game_server_configs_service_client.ts | 16 ++++----- .../game_server_deployments_service_client.ts | 36 +++++++++---------- .../src/v1/realms_service_client.ts | 24 ++++++------- .../game_server_clusters_service_client.ts | 32 ++++++++--------- .../game_server_configs_service_client.ts | 16 ++++----- .../game_server_deployments_service_client.ts | 36 +++++++++---------- .../src/v1beta/realms_service_client.ts | 24 ++++++------- 8 files changed, 108 insertions(+), 108 deletions(-) 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 index 9254366b36b..62c4e24731c 100644 --- 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 @@ -387,7 +387,7 @@ export class GameServerClustersServiceClient { // -- Service calls -- // ------------------- getGameServerCluster( - request: protos.google.cloud.gaming.v1.IGetGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1.IGetGameServerClusterRequest, options?: CallOptions ): Promise< [ @@ -437,7 +437,7 @@ export class GameServerClustersServiceClient { * const [response] = await client.getGameServerCluster(request); */ getGameServerCluster( - request: protos.google.cloud.gaming.v1.IGetGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1.IGetGameServerClusterRequest, optionsOrCallback?: | CallOptions | Callback< @@ -480,7 +480,7 @@ export class GameServerClustersServiceClient { return this.innerApiCalls.getGameServerCluster(request, options, callback); } previewCreateGameServerCluster( - request: protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest, options?: CallOptions ): Promise< [ @@ -539,7 +539,7 @@ export class GameServerClustersServiceClient { * const [response] = await client.previewCreateGameServerCluster(request); */ previewCreateGameServerCluster( - request: protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest, optionsOrCallback?: | CallOptions | Callback< @@ -589,7 +589,7 @@ export class GameServerClustersServiceClient { ); } previewDeleteGameServerCluster( - request: protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest, options?: CallOptions ): Promise< [ @@ -643,7 +643,7 @@ export class GameServerClustersServiceClient { * const [response] = await client.previewDeleteGameServerCluster(request); */ previewDeleteGameServerCluster( - request: protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest, optionsOrCallback?: | CallOptions | Callback< @@ -693,7 +693,7 @@ export class GameServerClustersServiceClient { ); } previewUpdateGameServerCluster( - request: protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest, options?: CallOptions ): Promise< [ @@ -754,7 +754,7 @@ export class GameServerClustersServiceClient { * const [response] = await client.previewUpdateGameServerCluster(request); */ previewUpdateGameServerCluster( - request: protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest, optionsOrCallback?: | CallOptions | Callback< @@ -805,7 +805,7 @@ export class GameServerClustersServiceClient { } createGameServerCluster( - request: protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest, options?: CallOptions ): Promise< [ @@ -866,7 +866,7 @@ export class GameServerClustersServiceClient { * const [response] = await operation.promise(); */ createGameServerCluster( - request: protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest, optionsOrCallback?: | CallOptions | Callback< @@ -955,7 +955,7 @@ export class GameServerClustersServiceClient { >; } deleteGameServerCluster( - request: protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest, options?: CallOptions ): Promise< [ @@ -1012,7 +1012,7 @@ export class GameServerClustersServiceClient { * const [response] = await operation.promise(); */ deleteGameServerCluster( - request: protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1101,7 +1101,7 @@ export class GameServerClustersServiceClient { >; } updateGameServerCluster( - request: protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest, options?: CallOptions ): Promise< [ @@ -1165,7 +1165,7 @@ export class GameServerClustersServiceClient { * const [response] = await operation.promise(); */ updateGameServerCluster( - request: protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1254,7 +1254,7 @@ export class GameServerClustersServiceClient { >; } listGameServerClusters( - request: protos.google.cloud.gaming.v1.IListGameServerClustersRequest, + request?: protos.google.cloud.gaming.v1.IListGameServerClustersRequest, options?: CallOptions ): Promise< [ @@ -1319,7 +1319,7 @@ export class GameServerClustersServiceClient { * for more details and examples. */ listGameServerClusters( - request: protos.google.cloud.gaming.v1.IListGameServerClustersRequest, + request?: protos.google.cloud.gaming.v1.IListGameServerClustersRequest, optionsOrCallback?: | CallOptions | PaginationCallback< 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 index 3c32f0491e9..a1807f5927f 100644 --- 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 @@ -366,7 +366,7 @@ export class GameServerConfigsServiceClient { // -- Service calls -- // ------------------- getGameServerConfig( - request: protos.google.cloud.gaming.v1.IGetGameServerConfigRequest, + request?: protos.google.cloud.gaming.v1.IGetGameServerConfigRequest, options?: CallOptions ): Promise< [ @@ -416,7 +416,7 @@ export class GameServerConfigsServiceClient { * const [response] = await client.getGameServerConfig(request); */ getGameServerConfig( - request: protos.google.cloud.gaming.v1.IGetGameServerConfigRequest, + request?: protos.google.cloud.gaming.v1.IGetGameServerConfigRequest, optionsOrCallback?: | CallOptions | Callback< @@ -460,7 +460,7 @@ export class GameServerConfigsServiceClient { } createGameServerConfig( - request: protos.google.cloud.gaming.v1.ICreateGameServerConfigRequest, + request?: protos.google.cloud.gaming.v1.ICreateGameServerConfigRequest, options?: CallOptions ): Promise< [ @@ -524,7 +524,7 @@ export class GameServerConfigsServiceClient { * const [response] = await operation.promise(); */ createGameServerConfig( - request: protos.google.cloud.gaming.v1.ICreateGameServerConfigRequest, + request?: protos.google.cloud.gaming.v1.ICreateGameServerConfigRequest, optionsOrCallback?: | CallOptions | Callback< @@ -613,7 +613,7 @@ export class GameServerConfigsServiceClient { >; } deleteGameServerConfig( - request: protos.google.cloud.gaming.v1.IDeleteGameServerConfigRequest, + request?: protos.google.cloud.gaming.v1.IDeleteGameServerConfigRequest, options?: CallOptions ): Promise< [ @@ -672,7 +672,7 @@ export class GameServerConfigsServiceClient { * const [response] = await operation.promise(); */ deleteGameServerConfig( - request: protos.google.cloud.gaming.v1.IDeleteGameServerConfigRequest, + request?: protos.google.cloud.gaming.v1.IDeleteGameServerConfigRequest, optionsOrCallback?: | CallOptions | Callback< @@ -761,7 +761,7 @@ export class GameServerConfigsServiceClient { >; } listGameServerConfigs( - request: protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, + request?: protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, options?: CallOptions ): Promise< [ @@ -828,7 +828,7 @@ export class GameServerConfigsServiceClient { * for more details and examples. */ listGameServerConfigs( - request: protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, + request?: protos.google.cloud.gaming.v1.IListGameServerConfigsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< 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 index cb2f0f3f563..5aaa9b8f15e 100644 --- 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 @@ -404,7 +404,7 @@ export class GameServerDeploymentsServiceClient { // -- Service calls -- // ------------------- getGameServerDeployment( - request: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRequest, + request?: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRequest, options?: CallOptions ): Promise< [ @@ -454,7 +454,7 @@ export class GameServerDeploymentsServiceClient { * const [response] = await client.getGameServerDeployment(request); */ getGameServerDeployment( - request: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRequest, + request?: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRequest, optionsOrCallback?: | CallOptions | Callback< @@ -501,7 +501,7 @@ export class GameServerDeploymentsServiceClient { ); } getGameServerDeploymentRollout( - request: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest, + request?: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest, options?: CallOptions ): Promise< [ @@ -554,7 +554,7 @@ export class GameServerDeploymentsServiceClient { * const [response] = await client.getGameServerDeploymentRollout(request); */ getGameServerDeploymentRollout( - request: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest, + request?: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest, optionsOrCallback?: | CallOptions | Callback< @@ -604,7 +604,7 @@ export class GameServerDeploymentsServiceClient { ); } previewGameServerDeploymentRollout( - request: protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest, + request?: protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest, options?: CallOptions ): Promise< [ @@ -667,7 +667,7 @@ export class GameServerDeploymentsServiceClient { * const [response] = await client.previewGameServerDeploymentRollout(request); */ previewGameServerDeploymentRollout( - request: protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest, + request?: protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest, optionsOrCallback?: | CallOptions | Callback< @@ -717,7 +717,7 @@ export class GameServerDeploymentsServiceClient { ); } fetchDeploymentState( - request: protos.google.cloud.gaming.v1.IFetchDeploymentStateRequest, + request?: protos.google.cloud.gaming.v1.IFetchDeploymentStateRequest, options?: CallOptions ): Promise< [ @@ -769,7 +769,7 @@ export class GameServerDeploymentsServiceClient { * const [response] = await client.fetchDeploymentState(request); */ fetchDeploymentState( - request: protos.google.cloud.gaming.v1.IFetchDeploymentStateRequest, + request?: protos.google.cloud.gaming.v1.IFetchDeploymentStateRequest, optionsOrCallback?: | CallOptions | Callback< @@ -813,7 +813,7 @@ export class GameServerDeploymentsServiceClient { } createGameServerDeployment( - request: protos.google.cloud.gaming.v1.ICreateGameServerDeploymentRequest, + request?: protos.google.cloud.gaming.v1.ICreateGameServerDeploymentRequest, options?: CallOptions ): Promise< [ @@ -874,7 +874,7 @@ export class GameServerDeploymentsServiceClient { * const [response] = await operation.promise(); */ createGameServerDeployment( - request: protos.google.cloud.gaming.v1.ICreateGameServerDeploymentRequest, + request?: protos.google.cloud.gaming.v1.ICreateGameServerDeploymentRequest, optionsOrCallback?: | CallOptions | Callback< @@ -963,7 +963,7 @@ export class GameServerDeploymentsServiceClient { >; } deleteGameServerDeployment( - request: protos.google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest, + request?: protos.google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest, options?: CallOptions ): Promise< [ @@ -1021,7 +1021,7 @@ export class GameServerDeploymentsServiceClient { * const [response] = await operation.promise(); */ deleteGameServerDeployment( - request: protos.google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest, + request?: protos.google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1110,7 +1110,7 @@ export class GameServerDeploymentsServiceClient { >; } updateGameServerDeployment( - request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest, + request?: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest, options?: CallOptions ): Promise< [ @@ -1174,7 +1174,7 @@ export class GameServerDeploymentsServiceClient { * const [response] = await operation.promise(); */ updateGameServerDeployment( - request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest, + request?: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1263,7 +1263,7 @@ export class GameServerDeploymentsServiceClient { >; } updateGameServerDeploymentRollout( - request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest, + request?: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest, options?: CallOptions ): Promise< [ @@ -1332,7 +1332,7 @@ export class GameServerDeploymentsServiceClient { * const [response] = await operation.promise(); */ updateGameServerDeploymentRollout( - request: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest, + request?: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1421,7 +1421,7 @@ export class GameServerDeploymentsServiceClient { >; } listGameServerDeployments( - request: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, + request?: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, options?: CallOptions ): Promise< [ @@ -1487,7 +1487,7 @@ export class GameServerDeploymentsServiceClient { * for more details and examples. */ listGameServerDeployments( - request: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, + request?: protos.google.cloud.gaming.v1.IListGameServerDeploymentsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< diff --git a/packages/google-cloud-gaming/src/v1/realms_service_client.ts b/packages/google-cloud-gaming/src/v1/realms_service_client.ts index d344372dde4..f706ba274b9 100644 --- a/packages/google-cloud-gaming/src/v1/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1/realms_service_client.ts @@ -371,7 +371,7 @@ export class RealmsServiceClient { // -- Service calls -- // ------------------- getRealm( - request: protos.google.cloud.gaming.v1.IGetRealmRequest, + request?: protos.google.cloud.gaming.v1.IGetRealmRequest, options?: CallOptions ): Promise< [ @@ -416,7 +416,7 @@ export class RealmsServiceClient { * const [response] = await client.getRealm(request); */ getRealm( - request: protos.google.cloud.gaming.v1.IGetRealmRequest, + request?: protos.google.cloud.gaming.v1.IGetRealmRequest, optionsOrCallback?: | CallOptions | Callback< @@ -455,7 +455,7 @@ export class RealmsServiceClient { return this.innerApiCalls.getRealm(request, options, callback); } previewRealmUpdate( - request: protos.google.cloud.gaming.v1.IPreviewRealmUpdateRequest, + request?: protos.google.cloud.gaming.v1.IPreviewRealmUpdateRequest, options?: CallOptions ): Promise< [ @@ -513,7 +513,7 @@ export class RealmsServiceClient { * const [response] = await client.previewRealmUpdate(request); */ previewRealmUpdate( - request: protos.google.cloud.gaming.v1.IPreviewRealmUpdateRequest, + request?: protos.google.cloud.gaming.v1.IPreviewRealmUpdateRequest, optionsOrCallback?: | CallOptions | Callback< @@ -557,7 +557,7 @@ export class RealmsServiceClient { } createRealm( - request: protos.google.cloud.gaming.v1.ICreateRealmRequest, + request?: protos.google.cloud.gaming.v1.ICreateRealmRequest, options?: CallOptions ): Promise< [ @@ -618,7 +618,7 @@ export class RealmsServiceClient { * const [response] = await operation.promise(); */ createRealm( - request: protos.google.cloud.gaming.v1.ICreateRealmRequest, + request?: protos.google.cloud.gaming.v1.ICreateRealmRequest, optionsOrCallback?: | CallOptions | Callback< @@ -703,7 +703,7 @@ export class RealmsServiceClient { >; } deleteRealm( - request: protos.google.cloud.gaming.v1.IDeleteRealmRequest, + request?: protos.google.cloud.gaming.v1.IDeleteRealmRequest, options?: CallOptions ): Promise< [ @@ -760,7 +760,7 @@ export class RealmsServiceClient { * const [response] = await operation.promise(); */ deleteRealm( - request: protos.google.cloud.gaming.v1.IDeleteRealmRequest, + request?: protos.google.cloud.gaming.v1.IDeleteRealmRequest, optionsOrCallback?: | CallOptions | Callback< @@ -845,7 +845,7 @@ export class RealmsServiceClient { >; } updateRealm( - request: protos.google.cloud.gaming.v1.IUpdateRealmRequest, + request?: protos.google.cloud.gaming.v1.IUpdateRealmRequest, options?: CallOptions ): Promise< [ @@ -909,7 +909,7 @@ export class RealmsServiceClient { * const [response] = await operation.promise(); */ updateRealm( - request: protos.google.cloud.gaming.v1.IUpdateRealmRequest, + request?: protos.google.cloud.gaming.v1.IUpdateRealmRequest, optionsOrCallback?: | CallOptions | Callback< @@ -994,7 +994,7 @@ export class RealmsServiceClient { >; } listRealms( - request: protos.google.cloud.gaming.v1.IListRealmsRequest, + request?: protos.google.cloud.gaming.v1.IListRealmsRequest, options?: CallOptions ): Promise< [ @@ -1056,7 +1056,7 @@ export class RealmsServiceClient { * for more details and examples. */ listRealms( - request: protos.google.cloud.gaming.v1.IListRealmsRequest, + request?: protos.google.cloud.gaming.v1.IListRealmsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< 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 index 794a8afc850..040b487d225 100644 --- 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 @@ -387,7 +387,7 @@ export class GameServerClustersServiceClient { // -- Service calls -- // ------------------- getGameServerCluster( - request: protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, options?: CallOptions ): Promise< [ @@ -440,7 +440,7 @@ export class GameServerClustersServiceClient { * const [response] = await client.getGameServerCluster(request); */ getGameServerCluster( - request: protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, optionsOrCallback?: | CallOptions | Callback< @@ -486,7 +486,7 @@ export class GameServerClustersServiceClient { return this.innerApiCalls.getGameServerCluster(request, options, callback); } previewCreateGameServerCluster( - request: protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, options?: CallOptions ): Promise< [ @@ -545,7 +545,7 @@ export class GameServerClustersServiceClient { * const [response] = await client.previewCreateGameServerCluster(request); */ previewCreateGameServerCluster( - request: protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, optionsOrCallback?: | CallOptions | Callback< @@ -595,7 +595,7 @@ export class GameServerClustersServiceClient { ); } previewDeleteGameServerCluster( - request: protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, options?: CallOptions ): Promise< [ @@ -649,7 +649,7 @@ export class GameServerClustersServiceClient { * const [response] = await client.previewDeleteGameServerCluster(request); */ previewDeleteGameServerCluster( - request: protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, optionsOrCallback?: | CallOptions | Callback< @@ -699,7 +699,7 @@ export class GameServerClustersServiceClient { ); } previewUpdateGameServerCluster( - request: protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, options?: CallOptions ): Promise< [ @@ -760,7 +760,7 @@ export class GameServerClustersServiceClient { * const [response] = await client.previewUpdateGameServerCluster(request); */ previewUpdateGameServerCluster( - request: protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, optionsOrCallback?: | CallOptions | Callback< @@ -811,7 +811,7 @@ export class GameServerClustersServiceClient { } createGameServerCluster( - request: protos.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, options?: CallOptions ): Promise< [ @@ -872,7 +872,7 @@ export class GameServerClustersServiceClient { * const [response] = await operation.promise(); */ createGameServerCluster( - request: protos.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, optionsOrCallback?: | CallOptions | Callback< @@ -961,7 +961,7 @@ export class GameServerClustersServiceClient { >; } deleteGameServerCluster( - request: protos.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, options?: CallOptions ): Promise< [ @@ -1018,7 +1018,7 @@ export class GameServerClustersServiceClient { * const [response] = await operation.promise(); */ deleteGameServerCluster( - request: protos.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1107,7 +1107,7 @@ export class GameServerClustersServiceClient { >; } updateGameServerCluster( - request: protos.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, options?: CallOptions ): Promise< [ @@ -1171,7 +1171,7 @@ export class GameServerClustersServiceClient { * const [response] = await operation.promise(); */ updateGameServerCluster( - request: protos.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, + request?: protos.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1260,7 +1260,7 @@ export class GameServerClustersServiceClient { >; } listGameServerClusters( - request: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + request?: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, options?: CallOptions ): Promise< [ @@ -1326,7 +1326,7 @@ export class GameServerClustersServiceClient { * for more details and examples. */ listGameServerClusters( - request: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, + request?: protos.google.cloud.gaming.v1beta.IListGameServerClustersRequest, optionsOrCallback?: | CallOptions | PaginationCallback< 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 index 966d6d183bd..82ef2673ee4 100644 --- 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 @@ -367,7 +367,7 @@ export class GameServerConfigsServiceClient { // -- Service calls -- // ------------------- getGameServerConfig( - request: protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, + request?: protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, options?: CallOptions ): Promise< [ @@ -417,7 +417,7 @@ export class GameServerConfigsServiceClient { * const [response] = await client.getGameServerConfig(request); */ getGameServerConfig( - request: protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, + request?: protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, optionsOrCallback?: | CallOptions | Callback< @@ -461,7 +461,7 @@ export class GameServerConfigsServiceClient { } createGameServerConfig( - request: protos.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, + request?: protos.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, options?: CallOptions ): Promise< [ @@ -525,7 +525,7 @@ export class GameServerConfigsServiceClient { * const [response] = await operation.promise(); */ createGameServerConfig( - request: protos.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, + request?: protos.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, optionsOrCallback?: | CallOptions | Callback< @@ -614,7 +614,7 @@ export class GameServerConfigsServiceClient { >; } deleteGameServerConfig( - request: protos.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, + request?: protos.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, options?: CallOptions ): Promise< [ @@ -673,7 +673,7 @@ export class GameServerConfigsServiceClient { * const [response] = await operation.promise(); */ deleteGameServerConfig( - request: protos.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, + request?: protos.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, optionsOrCallback?: | CallOptions | Callback< @@ -762,7 +762,7 @@ export class GameServerConfigsServiceClient { >; } listGameServerConfigs( - request: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + request?: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, options?: CallOptions ): Promise< [ @@ -830,7 +830,7 @@ export class GameServerConfigsServiceClient { * for more details and examples. */ listGameServerConfigs( - request: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, + request?: protos.google.cloud.gaming.v1beta.IListGameServerConfigsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< 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 index 69a7e5367db..e58894ea513 100644 --- 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 @@ -404,7 +404,7 @@ export class GameServerDeploymentsServiceClient { // -- Service calls -- // ------------------- getGameServerDeployment( - request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, + request?: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, options?: CallOptions ): Promise< [ @@ -458,7 +458,7 @@ export class GameServerDeploymentsServiceClient { * const [response] = await client.getGameServerDeployment(request); */ getGameServerDeployment( - request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, + request?: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, optionsOrCallback?: | CallOptions | Callback< @@ -508,7 +508,7 @@ export class GameServerDeploymentsServiceClient { ); } getGameServerDeploymentRollout( - request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, + request?: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, options?: CallOptions ): Promise< [ @@ -562,7 +562,7 @@ export class GameServerDeploymentsServiceClient { * const [response] = await client.getGameServerDeploymentRollout(request); */ getGameServerDeploymentRollout( - request: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, + request?: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, optionsOrCallback?: | CallOptions | Callback< @@ -612,7 +612,7 @@ export class GameServerDeploymentsServiceClient { ); } previewGameServerDeploymentRollout( - request: protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, + request?: protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, options?: CallOptions ): Promise< [ @@ -675,7 +675,7 @@ export class GameServerDeploymentsServiceClient { * const [response] = await client.previewGameServerDeploymentRollout(request); */ previewGameServerDeploymentRollout( - request: protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, + request?: protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, optionsOrCallback?: | CallOptions | Callback< @@ -725,7 +725,7 @@ export class GameServerDeploymentsServiceClient { ); } fetchDeploymentState( - request: protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, + request?: protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, options?: CallOptions ): Promise< [ @@ -780,7 +780,7 @@ export class GameServerDeploymentsServiceClient { * const [response] = await client.fetchDeploymentState(request); */ fetchDeploymentState( - request: protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, + request?: protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, optionsOrCallback?: | CallOptions | Callback< @@ -827,7 +827,7 @@ export class GameServerDeploymentsServiceClient { } createGameServerDeployment( - request: protos.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, + request?: protos.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, options?: CallOptions ): Promise< [ @@ -888,7 +888,7 @@ export class GameServerDeploymentsServiceClient { * const [response] = await operation.promise(); */ createGameServerDeployment( - request: protos.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, + request?: protos.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, optionsOrCallback?: | CallOptions | Callback< @@ -977,7 +977,7 @@ export class GameServerDeploymentsServiceClient { >; } deleteGameServerDeployment( - request: protos.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, + request?: protos.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, options?: CallOptions ): Promise< [ @@ -1035,7 +1035,7 @@ export class GameServerDeploymentsServiceClient { * const [response] = await operation.promise(); */ deleteGameServerDeployment( - request: protos.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, + request?: protos.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1124,7 +1124,7 @@ export class GameServerDeploymentsServiceClient { >; } updateGameServerDeployment( - request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, + request?: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, options?: CallOptions ): Promise< [ @@ -1188,7 +1188,7 @@ export class GameServerDeploymentsServiceClient { * const [response] = await operation.promise(); */ updateGameServerDeployment( - request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, + request?: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1277,7 +1277,7 @@ export class GameServerDeploymentsServiceClient { >; } updateGameServerDeploymentRollout( - request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, + request?: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, options?: CallOptions ): Promise< [ @@ -1346,7 +1346,7 @@ export class GameServerDeploymentsServiceClient { * const [response] = await operation.promise(); */ updateGameServerDeploymentRollout( - request: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, + request?: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1435,7 +1435,7 @@ export class GameServerDeploymentsServiceClient { >; } listGameServerDeployments( - request: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + request?: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, options?: CallOptions ): Promise< [ @@ -1501,7 +1501,7 @@ export class GameServerDeploymentsServiceClient { * for more details and examples. */ listGameServerDeployments( - request: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, + request?: protos.google.cloud.gaming.v1beta.IListGameServerDeploymentsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index 915b28d98cb..7e0f4b47b6b 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -371,7 +371,7 @@ export class RealmsServiceClient { // -- Service calls -- // ------------------- getRealm( - request: protos.google.cloud.gaming.v1beta.IGetRealmRequest, + request?: protos.google.cloud.gaming.v1beta.IGetRealmRequest, options?: CallOptions ): Promise< [ @@ -416,7 +416,7 @@ export class RealmsServiceClient { * const [response] = await client.getRealm(request); */ getRealm( - request: protos.google.cloud.gaming.v1beta.IGetRealmRequest, + request?: protos.google.cloud.gaming.v1beta.IGetRealmRequest, optionsOrCallback?: | CallOptions | Callback< @@ -455,7 +455,7 @@ export class RealmsServiceClient { return this.innerApiCalls.getRealm(request, options, callback); } previewRealmUpdate( - request: protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, + request?: protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, options?: CallOptions ): Promise< [ @@ -513,7 +513,7 @@ export class RealmsServiceClient { * const [response] = await client.previewRealmUpdate(request); */ previewRealmUpdate( - request: protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, + request?: protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, optionsOrCallback?: | CallOptions | Callback< @@ -557,7 +557,7 @@ export class RealmsServiceClient { } createRealm( - request: protos.google.cloud.gaming.v1beta.ICreateRealmRequest, + request?: protos.google.cloud.gaming.v1beta.ICreateRealmRequest, options?: CallOptions ): Promise< [ @@ -618,7 +618,7 @@ export class RealmsServiceClient { * const [response] = await operation.promise(); */ createRealm( - request: protos.google.cloud.gaming.v1beta.ICreateRealmRequest, + request?: protos.google.cloud.gaming.v1beta.ICreateRealmRequest, optionsOrCallback?: | CallOptions | Callback< @@ -703,7 +703,7 @@ export class RealmsServiceClient { >; } deleteRealm( - request: protos.google.cloud.gaming.v1beta.IDeleteRealmRequest, + request?: protos.google.cloud.gaming.v1beta.IDeleteRealmRequest, options?: CallOptions ): Promise< [ @@ -760,7 +760,7 @@ export class RealmsServiceClient { * const [response] = await operation.promise(); */ deleteRealm( - request: protos.google.cloud.gaming.v1beta.IDeleteRealmRequest, + request?: protos.google.cloud.gaming.v1beta.IDeleteRealmRequest, optionsOrCallback?: | CallOptions | Callback< @@ -845,7 +845,7 @@ export class RealmsServiceClient { >; } updateRealm( - request: protos.google.cloud.gaming.v1beta.IUpdateRealmRequest, + request?: protos.google.cloud.gaming.v1beta.IUpdateRealmRequest, options?: CallOptions ): Promise< [ @@ -909,7 +909,7 @@ export class RealmsServiceClient { * const [response] = await operation.promise(); */ updateRealm( - request: protos.google.cloud.gaming.v1beta.IUpdateRealmRequest, + request?: protos.google.cloud.gaming.v1beta.IUpdateRealmRequest, optionsOrCallback?: | CallOptions | Callback< @@ -994,7 +994,7 @@ export class RealmsServiceClient { >; } listRealms( - request: protos.google.cloud.gaming.v1beta.IListRealmsRequest, + request?: protos.google.cloud.gaming.v1beta.IListRealmsRequest, options?: CallOptions ): Promise< [ @@ -1056,7 +1056,7 @@ export class RealmsServiceClient { * for more details and examples. */ listRealms( - request: protos.google.cloud.gaming.v1beta.IListRealmsRequest, + request?: protos.google.cloud.gaming.v1beta.IListRealmsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< From 85feaf5616e1b0f76a4a93691fdcad51186a3859 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 22 Jun 2021 20:40:43 +0000 Subject: [PATCH 114/180] chore: release 2.3.4 (#187) :robot: I have created a release \*beep\* \*boop\* --- ### [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)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-gaming/CHANGELOG.md | 7 +++++++ packages/google-cloud-gaming/package.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index e1d2ff3c6fb..5f66801bf25 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 148bbfc4974..6b9658c10b6 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "2.3.3", + "version": "2.3.4", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index 84cd65e15ff..1d19919d30a 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^2.3.3" + "@google-cloud/game-servers": "^2.3.4" }, "devDependencies": { "c8": "^7.2.1", From dfaca16126a2ddd8c41d791e6b68e5beb9e428be Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Tue, 29 Jun 2021 11:24:37 -0400 Subject: [PATCH 115/180] fix(deps): google-gax v2.17.0 with mTLS (#192) --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 6b9658c10b6..20e1d07d4a8 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -27,7 +27,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^2.12.0" + "google-gax": "^2.17.0" }, "devDependencies": { "@types/mocha": "^8.0.0", From 0a7d03861313ee2ca2164d49648cc28195d69ba1 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 29 Jun 2021 17:02:27 +0000 Subject: [PATCH 116/180] chore: release 2.3.5 (#193) :robot: I have created a release \*beep\* \*boop\* --- ### [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)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-gaming/CHANGELOG.md | 7 +++++++ packages/google-cloud-gaming/package.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index 5f66801bf25..c2615f2d5b7 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 20e1d07d4a8..e92bf91169f 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "2.3.4", + "version": "2.3.5", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index 1d19919d30a..61df81ac9d5 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^2.3.4" + "@google-cloud/game-servers": "^2.3.5" }, "devDependencies": { "c8": "^7.2.1", From 3f7927603d314230e380458c9f3fa54f93ee0877 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 12 Jul 2021 17:44:32 -0400 Subject: [PATCH 117/180] fix(deps): google-gax v2.17.1 (#196) --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index e92bf91169f..a48b769c9a7 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -27,7 +27,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^2.17.0" + "google-gax": "^2.17.1" }, "devDependencies": { "@types/mocha": "^8.0.0", From 16836df565f7b3359a6813e1b83845636ab1f720 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 12 Jul 2021 22:04:22 +0000 Subject: [PATCH 118/180] chore: release 2.3.6 (#197) :robot: I have created a release \*beep\* \*boop\* --- ### [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)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-gaming/CHANGELOG.md | 7 +++++++ packages/google-cloud-gaming/package.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index c2615f2d5b7..858d9a0c533 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index a48b769c9a7..f1c8ad10385 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "2.3.5", + "version": "2.3.6", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index 61df81ac9d5..ab077b18bb0 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^2.3.5" + "@google-cloud/game-servers": "^2.3.6" }, "devDependencies": { "c8": "^7.2.1", From 729e658b84de4b33c304fc16faceda1f6907ac67 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 19:08:30 +0000 Subject: [PATCH 119/180] fix: Updating WORKSPACE files to use the newest version of the Typescript generator. (#198) Also removing the explicit generator tag for the IAMPolicy mixin for the kms and pubsub APIS as the generator will now read it from the .yaml file. PiperOrigin-RevId: 385101839 Source-Link: https://github.com/googleapis/googleapis/commit/80f404215a9346259db760d80d0671f28c433453 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d3509d2520fb8db862129633f1cf8406d17454e1 --- .../src/v1/game_server_clusters_service_client.ts | 11 ++++++++++- .../src/v1/game_server_configs_service_client.ts | 11 ++++++++++- .../src/v1/game_server_deployments_service_client.ts | 11 ++++++++++- .../src/v1/realms_service_client.ts | 11 ++++++++++- .../src/v1beta/game_server_clusters_service_client.ts | 11 ++++++++++- .../src/v1beta/game_server_configs_service_client.ts | 11 ++++++++++- .../v1beta/game_server_deployments_service_client.ts | 11 ++++++++++- .../src/v1beta/realms_service_client.ts | 11 ++++++++++- 8 files changed, 80 insertions(+), 8 deletions(-) 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 index 62c4e24731c..203cb3f9354 100644 --- 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 @@ -50,6 +50,7 @@ const version = require('../../../package.json').version; 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: {}; @@ -61,6 +62,7 @@ export class GameServerClustersServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -106,6 +108,9 @@ export class GameServerClustersServiceClient { .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 = @@ -258,6 +263,9 @@ export class GameServerClustersServiceClient { // 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 = gax.warn; } /** @@ -287,7 +295,8 @@ export class GameServerClustersServiceClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.gaming.v1 .GameServerClustersService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides 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 index a1807f5927f..d0eda58f91b 100644 --- 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 @@ -49,6 +49,7 @@ const version = require('../../../package.json').version; 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: {}; @@ -60,6 +61,7 @@ export class GameServerConfigsServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -105,6 +107,9 @@ export class GameServerConfigsServiceClient { .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 = @@ -242,6 +247,9 @@ export class GameServerConfigsServiceClient { // 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 = gax.warn; } /** @@ -270,7 +278,8 @@ export class GameServerConfigsServiceClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.gaming.v1.GameServerConfigsService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides 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 index 5aaa9b8f15e..d23ff511591 100644 --- 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 @@ -50,6 +50,7 @@ const version = require('../../../package.json').version; 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: {}; @@ -61,6 +62,7 @@ export class GameServerDeploymentsServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -106,6 +108,9 @@ export class GameServerDeploymentsServiceClient { .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 = @@ -274,6 +279,9 @@ export class GameServerDeploymentsServiceClient { // 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 = gax.warn; } /** @@ -303,7 +311,8 @@ export class GameServerDeploymentsServiceClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.gaming.v1 .GameServerDeploymentsService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/packages/google-cloud-gaming/src/v1/realms_service_client.ts b/packages/google-cloud-gaming/src/v1/realms_service_client.ts index f706ba274b9..4f8d466aa53 100644 --- a/packages/google-cloud-gaming/src/v1/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1/realms_service_client.ts @@ -50,6 +50,7 @@ const version = require('../../../package.json').version; 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: {}; @@ -61,6 +62,7 @@ export class RealmsServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -105,6 +107,9 @@ export class RealmsServiceClient { 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 = @@ -245,6 +250,9 @@ export class RealmsServiceClient { // 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 = gax.warn; } /** @@ -273,7 +281,8 @@ export class RealmsServiceClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.gaming.v1.RealmsService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides 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 index 040b487d225..a0a4dfd1683 100644 --- 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 @@ -50,6 +50,7 @@ const version = require('../../../package.json').version; 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: {}; @@ -61,6 +62,7 @@ export class GameServerClustersServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -106,6 +108,9 @@ export class GameServerClustersServiceClient { .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 = @@ -258,6 +263,9 @@ export class GameServerClustersServiceClient { // 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 = gax.warn; } /** @@ -287,7 +295,8 @@ export class GameServerClustersServiceClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.gaming.v1beta .GameServerClustersService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides 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 index 82ef2673ee4..97e5a939dd9 100644 --- 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 @@ -49,6 +49,7 @@ const version = require('../../../package.json').version; 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: {}; @@ -60,6 +61,7 @@ export class GameServerConfigsServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -105,6 +107,9 @@ export class GameServerConfigsServiceClient { .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 = @@ -242,6 +247,9 @@ export class GameServerConfigsServiceClient { // 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 = gax.warn; } /** @@ -271,7 +279,8 @@ export class GameServerConfigsServiceClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.gaming.v1beta .GameServerConfigsService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides 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 index e58894ea513..7827c009ee4 100644 --- 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 @@ -50,6 +50,7 @@ const version = require('../../../package.json').version; 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: {}; @@ -61,6 +62,7 @@ export class GameServerDeploymentsServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -106,6 +108,9 @@ export class GameServerDeploymentsServiceClient { .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 = @@ -274,6 +279,9 @@ export class GameServerDeploymentsServiceClient { // 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 = gax.warn; } /** @@ -303,7 +311,8 @@ export class GameServerDeploymentsServiceClient { : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.gaming.v1beta .GameServerDeploymentsService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index 7e0f4b47b6b..39072e58a07 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -50,6 +50,7 @@ const version = require('../../../package.json').version; 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: {}; @@ -61,6 +62,7 @@ export class RealmsServiceClient { longrunning: {}, batching: {}, }; + warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; @@ -105,6 +107,9 @@ export class RealmsServiceClient { 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 = @@ -245,6 +250,9 @@ export class RealmsServiceClient { // 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 = gax.warn; } /** @@ -273,7 +281,8 @@ export class RealmsServiceClient { ) : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.gaming.v1beta.RealmsService, - this._opts + this._opts, + this._providedCustomServicePath ) as Promise<{[method: string]: Function}>; // Iterate over each of the methods that the service provides From f9f0958be325db6e58b2c06047f66fd9209349d1 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 16 Jul 2021 12:53:10 -0700 Subject: [PATCH 120/180] chore: release 2.3.7 (#199) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-gaming/CHANGELOG.md | 7 +++++++ packages/google-cloud-gaming/package.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index 858d9a0c533..85e7f5aa8e7 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index f1c8ad10385..148e9359163 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "2.3.6", + "version": "2.3.7", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index ab077b18bb0..bcb0f986052 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^2.3.6" + "@google-cloud/game-servers": "^2.3.7" }, "devDependencies": { "c8": "^7.2.1", From dadda94a8cd4e97a6d4b1a362d1202c65eda1f02 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Wed, 4 Aug 2021 16:00:36 -0400 Subject: [PATCH 121/180] chore(nodejs): update client ref docs link in metadata (#204) --- packages/google-cloud-gaming/.repo-metadata.json | 2 +- packages/google-cloud-gaming/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/.repo-metadata.json b/packages/google-cloud-gaming/.repo-metadata.json index b1ed7e5e45b..4555ac64788 100644 --- a/packages/google-cloud-gaming/.repo-metadata.json +++ b/packages/google-cloud-gaming/.repo-metadata.json @@ -1,5 +1,5 @@ { - "client_documentation": "https://googleapis.dev/nodejs/game-servers/latest", + "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, diff --git a/packages/google-cloud-gaming/README.md b/packages/google-cloud-gaming/README.md index 2a069b91d5f..9f0425dfc86 100644 --- a/packages/google-cloud-gaming/README.md +++ b/packages/google-cloud-gaming/README.md @@ -185,7 +185,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-game-servers/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/nodejs/game-servers/latest +[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 From 9962122a5f9ebd5f012d17878f70b9a30073a251 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Sat, 14 Aug 2021 00:41:00 -0700 Subject: [PATCH 122/180] fix(build): migrate to using main branch (#206) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(build): migrate to using main branch * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- packages/google-cloud-gaming/README.md | 58 +++++++++---------- .../google-cloud-gaming/samples/README.md | 44 +++++++------- 2 files changed, 51 insertions(+), 51 deletions(-) diff --git a/packages/google-cloud-gaming/README.md b/packages/google-cloud-gaming/README.md index 9f0425dfc86..14b91e806fa 100644 --- a/packages/google-cloud-gaming/README.md +++ b/packages/google-cloud-gaming/README.md @@ -6,7 +6,7 @@ [![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-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) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-game-servers/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-game-servers) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-game-servers/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-game-servers) @@ -15,7 +15,7 @@ Game service client for Node.js A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-game-servers/blob/master/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/nodejs-game-servers/blob/main/CHANGELOG.md). * [Google Cloud Game Servers Node.js Client API Reference][client-docs] * [Google Cloud Game Servers Documentation][product-docs] @@ -97,32 +97,32 @@ quickstart(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-game-servers/tree/master/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-game-servers/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Create_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_cluster.js,samples/README.md) | -| Create_config | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_config.js,samples/README.md) | -| Create_deployment | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_deployment.js,samples/README.md) | -| Create_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_realm.js,samples/README.md) | -| Delete_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_cluster.js,samples/README.md) | -| Delete_config | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_config.js,samples/README.md) | -| Delete_deployment | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_deployment.js,samples/README.md) | -| Delete_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_realm.js,samples/README.md) | -| Get_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_cluster.js,samples/README.md) | -| Get_config | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_config.js,samples/README.md) | -| Get_deployment | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_deployment.js,samples/README.md) | -| Get_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_realm.js,samples/README.md) | -| Get_rollout | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_rollout.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_rollout.js,samples/README.md) | -| List_clusters | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_clusters.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_clusters.js,samples/README.md) | -| List_configs | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_configs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_configs.js,samples/README.md) | -| List_deployments | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_deployments.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_deployments.js,samples/README.md) | -| List_realms | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_realms.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_realms.js,samples/README.md) | -| Create Game Server Realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | -| Update_rollout_default | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/update_rollout_default.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_default.js,samples/README.md) | -| Update_rollout_override | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/update_rollout_override.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_override.js,samples/README.md) | -| Update_rollout_remove_default | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/update_rollout_remove_default.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_remove_default.js,samples/README.md) | -| Update_rollout_remove_override | [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/update_rollout_remove_override.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_remove_override.js,samples/README.md) | +| Create_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/create_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_cluster.js,samples/README.md) | +| Create_config | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/create_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_config.js,samples/README.md) | +| Create_deployment | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/create_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_deployment.js,samples/README.md) | +| Create_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/create_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_realm.js,samples/README.md) | +| Delete_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/delete_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_cluster.js,samples/README.md) | +| Delete_config | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/delete_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_config.js,samples/README.md) | +| Delete_deployment | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/delete_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_deployment.js,samples/README.md) | +| Delete_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/delete_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_realm.js,samples/README.md) | +| Get_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/get_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_cluster.js,samples/README.md) | +| Get_config | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/get_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_config.js,samples/README.md) | +| Get_deployment | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/get_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_deployment.js,samples/README.md) | +| Get_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/get_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_realm.js,samples/README.md) | +| Get_rollout | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/get_rollout.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_rollout.js,samples/README.md) | +| List_clusters | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/list_clusters.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_clusters.js,samples/README.md) | +| List_configs | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/list_configs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_configs.js,samples/README.md) | +| List_deployments | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/list_deployments.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_deployments.js,samples/README.md) | +| List_realms | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/list_realms.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_realms.js,samples/README.md) | +| Create Game Server Realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Update_rollout_default | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_rollout_default.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_default.js,samples/README.md) | +| Update_rollout_override | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_rollout_override.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_override.js,samples/README.md) | +| Update_rollout_remove_default | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_rollout_remove_default.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_remove_default.js,samples/README.md) | +| Update_rollout_remove_override | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_rollout_remove_override.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_remove_override.js,samples/README.md) | @@ -171,19 +171,19 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-game-servers/blob/master/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-game-servers/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 template in this -[directory](https://github.com/googleapis/synthtool/tree/master/synthtool/gcp/templates/node_library). +to its templates in +[directory](https://github.com/googleapis/synthtool). ## License Apache Version 2.0 -See [LICENSE](https://github.com/googleapis/nodejs-game-servers/blob/master/LICENSE) +See [LICENSE](https://github.com/googleapis/nodejs-game-servers/blob/main/LICENSE) [client-docs]: https://cloud.google.com/nodejs/docs/reference/game-servers/latest [product-docs]: https://cloud.google.com/game-servers/ diff --git a/packages/google-cloud-gaming/samples/README.md b/packages/google-cloud-gaming/samples/README.md index 49270a08135..d1bb5f5f012 100644 --- a/packages/google-cloud-gaming/samples/README.md +++ b/packages/google-cloud-gaming/samples/README.md @@ -52,7 +52,7 @@ Before running the samples, make sure you've followed the steps outlined in ### Create_cluster -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_cluster.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/create_cluster.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_cluster.js,samples/README.md) @@ -69,7 +69,7 @@ __Usage:__ ### Create_config -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_config.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/create_config.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_config.js,samples/README.md) @@ -86,7 +86,7 @@ __Usage:__ ### Create_deployment -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_deployment.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/create_deployment.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_deployment.js,samples/README.md) @@ -103,7 +103,7 @@ __Usage:__ ### Create_realm -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/create_realm.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/create_realm.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_realm.js,samples/README.md) @@ -120,7 +120,7 @@ __Usage:__ ### Delete_cluster -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_cluster.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/delete_cluster.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_cluster.js,samples/README.md) @@ -137,7 +137,7 @@ __Usage:__ ### Delete_config -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_config.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/delete_config.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_config.js,samples/README.md) @@ -154,7 +154,7 @@ __Usage:__ ### Delete_deployment -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_deployment.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/delete_deployment.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_deployment.js,samples/README.md) @@ -171,7 +171,7 @@ __Usage:__ ### Delete_realm -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/delete_realm.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/delete_realm.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_realm.js,samples/README.md) @@ -188,7 +188,7 @@ __Usage:__ ### Get_cluster -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_cluster.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/get_cluster.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_cluster.js,samples/README.md) @@ -205,7 +205,7 @@ __Usage:__ ### Get_config -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_config.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/get_config.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_config.js,samples/README.md) @@ -222,7 +222,7 @@ __Usage:__ ### Get_deployment -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_deployment.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/get_deployment.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_deployment.js,samples/README.md) @@ -239,7 +239,7 @@ __Usage:__ ### Get_realm -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_realm.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/get_realm.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_realm.js,samples/README.md) @@ -256,7 +256,7 @@ __Usage:__ ### Get_rollout -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/get_rollout.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/get_rollout.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_rollout.js,samples/README.md) @@ -273,7 +273,7 @@ __Usage:__ ### List_clusters -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_clusters.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/list_clusters.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_clusters.js,samples/README.md) @@ -290,7 +290,7 @@ __Usage:__ ### List_configs -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_configs.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/list_configs.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_configs.js,samples/README.md) @@ -307,7 +307,7 @@ __Usage:__ ### List_deployments -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_deployments.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/list_deployments.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_deployments.js,samples/README.md) @@ -324,7 +324,7 @@ __Usage:__ ### List_realms -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/list_realms.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/list_realms.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_realms.js,samples/README.md) @@ -343,7 +343,7 @@ __Usage:__ Creates a new Realm within Cloud Game Servers -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/quickstart.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/quickstart.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) @@ -360,7 +360,7 @@ __Usage:__ ### Update_rollout_default -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/update_rollout_default.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_rollout_default.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_default.js,samples/README.md) @@ -377,7 +377,7 @@ __Usage:__ ### Update_rollout_override -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/update_rollout_override.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_rollout_override.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_override.js,samples/README.md) @@ -394,7 +394,7 @@ __Usage:__ ### Update_rollout_remove_default -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/update_rollout_remove_default.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_rollout_remove_default.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_remove_default.js,samples/README.md) @@ -411,7 +411,7 @@ __Usage:__ ### Update_rollout_remove_override -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/master/samples/update_rollout_remove_override.js). +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_rollout_remove_override.js). [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_remove_override.js,samples/README.md) From 4fa63303941a5348f67376007c2bbdbbaaf75363 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 16 Aug 2021 22:46:30 -0400 Subject: [PATCH 123/180] fix(deps): google-gax v2.24.1 (#208) --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 148e9359163..201cc530491 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -27,7 +27,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^2.17.1" + "google-gax": "^2.24.1" }, "devDependencies": { "@types/mocha": "^8.0.0", From 15838aad83a0812c15e05e7acabcaf909e1d4ed0 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 17 Aug 2021 17:20:26 +0000 Subject: [PATCH 124/180] chore: release 2.3.8 (#207) :robot: I have created a release \*beep\* \*boop\* --- ### [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)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-gaming/CHANGELOG.md | 8 ++++++++ packages/google-cloud-gaming/package.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index 85e7f5aa8e7..9f1a96c3359 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 201cc530491..a13c845e2c3 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "2.3.7", + "version": "2.3.8", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index bcb0f986052..ffba77a5fbb 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^2.3.7" + "@google-cloud/game-servers": "^2.3.8" }, "devDependencies": { "c8": "^7.2.1", From bab2812200ad295962f8130a61775f07d8728cdf Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 23 Aug 2021 18:30:19 +0000 Subject: [PATCH 125/180] feat: turns on self-signed JWT feature flag (#209) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 392067151 Source-Link: https://github.com/googleapis/googleapis/commit/06345f7b95c4b4a3ffe4303f1f2984ccc304b2e0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/95882b37970e41e4cd51b22fa507cfd46dc7c4b6 --- .../src/v1/game_server_clusters_service_client.ts | 7 +++++++ .../src/v1/game_server_configs_service_client.ts | 7 +++++++ .../src/v1/game_server_deployments_service_client.ts | 7 +++++++ .../google-cloud-gaming/src/v1/realms_service_client.ts | 7 +++++++ .../src/v1beta/game_server_clusters_service_client.ts | 7 +++++++ .../src/v1beta/game_server_configs_service_client.ts | 7 +++++++ .../src/v1beta/game_server_deployments_service_client.ts | 7 +++++++ .../src/v1beta/realms_service_client.ts | 7 +++++++ 8 files changed, 56 insertions(+) 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 index 203cb3f9354..5937810cdc7 100644 --- 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 @@ -135,6 +135,12 @@ export class GameServerClustersServiceClient { // 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; @@ -1828,6 +1834,7 @@ export class GameServerClustersServiceClient { 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_configs_service_client.ts b/packages/google-cloud-gaming/src/v1/game_server_configs_service_client.ts index d0eda58f91b..d03ddf30745 100644 --- 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 @@ -134,6 +134,12 @@ export class GameServerConfigsServiceClient { // 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; @@ -1335,6 +1341,7 @@ export class GameServerConfigsServiceClient { 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_deployments_service_client.ts b/packages/google-cloud-gaming/src/v1/game_server_deployments_service_client.ts index d23ff511591..81b21ef9ff8 100644 --- 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 @@ -135,6 +135,12 @@ export class GameServerDeploymentsServiceClient { // 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; @@ -1998,6 +2004,7 @@ export class GameServerDeploymentsServiceClient { 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/realms_service_client.ts b/packages/google-cloud-gaming/src/v1/realms_service_client.ts index 4f8d466aa53..0dacdfd713f 100644 --- a/packages/google-cloud-gaming/src/v1/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1/realms_service_client.ts @@ -134,6 +134,12 @@ export class RealmsServiceClient { // 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; @@ -1559,6 +1565,7 @@ export class RealmsServiceClient { 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/game_server_clusters_service_client.ts b/packages/google-cloud-gaming/src/v1beta/game_server_clusters_service_client.ts index a0a4dfd1683..00707802a2b 100644 --- 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 @@ -135,6 +135,12 @@ export class GameServerClustersServiceClient { // 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; @@ -1837,6 +1843,7 @@ export class GameServerClustersServiceClient { 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_configs_service_client.ts b/packages/google-cloud-gaming/src/v1beta/game_server_configs_service_client.ts index 97e5a939dd9..370d2d30376 100644 --- 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 @@ -134,6 +134,12 @@ export class GameServerConfigsServiceClient { // 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; @@ -1339,6 +1345,7 @@ export class GameServerConfigsServiceClient { 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_deployments_service_client.ts b/packages/google-cloud-gaming/src/v1beta/game_server_deployments_service_client.ts index 7827c009ee4..2ef156cbd25 100644 --- 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 @@ -135,6 +135,12 @@ export class GameServerDeploymentsServiceClient { // 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; @@ -2012,6 +2018,7 @@ export class GameServerDeploymentsServiceClient { 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/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index 39072e58a07..cf5498bb7d9 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -134,6 +134,12 @@ export class RealmsServiceClient { // 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; @@ -1561,6 +1567,7 @@ export class RealmsServiceClient { return this.realmsServiceStub!.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve(); From b1640c654b639d156722215e7e0410723915d70d Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 24 Aug 2021 08:31:08 -0700 Subject: [PATCH 126/180] chore: release 2.4.0 (#210) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-gaming/CHANGELOG.md | 7 +++++++ packages/google-cloud-gaming/package.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index 9f1a96c3359..17ecfecb5cb 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index a13c845e2c3..ac79cfcd9d3 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "2.3.8", + "version": "2.4.0", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index ffba77a5fbb..5955bdb378d 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^2.3.8" + "@google-cloud/game-servers": "^2.4.0" }, "devDependencies": { "c8": "^7.2.1", From f23e88ba9189e2b96e1d4a3b359e6298b31311fa Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 28 Aug 2021 09:41:17 -0700 Subject: [PATCH 127/180] feat: support version reporting API (#213) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: support version reporting API PiperOrigin-RevId: 393476621 Source-Link: https://github.com/googleapis/googleapis/commit/e9da6f8b469c52b83f900e820be30762e9e05c57 Source-Link: https://github.com/googleapis/googleapis-gen/commit/acd7bedb8902f616f05203982efccc0f0a9a0b2a * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../google/cloud/gaming/v1/common.proto | 5 +- .../gaming/v1/game_server_clusters.proto | 138 ++++- .../v1/game_server_clusters_service.proto | 2 +- .../cloud/gaming/v1/game_server_configs.proto | 18 +- .../v1/game_server_configs_service.proto | 2 +- .../gaming/v1/game_server_deployments.proto | 42 +- .../v1/game_server_deployments_service.proto | 2 +- .../google/cloud/gaming/v1/realms.proto | 22 +- .../cloud/gaming/v1/realms_service.proto | 2 +- .../google-cloud-gaming/protos/protos.d.ts | 172 ++++++ packages/google-cloud-gaming/protos/protos.js | 560 +++++++++++++++++- .../google-cloud-gaming/protos/protos.json | 103 ++++ .../v1/game_server_clusters_service_client.ts | 64 +- .../v1/game_server_configs_service_client.ts | 18 +- .../game_server_deployments_service_client.ts | 35 +- ...ver_deployments_service_client_config.json | 2 +- .../src/v1/realms_service_client.ts | 22 +- 17 files changed, 1054 insertions(+), 155 deletions(-) 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 index 87cfedcb732..6469efcddc6 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/common.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/common.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -122,7 +122,6 @@ message Schedule { // 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; @@ -163,12 +162,10 @@ message TargetDetails { } // 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; 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 index 8e23c67a0b2..ba6a5586cdd 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -27,9 +27,24 @@ option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1;gamin 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. Uses the form: + // Required. The parent resource name, in the following form: // "projects/{project}/locations/{location}/realms/{realm}". string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -38,7 +53,7 @@ message ListGameServerClustersRequest { } ]; - // Optional. The maximum number of items to return. If unspecified, the server + // 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 @@ -54,6 +69,14 @@ message ListGameServerClustersRequest { // 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. @@ -71,8 +94,7 @@ message ListGameServerClustersResponse { // Request message for GameServerClustersService.GetGameServerCluster. message GetGameServerClusterRequest { - // Required. The name of the game server cluster to retrieve. Uses the form: - // + // 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, @@ -80,11 +102,19 @@ message GetGameServerClusterRequest { 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. Uses the form: + // Required. The parent resource name, in the following form: // `projects/{project}/locations/{location}/realms/{realm-id}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -102,7 +132,7 @@ message CreateGameServerClusterRequest { // Request message for GameServerClustersService.PreviewCreateGameServerCluster. message PreviewCreateGameServerClusterRequest { - // Required. The parent resource name. Uses the form: + // Required. The parent resource name, in the following form: // `projects/{project}/locations/{location}/realms/{realm}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -119,6 +149,13 @@ message PreviewCreateGameServerClusterRequest { // 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 @@ -129,11 +166,15 @@ message PreviewCreateGameServerClusterResponse { // 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. Uses the form: + // 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, @@ -145,7 +186,7 @@ message DeleteGameServerClusterRequest { // Request message for GameServerClustersService.PreviewDeleteGameServerCluster. message PreviewDeleteGameServerClusterRequest { - // Required. The name of the game server cluster to delete. Uses the form: + // 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, @@ -176,10 +217,7 @@ message UpdateGameServerClusterRequest { // 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 + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -191,10 +229,7 @@ message PreviewUpdateGameServerClusterRequest { // 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 + // 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. @@ -244,11 +279,9 @@ message GameServerCluster { pattern: "projects/{project}/locations/{location}/realms/{realm}/gameServerClusters/{cluster}" }; - // Required. The resource name of the game server cluster. Uses the form: - // + // 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]; @@ -271,4 +304,69 @@ message GameServerCluster { // 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 index b8b8ea27c8d..db7a0f28f08 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. 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 index 05a1a169f5a..e92448d2fae 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -28,8 +28,7 @@ option java_package = "com.google.cloud.gaming.v1"; // Request message for GameServerConfigsService.ListGameServerConfigs. message ListGameServerConfigsRequest { - // Required. The parent resource name. Uses the form: - // + // Required. The parent resource name, in the following form: // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/*`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -71,8 +70,7 @@ message ListGameServerConfigsResponse { // Request message for GameServerConfigsService.GetGameServerConfig. message GetGameServerConfigRequest { - // Required. The name of the game server config to retrieve. Uses the form: - // + // 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, @@ -84,8 +82,7 @@ message GetGameServerConfigRequest { // Request message for GameServerConfigsService.CreateGameServerConfig. message CreateGameServerConfigRequest { - // Required. The parent resource name. Uses the form: - // + // Required. The parent resource name, in the following form: // `projects/{project}/locations/{location}/gameServerDeployments/{deployment}/`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -103,8 +100,7 @@ message CreateGameServerConfigRequest { // Request message for GameServerConfigsService.DeleteGameServerConfig. message DeleteGameServerConfigRequest { - // Required. The name of the game server config to delete. Uses the form: - // + // 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, @@ -149,11 +145,9 @@ message GameServerConfig { pattern: "projects/{project}/locations/{location}/gameServerDeployments/{deployment}/configs/{config}" }; - // The resource name of the game server config. Uses the form: - // + // 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; 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 index bee5334fb6c..c151d6032fa 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. 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 index 9160eb32a23..169558092cb 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -29,7 +29,7 @@ option java_package = "com.google.cloud.gaming.v1"; // Request message for GameServerDeploymentsService.ListGameServerDeployments. message ListGameServerDeploymentsRequest { - // Required. The parent resource name. Uses the form: + // Required. The parent resource name, in the following form: // `projects/{project}/locations/{location}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -72,8 +72,7 @@ message ListGameServerDeploymentsResponse { // Request message for GameServerDeploymentsService.GetGameServerDeployment. message GetGameServerDeploymentRequest { - // Required. The name of the game server delpoyment to retrieve. Uses the form: - // + // 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, @@ -86,8 +85,7 @@ message GetGameServerDeploymentRequest { // Request message for // GameServerDeploymentsService.GetGameServerDeploymentRollout. message GetGameServerDeploymentRolloutRequest { - // Required. The name of the game server delpoyment to retrieve. Uses the form: - // + // 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, @@ -99,7 +97,7 @@ message GetGameServerDeploymentRolloutRequest { // Request message for GameServerDeploymentsService.CreateGameServerDeployment. message CreateGameServerDeploymentRequest { - // Required. The parent resource name. Uses the form: + // Required. The parent resource name, in the following form: // `projects/{project}/locations/{location}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -117,8 +115,7 @@ message CreateGameServerDeploymentRequest { // Request message for GameServerDeploymentsService.DeleteGameServerDeployment. message DeleteGameServerDeploymentRequest { - // Required. The name of the game server delpoyment to delete. Uses the form: - // + // 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, @@ -137,10 +134,7 @@ message UpdateGameServerDeploymentRequest { // 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 + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -153,17 +147,13 @@ message UpdateGameServerDeploymentRolloutRequest { // 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 + // 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: - // + // 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]; } @@ -194,8 +184,7 @@ message GameServerDeployment { pattern: "projects/{project}/locations/{location}/gameServerDeployments/{deployment}" }; - // The resource name of the game server deployment. Uses the form: - // + // 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`. @@ -241,11 +230,10 @@ message GameServerDeploymentRollout { pattern: "projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout" }; - // The resource name of the game server deployment rollout. Uses the form: - // + // 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; @@ -257,7 +245,6 @@ message GameServerDeploymentRollout { // 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; @@ -278,10 +265,7 @@ message PreviewGameServerDeploymentRolloutRequest { // 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 + // 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 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 index 5b07723fb23..a82d259e83f 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. 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 index 6c2425889ce..8acadf57779 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/realms.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/realms.proto @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. @@ -29,7 +29,7 @@ option java_package = "com.google.cloud.gaming.v1"; // Request message for RealmsService.ListRealms. message ListRealmsRequest { - // Required. The parent resource name. Uses the form: + // Required. The parent resource name, in the following form: // `projects/{project}/locations/{location}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -72,7 +72,7 @@ message ListRealmsResponse { // Request message for RealmsService.GetRealm. message GetRealmRequest { - // Required. The name of the realm to retrieve. Uses the form: + // 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, @@ -84,7 +84,7 @@ message GetRealmRequest { // Request message for RealmsService.CreateRealm. message CreateRealmRequest { - // Required. The parent resource name. Uses the form: + // Required. The parent resource name, in the following form: // `projects/{project}/locations/{location}`. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -102,7 +102,7 @@ message CreateRealmRequest { // Request message for RealmsService.DeleteRealm. message DeleteRealmRequest { - // Required. The name of the realm to delete. Uses the form: + // 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, @@ -120,10 +120,7 @@ message UpdateRealmRequest { // Required. The update mask applies to the resource. For the `FieldMask` // definition, see - // - // https: - // //developers.google.com/protocol-buffers - // // /docs/reference/google.protobuf#fieldmask + // https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; } @@ -135,10 +132,7 @@ message PreviewRealmUpdateRequest { // Required. The update mask applies to the resource. For the `FieldMask` // definition, see - // - // https: - // //developers.google.com/protocol-buffers - // // /docs/reference/google.protobuf#fieldmask + // 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. @@ -161,7 +155,7 @@ message Realm { pattern: "projects/{project}/locations/{location}/realms/{realm}" }; - // The resource name of the realm. Uses the form: + // 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; 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 index 5b6467573fa..018850d71d5 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// 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. diff --git a/packages/google-cloud-gaming/protos/protos.d.ts b/packages/google-cloud-gaming/protos/protos.d.ts index 241333e0704..7ea0df8d539 100644 --- a/packages/google-cloud-gaming/protos/protos.d.ts +++ b/packages/google-cloud-gaming/protos/protos.d.ts @@ -1567,6 +1567,13 @@ export namespace google { } } + /** GameServerClusterView enum. */ + enum GameServerClusterView { + GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED = 0, + BASIC = 1, + FULL = 2 + } + /** Properties of a ListGameServerClustersRequest. */ interface IListGameServerClustersRequest { @@ -1584,6 +1591,9 @@ export namespace google { /** ListGameServerClustersRequest orderBy */ orderBy?: (string|null); + + /** ListGameServerClustersRequest view */ + view?: (google.cloud.gaming.v1.GameServerClusterView|keyof typeof google.cloud.gaming.v1.GameServerClusterView|null); } /** Represents a ListGameServerClustersRequest. */ @@ -1610,6 +1620,9 @@ export namespace google { /** 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 @@ -1788,6 +1801,9 @@ export namespace google { /** GetGameServerClusterRequest name */ name?: (string|null); + + /** GetGameServerClusterRequest view */ + view?: (google.cloud.gaming.v1.GameServerClusterView|keyof typeof google.cloud.gaming.v1.GameServerClusterView|null); } /** Represents a GetGameServerClusterRequest. */ @@ -1802,6 +1818,9 @@ export namespace google { /** 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 @@ -1989,6 +2008,9 @@ export namespace google { /** 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. */ @@ -2012,6 +2034,9 @@ export namespace google { /** 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 @@ -2091,6 +2116,9 @@ export namespace google { /** PreviewCreateGameServerClusterResponse targetState */ targetState?: (google.cloud.gaming.v1.ITargetState|null); + + /** PreviewCreateGameServerClusterResponse clusterState */ + clusterState?: (google.cloud.gaming.v1.IKubernetesClusterState|null); } /** Represents a PreviewCreateGameServerClusterResponse. */ @@ -2108,6 +2136,9 @@ export namespace google { /** 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 @@ -2967,6 +2998,9 @@ export namespace google { /** GameServerCluster description */ description?: (string|null); + + /** GameServerCluster clusterState */ + clusterState?: (google.cloud.gaming.v1.IKubernetesClusterState|null); } /** Represents a GameServerCluster. */ @@ -2999,6 +3033,9 @@ export namespace google { /** 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 @@ -3070,6 +3107,141 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** 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 }; + } + + 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 { diff --git a/packages/google-cloud-gaming/protos/protos.js b/packages/google-cloud-gaming/protos/protos.js index 09e4bb50921..60f5fee002c 100644 --- a/packages/google-cloud-gaming/protos/protos.js +++ b/packages/google-cloud-gaming/protos/protos.js @@ -3820,6 +3820,22 @@ 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() { /** @@ -3831,6 +3847,7 @@ * @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 */ /** @@ -3888,6 +3905,14 @@ */ 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 @@ -3922,6 +3947,8 @@ 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; }; @@ -3971,6 +3998,9 @@ case 5: message.orderBy = reader.string(); break; + case 6: + message.view = reader.int32(); + break; default: reader.skipType(tag & 7); break; @@ -4021,6 +4051,15 @@ 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; }; @@ -4046,6 +4085,20 @@ message.filter = String(object.filter); if (object.orderBy != null) message.orderBy = String(object.orderBy); + switch (object.view) { + 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; }; @@ -4068,6 +4121,7 @@ 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; @@ -4079,6 +4133,8 @@ 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] : message.view; return object; }; @@ -4373,6 +4429,7 @@ * @memberof google.cloud.gaming.v1 * @interface IGetGameServerClusterRequest * @property {string|null} [name] GetGameServerClusterRequest name + * @property {google.cloud.gaming.v1.GameServerClusterView|null} [view] GetGameServerClusterRequest view */ /** @@ -4398,6 +4455,14 @@ */ 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 @@ -4424,6 +4489,8 @@ 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; }; @@ -4461,6 +4528,9 @@ case 1: message.name = reader.string(); break; + case 6: + message.view = reader.int32(); + break; default: reader.skipType(tag & 7); break; @@ -4499,6 +4569,15 @@ 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; }; @@ -4516,6 +4595,20 @@ var message = new $root.google.cloud.gaming.v1.GetGameServerClusterRequest(); if (object.name != null) message.name = String(object.name); + switch (object.view) { + 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; }; @@ -4532,10 +4625,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + 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] : message.view; return object; }; @@ -4800,6 +4897,7 @@ * @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 */ /** @@ -4849,6 +4947,14 @@ */ 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 @@ -4881,6 +4987,8 @@ $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; }; @@ -4927,6 +5035,9 @@ 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; @@ -4978,6 +5089,15 @@ 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; }; @@ -5007,6 +5127,20 @@ throw TypeError(".google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest.previewTime: object expected"); message.previewTime = $root.google.protobuf.Timestamp.fromObject(object.previewTime); } + switch (object.view) { + 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; }; @@ -5028,6 +5162,7 @@ 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; @@ -5037,6 +5172,8 @@ 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] : message.view; return object; }; @@ -5062,6 +5199,7 @@ * @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 */ /** @@ -5095,6 +5233,14 @@ */ 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 @@ -5123,6 +5269,8 @@ 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; }; @@ -5163,6 +5311,9 @@ 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; @@ -5206,6 +5357,11 @@ 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; }; @@ -5228,6 +5384,11 @@ 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; }; @@ -5247,11 +5408,14 @@ 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; }; @@ -7002,6 +7166,7 @@ * @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 */ /** @@ -7076,6 +7241,14 @@ */ 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 @@ -7115,6 +7288,8 @@ 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; }; @@ -7189,6 +7364,9 @@ 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; @@ -7256,6 +7434,11 @@ 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; }; @@ -7299,6 +7482,11 @@ 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; }; @@ -7324,6 +7512,7 @@ object.connectionInfo = null; object.etag = ""; object.description = ""; + object.clusterState = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -7343,6 +7532,8 @@ 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; }; @@ -7360,6 +7551,373 @@ 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) { + 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] : 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); + }; + + /** + * 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() { /** diff --git a/packages/google-cloud-gaming/protos/protos.json b/packages/google-cloud-gaming/protos/protos.json index 75dbb0c9f79..602216ef186 100644 --- a/packages/google-cloud-gaming/protos/protos.json +++ b/packages/google-cloud-gaming/protos/protos.json @@ -299,6 +299,13 @@ } } }, + "GameServerClusterView": { + "values": { + "GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED": 0, + "BASIC": 1, + "FULL": 2 + } + }, "ListGameServerClustersRequest": { "fields": { "parent": { @@ -336,6 +343,13 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "view": { + "type": "GameServerClusterView", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -366,6 +380,13 @@ "(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" + } } } }, @@ -425,6 +446,14 @@ "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "view": { + "type": "GameServerClusterView", + "id": 6, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OPTIONAL" + } } } }, @@ -437,6 +466,13 @@ "targetState": { "type": "TargetState", "id": 3 + }, + "clusterState": { + "type": "KubernetesClusterState", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -608,6 +644,73 @@ "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 + } } } }, 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 index 5937810cdc7..da7771fb7ea 100644 --- 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 @@ -438,9 +438,15 @@ export class GameServerClustersServiceClient { * @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: - * + * 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. @@ -535,7 +541,7 @@ export class GameServerClustersServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent resource name. Uses the form: + * 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. @@ -543,6 +549,9 @@ export class GameServerClustersServiceClient { * 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. @@ -643,7 +652,7 @@ export class GameServerClustersServiceClient { * @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: + * 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. @@ -752,10 +761,7 @@ export class GameServerClustersServiceClient { * @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 + * 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] @@ -861,7 +867,7 @@ export class GameServerClustersServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent resource name. Uses the form: + * 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. @@ -1011,7 +1017,7 @@ export class GameServerClustersServiceClient { * @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: + * 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. @@ -1162,10 +1168,7 @@ export class GameServerClustersServiceClient { * @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 + * 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. @@ -1305,10 +1308,10 @@ export class GameServerClustersServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent resource name. Uses the form: + * 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 + * 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 @@ -1320,6 +1323,13 @@ export class GameServerClustersServiceClient { * @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. @@ -1386,10 +1396,10 @@ export class GameServerClustersServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent resource name. Uses the form: + * 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 + * 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 @@ -1401,6 +1411,13 @@ export class GameServerClustersServiceClient { * @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} @@ -1441,10 +1458,10 @@ export class GameServerClustersServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent resource name. Uses the form: + * 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 + * 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 @@ -1456,6 +1473,13 @@ export class GameServerClustersServiceClient { * @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} 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 index d03ddf30745..8956e053f1a 100644 --- 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 @@ -417,8 +417,7 @@ export class GameServerConfigsServiceClient { * @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: - * + * 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. @@ -518,8 +517,7 @@ export class GameServerConfigsServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent resource name. Uses the form: - * + * 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. @@ -670,8 +668,7 @@ export class GameServerConfigsServiceClient { * @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: - * + * 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. @@ -813,8 +810,7 @@ export class GameServerConfigsServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent resource name. Uses the form: - * + * 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 @@ -891,8 +887,7 @@ export class GameServerConfigsServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent resource name. Uses the form: - * + * 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 @@ -947,8 +942,7 @@ export class GameServerConfigsServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent resource name. Uses the form: - * + * 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 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 index 81b21ef9ff8..c6887459783 100644 --- 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 @@ -455,8 +455,7 @@ export class GameServerDeploymentsServiceClient { * @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: - * + * 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. @@ -555,8 +554,7 @@ export class GameServerDeploymentsServiceClient { * @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: - * + * 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. @@ -664,10 +662,7 @@ export class GameServerDeploymentsServiceClient { * @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 + * 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. @@ -770,8 +765,7 @@ export class GameServerDeploymentsServiceClient { * @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: - * + * 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. @@ -869,7 +863,7 @@ export class GameServerDeploymentsServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent resource name. Uses the form: + * 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. @@ -1019,8 +1013,7 @@ export class GameServerDeploymentsServiceClient { * @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: - * + * 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. @@ -1171,10 +1164,7 @@ export class GameServerDeploymentsServiceClient { * @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 + * 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. @@ -1329,10 +1319,7 @@ export class GameServerDeploymentsServiceClient { * @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 + * 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. @@ -1472,7 +1459,7 @@ export class GameServerDeploymentsServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent resource name. Uses the form: + * 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 @@ -1554,7 +1541,7 @@ export class GameServerDeploymentsServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent resource name. Uses the form: + * 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 @@ -1610,7 +1597,7 @@ export class GameServerDeploymentsServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent resource name. Uses the form: + * 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 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 index 65967cc2879..b675806d575 100644 --- 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 @@ -73,7 +73,7 @@ "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" }, "FetchDeploymentState": { - "timeout_millis": 120000, + "timeout_millis": 60000, "retry_codes_name": "unavailable", "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" } diff --git a/packages/google-cloud-gaming/src/v1/realms_service_client.ts b/packages/google-cloud-gaming/src/v1/realms_service_client.ts index 0dacdfd713f..8113e251dab 100644 --- a/packages/google-cloud-gaming/src/v1/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1/realms_service_client.ts @@ -418,7 +418,7 @@ export class RealmsServiceClient { * @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: + * 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. @@ -511,10 +511,7 @@ export class RealmsServiceClient { * @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 + * 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] @@ -613,7 +610,7 @@ export class RealmsServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent resource name. Uses the form: + * 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. @@ -759,7 +756,7 @@ export class RealmsServiceClient { * @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: + * 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. @@ -906,10 +903,7 @@ export class RealmsServiceClient { * @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 + * 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. @@ -1041,7 +1035,7 @@ export class RealmsServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent resource name. Uses the form: + * 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 @@ -1115,7 +1109,7 @@ export class RealmsServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent resource name. Uses the form: + * 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 @@ -1171,7 +1165,7 @@ export class RealmsServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent resource name. Uses the form: + * 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 From c3c21367afeea7ff0127dd3d22cb1a39a3b185ab Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 30 Aug 2021 10:58:41 -0500 Subject: [PATCH 128/180] chore: release 2.5.0 (#214) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-gaming/CHANGELOG.md | 7 +++++++ packages/google-cloud-gaming/package.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index 17ecfecb5cb..e2c0559c93e 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index ac79cfcd9d3..3a771dbeb9b 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "2.4.0", + "version": "2.5.0", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index 5955bdb378d..2ea3f59a0bf 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^2.4.0" + "@google-cloud/game-servers": "^2.5.0" }, "devDependencies": { "c8": "^7.2.1", From 8d7889b859add2b3552f210604e320efeecd240d Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Tue, 21 Sep 2021 07:16:20 -0700 Subject: [PATCH 129/180] chore: relocate owl bot post processor (#218) chore: relocate owl bot post processor --- packages/google-cloud-gaming/.github/.OwlBot.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/.github/.OwlBot.yaml b/packages/google-cloud-gaming/.github/.OwlBot.yaml index 5603594fbf1..b80a6514b88 100644 --- a/packages/google-cloud-gaming/.github/.OwlBot.yaml +++ b/packages/google-cloud-gaming/.github/.OwlBot.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. docker: - image: gcr.io/repo-automation-bots/owlbot-nodejs:latest + image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest deep-remove-regex: From 5e7c7e929d3f68bfe2c8d154eabb95092a94c97b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 28 Sep 2021 23:36:33 +0000 Subject: [PATCH 130/180] docs(samples): add auto-generated samples for Node with api short name in region tag (#221) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 399287285 Source-Link: https://github.com/googleapis/googleapis/commit/15759865d1c54e3d46429010f7e472fe6c3d3715 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b27fff623a5d8d586b703b5e4919856abe7c2eb3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjI3ZmZmNjIzYTVkOGQ1ODZiNzAzYjVlNDkxOTg1NmFiZTdjMmViMyJ9 --- ...ters_service.create_game_server_cluster.js | 65 ++++++++++++++ ...ters_service.delete_game_server_cluster.js | 55 ++++++++++++ ...lusters_service.get_game_server_cluster.js | 63 ++++++++++++++ ...sters_service.list_game_server_clusters.js | 86 +++++++++++++++++++ ...vice.preview_create_game_server_cluster.js | 73 ++++++++++++++++ ...vice.preview_delete_game_server_cluster.js | 58 +++++++++++++ ...vice.preview_update_game_server_cluster.js | 65 ++++++++++++++ ...ters_service.update_game_server_cluster.js | 62 +++++++++++++ ...nfigs_service.create_game_server_config.js | 65 ++++++++++++++ ...nfigs_service.delete_game_server_config.js | 55 ++++++++++++ ..._configs_service.get_game_server_config.js | 54 ++++++++++++ ...onfigs_service.list_game_server_configs.js | 77 +++++++++++++++++ ...s_service.create_game_server_deployment.js | 65 ++++++++++++++ ...s_service.delete_game_server_deployment.js | 55 ++++++++++++ ...loyments_service.fetch_deployment_state.js | 54 ++++++++++++ ...ents_service.get_game_server_deployment.js | 54 ++++++++++++ ...vice.get_game_server_deployment_rollout.js | 54 ++++++++++++ ...ts_service.list_game_server_deployments.js | 78 +++++++++++++++++ ....preview_game_server_deployment_rollout.js | 67 +++++++++++++++ ...s_service.update_game_server_deployment.js | 62 +++++++++++++ ...e.update_game_server_deployment_rollout.js | 64 ++++++++++++++ .../v1/realms_service.create_realm.js | 64 ++++++++++++++ .../v1/realms_service.delete_realm.js | 54 ++++++++++++ .../generated/v1/realms_service.get_realm.js | 53 ++++++++++++ .../v1/realms_service.list_realms.js | 77 +++++++++++++++++ .../v1/realms_service.preview_realm_update.js | 64 ++++++++++++++ .../v1/realms_service.update_realm.js | 61 +++++++++++++ ...ters_service.create_game_server_cluster.js | 65 ++++++++++++++ ...ters_service.delete_game_server_cluster.js | 55 ++++++++++++ ...lusters_service.get_game_server_cluster.js | 54 ++++++++++++ ...sters_service.list_game_server_clusters.js | 78 +++++++++++++++++ ...vice.preview_create_game_server_cluster.js | 68 +++++++++++++++ ...vice.preview_delete_game_server_cluster.js | 58 +++++++++++++ ...vice.preview_update_game_server_cluster.js | 67 +++++++++++++++ ...ters_service.update_game_server_cluster.js | 64 ++++++++++++++ ...nfigs_service.create_game_server_config.js | 65 ++++++++++++++ ...nfigs_service.delete_game_server_config.js | 55 ++++++++++++ ..._configs_service.get_game_server_config.js | 54 ++++++++++++ ...onfigs_service.list_game_server_configs.js | 78 +++++++++++++++++ ...s_service.create_game_server_deployment.js | 65 ++++++++++++++ ...s_service.delete_game_server_deployment.js | 55 ++++++++++++ ...loyments_service.fetch_deployment_state.js | 54 ++++++++++++ ...ents_service.get_game_server_deployment.js | 55 ++++++++++++ ...vice.get_game_server_deployment_rollout.js | 55 ++++++++++++ ...ts_service.list_game_server_deployments.js | 78 +++++++++++++++++ ....preview_game_server_deployment_rollout.js | 69 +++++++++++++++ ...s_service.update_game_server_deployment.js | 64 ++++++++++++++ ...e.update_game_server_deployment_rollout.js | 66 ++++++++++++++ .../v1beta/realms_service.create_realm.js | 64 ++++++++++++++ .../v1beta/realms_service.delete_realm.js | 54 ++++++++++++ .../v1beta/realms_service.get_realm.js | 53 ++++++++++++ .../v1beta/realms_service.list_realms.js | 77 +++++++++++++++++ .../realms_service.preview_realm_update.js | 66 ++++++++++++++ .../v1beta/realms_service.update_realm.js | 63 ++++++++++++++ .../google-cloud-gaming/samples/package.json | 2 +- .../v1/game_server_clusters_service_client.ts | 6 +- .../v1/game_server_configs_service_client.ts | 6 +- .../game_server_deployments_service_client.ts | 6 +- .../src/v1/realms_service_client.ts | 6 +- .../game_server_clusters_service_client.ts | 6 +- .../game_server_configs_service_client.ts | 6 +- .../game_server_deployments_service_client.ts | 6 +- .../src/v1beta/realms_service_client.ts | 6 +- 63 files changed, 3436 insertions(+), 17 deletions(-) create mode 100644 packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.create_game_server_cluster.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.delete_game_server_cluster.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.get_game_server_cluster.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.list_game_server_clusters.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_create_game_server_cluster.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_delete_game_server_cluster.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_update_game_server_cluster.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.update_game_server_cluster.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.create_game_server_config.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.delete_game_server_config.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.get_game_server_config.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.list_game_server_configs.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.create_game_server_deployment.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.delete_game_server_deployment.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.fetch_deployment_state.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.get_game_server_deployment.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.get_game_server_deployment_rollout.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.list_game_server_deployments.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.preview_game_server_deployment_rollout.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.update_game_server_deployment.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.update_game_server_deployment_rollout.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/realms_service.create_realm.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/realms_service.delete_realm.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/realms_service.get_realm.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/realms_service.list_realms.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/realms_service.preview_realm_update.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1/realms_service.update_realm.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.create_game_server_cluster.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.delete_game_server_cluster.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.get_game_server_cluster.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.list_game_server_clusters.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_create_game_server_cluster.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_delete_game_server_cluster.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_update_game_server_cluster.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.update_game_server_cluster.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.create_game_server_config.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.delete_game_server_config.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.get_game_server_config.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.list_game_server_configs.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.create_game_server_deployment.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.delete_game_server_deployment.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.fetch_deployment_state.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.get_game_server_deployment.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.get_game_server_deployment_rollout.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.list_game_server_deployments.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.preview_game_server_deployment_rollout.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.update_game_server_deployment.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.update_game_server_deployment_rollout.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/realms_service.create_realm.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/realms_service.delete_realm.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/realms_service.get_realm.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/realms_service.list_realms.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/realms_service.preview_realm_update.js create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/realms_service.update_realm.js 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..86db5d71b11 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.create_game_server_cluster.js @@ -0,0 +1,65 @@ +// 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. + +'use strict'; + +function main(parent, gameServerClusterId, gameServerCluster) { + // [START gameservices_v1_generated_GameServerClustersService_CreateGameServerCluster_async] + /** + * 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 createGameServerCluster() { + // Construct request + const request = { + parent, + gameServerClusterId, + gameServerCluster, + }; + + // Run request + const [operation] = await gamingClient.createGameServerCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + createGameServerCluster(); + // [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..fb1fc076182 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.delete_game_server_cluster.js @@ -0,0 +1,55 @@ +// 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. + +'use strict'; + +function main(name) { + // [START gameservices_v1_generated_GameServerClustersService_DeleteGameServerCluster_async] + /** + * 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 deleteGameServerCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteGameServerCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteGameServerCluster(); + // [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..c74cc5ccc72 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.get_game_server_cluster.js @@ -0,0 +1,63 @@ +// 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. + +'use strict'; + +function main(name) { + // [START gameservices_v1_generated_GameServerClustersService_GetGameServerCluster_async] + /** + * 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 getGameServerCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerCluster(request); + console.log(response); + } + + getGameServerCluster(); + // [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..4d78ff56fb3 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.list_game_server_clusters.js @@ -0,0 +1,86 @@ +// 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. + +'use strict'; + +function main(parent) { + // [START gameservices_v1_generated_GameServerClustersService_ListGameServerClusters_async] + /** + * 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 listGameServerClusters() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listGameServerClustersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listGameServerClusters(); + // [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..43871a84236 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_create_game_server_cluster.js @@ -0,0 +1,73 @@ +// 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. + +'use strict'; + +function main(parent, gameServerClusterId, gameServerCluster) { + // [START gameservices_v1_generated_GameServerClustersService_PreviewCreateGameServerCluster_async] + /** + * 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 previewCreateGameServerCluster() { + // Construct request + const request = { + parent, + gameServerClusterId, + gameServerCluster, + }; + + // Run request + const response = await gamingClient.previewCreateGameServerCluster(request); + console.log(response); + } + + previewCreateGameServerCluster(); + // [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..00e7ddfb632 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_delete_game_server_cluster.js @@ -0,0 +1,58 @@ +// 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. + +'use strict'; + +function main(name) { + // [START gameservices_v1_generated_GameServerClustersService_PreviewDeleteGameServerCluster_async] + /** + * 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 previewDeleteGameServerCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.previewDeleteGameServerCluster(request); + console.log(response); + } + + previewDeleteGameServerCluster(); + // [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..5393942098a --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_update_game_server_cluster.js @@ -0,0 +1,65 @@ +// 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. + +'use strict'; + +function main(gameServerCluster, updateMask) { + // [START gameservices_v1_generated_GameServerClustersService_PreviewUpdateGameServerCluster_async] + /** + * 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 previewUpdateGameServerCluster() { + // Construct request + const request = { + gameServerCluster, + updateMask, + }; + + // Run request + const response = await gamingClient.previewUpdateGameServerCluster(request); + console.log(response); + } + + previewUpdateGameServerCluster(); + // [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..839dcdb2801 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.update_game_server_cluster.js @@ -0,0 +1,62 @@ +// 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. + +'use strict'; + +function main(gameServerCluster, updateMask) { + // [START gameservices_v1_generated_GameServerClustersService_UpdateGameServerCluster_async] + /** + * 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 updateGameServerCluster() { + // Construct request + const request = { + gameServerCluster, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateGameServerCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + updateGameServerCluster(); + // [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..1bba8737876 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.create_game_server_config.js @@ -0,0 +1,65 @@ +// 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. + +'use strict'; + +function main(parent, configId, gameServerConfig) { + // [START gameservices_v1_generated_GameServerConfigsService_CreateGameServerConfig_async] + /** + * 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 createGameServerConfig() { + // Construct request + const request = { + parent, + configId, + gameServerConfig, + }; + + // Run request + const [operation] = await gamingClient.createGameServerConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + createGameServerConfig(); + // [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..338f504ec09 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.delete_game_server_config.js @@ -0,0 +1,55 @@ +// 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. + +'use strict'; + +function main(name) { + // [START gameservices_v1_generated_GameServerConfigsService_DeleteGameServerConfig_async] + /** + * 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 deleteGameServerConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteGameServerConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteGameServerConfig(); + // [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..f49e46065dd --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.get_game_server_config.js @@ -0,0 +1,54 @@ +// 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. + +'use strict'; + +function main(name) { + // [START gameservices_v1_generated_GameServerConfigsService_GetGameServerConfig_async] + /** + * 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 getGameServerConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerConfig(request); + console.log(response); + } + + getGameServerConfig(); + // [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..8cd6207c2f8 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.list_game_server_configs.js @@ -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. + +'use strict'; + +function main(parent) { + // [START gameservices_v1_generated_GameServerConfigsService_ListGameServerConfigs_async] + /** + * 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 listGameServerConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listGameServerConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listGameServerConfigs(); + // [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..49404fc8220 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.create_game_server_deployment.js @@ -0,0 +1,65 @@ +// 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. + +'use strict'; + +function main(parent, deploymentId, gameServerDeployment) { + // [START gameservices_v1_generated_GameServerDeploymentsService_CreateGameServerDeployment_async] + /** + * 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 createGameServerDeployment() { + // Construct request + const request = { + parent, + deploymentId, + gameServerDeployment, + }; + + // Run request + const [operation] = await gamingClient.createGameServerDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + createGameServerDeployment(); + // [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..7490fae3136 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.delete_game_server_deployment.js @@ -0,0 +1,55 @@ +// 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. + +'use strict'; + +function main(name) { + // [START gameservices_v1_generated_GameServerDeploymentsService_DeleteGameServerDeployment_async] + /** + * 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 deleteGameServerDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteGameServerDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteGameServerDeployment(); + // [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..bbc19ee7856 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.fetch_deployment_state.js @@ -0,0 +1,54 @@ +// 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. + +'use strict'; + +function main(name) { + // [START gameservices_v1_generated_GameServerDeploymentsService_FetchDeploymentState_async] + /** + * 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 fetchDeploymentState() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.fetchDeploymentState(request); + console.log(response); + } + + fetchDeploymentState(); + // [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..3137207f200 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.get_game_server_deployment.js @@ -0,0 +1,54 @@ +// 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. + +'use strict'; + +function main(name) { + // [START gameservices_v1_generated_GameServerDeploymentsService_GetGameServerDeployment_async] + /** + * 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 getGameServerDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerDeployment(request); + console.log(response); + } + + getGameServerDeployment(); + // [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..596aeeb55da --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.get_game_server_deployment_rollout.js @@ -0,0 +1,54 @@ +// 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. + +'use strict'; + +function main(name) { + // [START gameservices_v1_generated_GameServerDeploymentsService_GetGameServerDeploymentRollout_async] + /** + * 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 getGameServerDeploymentRollout() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerDeploymentRollout(request); + console.log(response); + } + + getGameServerDeploymentRollout(); + // [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..122ff09ded6 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.list_game_server_deployments.js @@ -0,0 +1,78 @@ +// 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. + +'use strict'; + +function main(parent) { + // [START gameservices_v1_generated_GameServerDeploymentsService_ListGameServerDeployments_async] + /** + * 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 listGameServerDeployments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listGameServerDeploymentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listGameServerDeployments(); + // [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..f17b9bf4a02 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.preview_game_server_deployment_rollout.js @@ -0,0 +1,67 @@ +// 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. + +'use strict'; + +function main(rollout) { + // [START gameservices_v1_generated_GameServerDeploymentsService_PreviewGameServerDeploymentRollout_async] + /** + * 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 previewGameServerDeploymentRollout() { + // Construct request + const request = { + rollout, + }; + + // Run request + const response = await gamingClient.previewGameServerDeploymentRollout( + request + ); + console.log(response); + } + + previewGameServerDeploymentRollout(); + // [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..4e9a5482e87 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.update_game_server_deployment.js @@ -0,0 +1,62 @@ +// 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. + +'use strict'; + +function main(gameServerDeployment, updateMask) { + // [START gameservices_v1_generated_GameServerDeploymentsService_UpdateGameServerDeployment_async] + /** + * 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 updateGameServerDeployment() { + // Construct request + const request = { + gameServerDeployment, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateGameServerDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + updateGameServerDeployment(); + // [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..44d9a90797f --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.update_game_server_deployment_rollout.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 +// +// 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'; + +function main(rollout, updateMask) { + // [START gameservices_v1_generated_GameServerDeploymentsService_UpdateGameServerDeploymentRollout_async] + /** + * 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 updateGameServerDeploymentRollout() { + // Construct request + const request = { + rollout, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateGameServerDeploymentRollout( + request + ); + const [response] = await operation.promise(); + console.log(response); + } + + updateGameServerDeploymentRollout(); + // [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..1cf5a86c927 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/realms_service.create_realm.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 +// +// 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'; + +function main(parent, realmId, realm) { + // [START gameservices_v1_generated_RealmsService_CreateRealm_async] + /** + * 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 createRealm() { + // Construct request + const request = { + parent, + realmId, + realm, + }; + + // Run request + const [operation] = await gamingClient.createRealm(request); + const [response] = await operation.promise(); + console.log(response); + } + + createRealm(); + // [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..dcfcd99bf3e --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/realms_service.delete_realm.js @@ -0,0 +1,54 @@ +// 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. + +'use strict'; + +function main(name) { + // [START gameservices_v1_generated_RealmsService_DeleteRealm_async] + /** + * 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 deleteRealm() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteRealm(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteRealm(); + // [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..9858e1d77ac --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/realms_service.get_realm.js @@ -0,0 +1,53 @@ +// 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. + +'use strict'; + +function main(name) { + // [START gameservices_v1_generated_RealmsService_GetRealm_async] + /** + * 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 getRealm() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getRealm(request); + console.log(response); + } + + getRealm(); + // [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..c78d60d7900 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/realms_service.list_realms.js @@ -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. + +'use strict'; + +function main(parent) { + // [START gameservices_v1_generated_RealmsService_ListRealms_async] + /** + * 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 listRealms() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listRealmsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listRealms(); + // [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..e0d48f22067 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/realms_service.preview_realm_update.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 +// +// 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'; + +function main(realm, updateMask) { + // [START gameservices_v1_generated_RealmsService_PreviewRealmUpdate_async] + /** + * 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 previewRealmUpdate() { + // Construct request + const request = { + realm, + updateMask, + }; + + // Run request + const response = await gamingClient.previewRealmUpdate(request); + console.log(response); + } + + previewRealmUpdate(); + // [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..e6d6bae74d9 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1/realms_service.update_realm.js @@ -0,0 +1,61 @@ +// 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. + +'use strict'; + +function main(realm, updateMask) { + // [START gameservices_v1_generated_RealmsService_UpdateRealm_async] + /** + * 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 updateRealm() { + // Construct request + const request = { + realm, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateRealm(request); + const [response] = await operation.promise(); + console.log(response); + } + + updateRealm(); + // [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/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..2ee63e67121 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.create_game_server_cluster.js @@ -0,0 +1,65 @@ +// 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. + +'use strict'; + +function main(parent, gameServerClusterId, gameServerCluster) { + // [START gameservices_v1beta_generated_GameServerClustersService_CreateGameServerCluster_async] + /** + * 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 createGameServerCluster() { + // Construct request + const request = { + parent, + gameServerClusterId, + gameServerCluster, + }; + + // Run request + const [operation] = await gamingClient.createGameServerCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + createGameServerCluster(); + // [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..082e32d1c80 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.delete_game_server_cluster.js @@ -0,0 +1,55 @@ +// 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. + +'use strict'; + +function main(name) { + // [START gameservices_v1beta_generated_GameServerClustersService_DeleteGameServerCluster_async] + /** + * 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 deleteGameServerCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteGameServerCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteGameServerCluster(); + // [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..1d3b65cd002 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.get_game_server_cluster.js @@ -0,0 +1,54 @@ +// 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. + +'use strict'; + +function main(name) { + // [START gameservices_v1beta_generated_GameServerClustersService_GetGameServerCluster_async] + /** + * 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 getGameServerCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerCluster(request); + console.log(response); + } + + getGameServerCluster(); + // [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..39fdeb1a32a --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.list_game_server_clusters.js @@ -0,0 +1,78 @@ +// 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. + +'use strict'; + +function main(parent) { + // [START gameservices_v1beta_generated_GameServerClustersService_ListGameServerClusters_async] + /** + * 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 listGameServerClusters() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listGameServerClustersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listGameServerClusters(); + // [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..b0db2425fbc --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_create_game_server_cluster.js @@ -0,0 +1,68 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent, gameServerClusterId, gameServerCluster) { + // [START gameservices_v1beta_generated_GameServerClustersService_PreviewCreateGameServerCluster_async] + /** + * 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 previewCreateGameServerCluster() { + // Construct request + const request = { + parent, + gameServerClusterId, + gameServerCluster, + }; + + // Run request + const response = await gamingClient.previewCreateGameServerCluster(request); + console.log(response); + } + + previewCreateGameServerCluster(); + // [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..343ce923977 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_delete_game_server_cluster.js @@ -0,0 +1,58 @@ +// 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. + +'use strict'; + +function main(name) { + // [START gameservices_v1beta_generated_GameServerClustersService_PreviewDeleteGameServerCluster_async] + /** + * 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 previewDeleteGameServerCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.previewDeleteGameServerCluster(request); + console.log(response); + } + + previewDeleteGameServerCluster(); + // [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..4b8c891903e --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.preview_update_game_server_cluster.js @@ -0,0 +1,67 @@ +// 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. + +'use strict'; + +function main(gameServerCluster, updateMask) { + // [START gameservices_v1beta_generated_GameServerClustersService_PreviewUpdateGameServerCluster_async] + /** + * 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 previewUpdateGameServerCluster() { + // Construct request + const request = { + gameServerCluster, + updateMask, + }; + + // Run request + const response = await gamingClient.previewUpdateGameServerCluster(request); + console.log(response); + } + + previewUpdateGameServerCluster(); + // [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..f876ea73c31 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_clusters_service.update_game_server_cluster.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 +// +// 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'; + +function main(gameServerCluster, updateMask) { + // [START gameservices_v1beta_generated_GameServerClustersService_UpdateGameServerCluster_async] + /** + * 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 updateGameServerCluster() { + // Construct request + const request = { + gameServerCluster, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateGameServerCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + updateGameServerCluster(); + // [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..a1f8b4aadf1 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.create_game_server_config.js @@ -0,0 +1,65 @@ +// 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. + +'use strict'; + +function main(parent, configId, gameServerConfig) { + // [START gameservices_v1beta_generated_GameServerConfigsService_CreateGameServerConfig_async] + /** + * 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 createGameServerConfig() { + // Construct request + const request = { + parent, + configId, + gameServerConfig, + }; + + // Run request + const [operation] = await gamingClient.createGameServerConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + createGameServerConfig(); + // [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..cf3e70ff6e0 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.delete_game_server_config.js @@ -0,0 +1,55 @@ +// 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. + +'use strict'; + +function main(name) { + // [START gameservices_v1beta_generated_GameServerConfigsService_DeleteGameServerConfig_async] + /** + * 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 deleteGameServerConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteGameServerConfig(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteGameServerConfig(); + // [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..3d6415c0313 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.get_game_server_config.js @@ -0,0 +1,54 @@ +// 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. + +'use strict'; + +function main(name) { + // [START gameservices_v1beta_generated_GameServerConfigsService_GetGameServerConfig_async] + /** + * 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 getGameServerConfig() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerConfig(request); + console.log(response); + } + + getGameServerConfig(); + // [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..fa8c9cc0d2a --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_configs_service.list_game_server_configs.js @@ -0,0 +1,78 @@ +// 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. + +'use strict'; + +function main(parent) { + // [START gameservices_v1beta_generated_GameServerConfigsService_ListGameServerConfigs_async] + /** + * 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 listGameServerConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listGameServerConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listGameServerConfigs(); + // [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..bace431d64a --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.create_game_server_deployment.js @@ -0,0 +1,65 @@ +// 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. + +'use strict'; + +function main(parent, deploymentId, gameServerDeployment) { + // [START gameservices_v1beta_generated_GameServerDeploymentsService_CreateGameServerDeployment_async] + /** + * 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 createGameServerDeployment() { + // Construct request + const request = { + parent, + deploymentId, + gameServerDeployment, + }; + + // Run request + const [operation] = await gamingClient.createGameServerDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + createGameServerDeployment(); + // [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..ecc1cad27d7 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.delete_game_server_deployment.js @@ -0,0 +1,55 @@ +// 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. + +'use strict'; + +function main(name) { + // [START gameservices_v1beta_generated_GameServerDeploymentsService_DeleteGameServerDeployment_async] + /** + * 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 deleteGameServerDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteGameServerDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteGameServerDeployment(); + // [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..f869cfb4f9b --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.fetch_deployment_state.js @@ -0,0 +1,54 @@ +// 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. + +'use strict'; + +function main(name) { + // [START gameservices_v1beta_generated_GameServerDeploymentsService_FetchDeploymentState_async] + /** + * 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 fetchDeploymentState() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.fetchDeploymentState(request); + console.log(response); + } + + fetchDeploymentState(); + // [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..d50635d3864 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.get_game_server_deployment.js @@ -0,0 +1,55 @@ +// 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. + +'use strict'; + +function main(name) { + // [START gameservices_v1beta_generated_GameServerDeploymentsService_GetGameServerDeployment_async] + /** + * 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 getGameServerDeployment() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerDeployment(request); + console.log(response); + } + + getGameServerDeployment(); + // [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..3eb5c2cc609 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.get_game_server_deployment_rollout.js @@ -0,0 +1,55 @@ +// 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. + +'use strict'; + +function main(name) { + // [START gameservices_v1beta_generated_GameServerDeploymentsService_GetGameServerDeploymentRollout_async] + /** + * 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 getGameServerDeploymentRollout() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getGameServerDeploymentRollout(request); + console.log(response); + } + + getGameServerDeploymentRollout(); + // [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..5b63f101eca --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.list_game_server_deployments.js @@ -0,0 +1,78 @@ +// 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. + +'use strict'; + +function main(parent) { + // [START gameservices_v1beta_generated_GameServerDeploymentsService_ListGameServerDeployments_async] + /** + * 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 listGameServerDeployments() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listGameServerDeploymentsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listGameServerDeployments(); + // [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..234c777e019 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.preview_game_server_deployment_rollout.js @@ -0,0 +1,69 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(rollout) { + // [START gameservices_v1beta_generated_GameServerDeploymentsService_PreviewGameServerDeploymentRollout_async] + /** + * 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 previewGameServerDeploymentRollout() { + // Construct request + const request = { + rollout, + }; + + // Run request + const response = await gamingClient.previewGameServerDeploymentRollout( + request + ); + console.log(response); + } + + previewGameServerDeploymentRollout(); + // [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..46ac7919641 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.update_game_server_deployment.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 +// +// 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'; + +function main(gameServerDeployment, updateMask) { + // [START gameservices_v1beta_generated_GameServerDeploymentsService_UpdateGameServerDeployment_async] + /** + * 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 updateGameServerDeployment() { + // Construct request + const request = { + gameServerDeployment, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateGameServerDeployment(request); + const [response] = await operation.promise(); + console.log(response); + } + + updateGameServerDeployment(); + // [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..3599b1b373b --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.update_game_server_deployment_rollout.js @@ -0,0 +1,66 @@ +// 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. + +'use strict'; + +function main(rollout, updateMask) { + // [START gameservices_v1beta_generated_GameServerDeploymentsService_UpdateGameServerDeploymentRollout_async] + /** + * 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 updateGameServerDeploymentRollout() { + // Construct request + const request = { + rollout, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateGameServerDeploymentRollout( + request + ); + const [response] = await operation.promise(); + console.log(response); + } + + updateGameServerDeploymentRollout(); + // [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..7f57922ea23 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.create_realm.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 +// +// 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'; + +function main(parent, realmId, realm) { + // [START gameservices_v1beta_generated_RealmsService_CreateRealm_async] + /** + * 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 createRealm() { + // Construct request + const request = { + parent, + realmId, + realm, + }; + + // Run request + const [operation] = await gamingClient.createRealm(request); + const [response] = await operation.promise(); + console.log(response); + } + + createRealm(); + // [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..6fac763ee67 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.delete_realm.js @@ -0,0 +1,54 @@ +// 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. + +'use strict'; + +function main(name) { + // [START gameservices_v1beta_generated_RealmsService_DeleteRealm_async] + /** + * 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 deleteRealm() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await gamingClient.deleteRealm(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteRealm(); + // [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..c730f3260cf --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.get_realm.js @@ -0,0 +1,53 @@ +// 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. + +'use strict'; + +function main(name) { + // [START gameservices_v1beta_generated_RealmsService_GetRealm_async] + /** + * 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 getRealm() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await gamingClient.getRealm(request); + console.log(response); + } + + getRealm(); + // [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..bd56b4deff9 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.list_realms.js @@ -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. + +'use strict'; + +function main(parent) { + // [START gameservices_v1beta_generated_RealmsService_ListRealms_async] + /** + * 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 listRealms() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await gamingClient.listRealmsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listRealms(); + // [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..1958e72b108 --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.preview_realm_update.js @@ -0,0 +1,66 @@ +// 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. + +'use strict'; + +function main(realm, updateMask) { + // [START gameservices_v1beta_generated_RealmsService_PreviewRealmUpdate_async] + /** + * 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 previewRealmUpdate() { + // Construct request + const request = { + realm, + updateMask, + }; + + // Run request + const response = await gamingClient.previewRealmUpdate(request); + console.log(response); + } + + previewRealmUpdate(); + // [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..cbcceb69a6c --- /dev/null +++ b/packages/google-cloud-gaming/samples/generated/v1beta/realms_service.update_realm.js @@ -0,0 +1,63 @@ +// 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. + +'use strict'; + +function main(realm, updateMask) { + // [START gameservices_v1beta_generated_RealmsService_UpdateRealm_async] + /** + * 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 updateRealm() { + // Construct request + const request = { + realm, + updateMask, + }; + + // Run request + const [operation] = await gamingClient.updateRealm(request); + const [response] = await operation.promise(); + console.log(response); + } + + updateRealm(); + // [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/package.json b/packages/google-cloud-gaming/samples/package.json index 2ea3f59a0bf..589bce6b6a4 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=8" + "node": ">=10" }, "files": [ "*.js" 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 index da7771fb7ea..9679776f356 100644 --- 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 @@ -1442,7 +1442,8 @@ export class GameServerClustersServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listGameServerClusters']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGameServerClusters.createStream( this.innerApiCalls.listGameServerClusters as gax.GaxCall, @@ -1509,7 +1510,8 @@ export class GameServerClustersServiceClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listGameServerClusters']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGameServerClusters.asyncIterate( this.innerApiCalls['listGameServerClusters'] as GaxCall, 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 index 8956e053f1a..56a2584454b 100644 --- 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 @@ -926,7 +926,8 @@ export class GameServerConfigsServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listGameServerConfigs']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGameServerConfigs.createStream( this.innerApiCalls.listGameServerConfigs as gax.GaxCall, @@ -986,7 +987,8 @@ export class GameServerConfigsServiceClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listGameServerConfigs']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGameServerConfigs.asyncIterate( this.innerApiCalls['listGameServerConfigs'] as GaxCall, 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 index c6887459783..ec82e53ae2e 100644 --- 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 @@ -1581,7 +1581,8 @@ export class GameServerDeploymentsServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listGameServerDeployments']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGameServerDeployments.createStream( this.innerApiCalls.listGameServerDeployments as gax.GaxCall, @@ -1642,7 +1643,8 @@ export class GameServerDeploymentsServiceClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listGameServerDeployments']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGameServerDeployments.asyncIterate( this.innerApiCalls['listGameServerDeployments'] as GaxCall, diff --git a/packages/google-cloud-gaming/src/v1/realms_service_client.ts b/packages/google-cloud-gaming/src/v1/realms_service_client.ts index 8113e251dab..8fd92935b01 100644 --- a/packages/google-cloud-gaming/src/v1/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1/realms_service_client.ts @@ -1149,7 +1149,8 @@ export class RealmsServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listRealms']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listRealms.createStream( this.innerApiCalls.listRealms as gax.GaxCall, @@ -1210,7 +1211,8 @@ export class RealmsServiceClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listRealms']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listRealms.asyncIterate( this.innerApiCalls['listRealms'] as GaxCall, 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 index 00707802a2b..ca8066d158f 100644 --- 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 @@ -1433,7 +1433,8 @@ export class GameServerClustersServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listGameServerClusters']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGameServerClusters.createStream( this.innerApiCalls.listGameServerClusters as gax.GaxCall, @@ -1494,7 +1495,8 @@ export class GameServerClustersServiceClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listGameServerClusters']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGameServerClusters.asyncIterate( this.innerApiCalls['listGameServerClusters'] as GaxCall, 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 index 370d2d30376..40270037056 100644 --- 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 @@ -934,7 +934,8 @@ export class GameServerConfigsServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listGameServerConfigs']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGameServerConfigs.createStream( this.innerApiCalls.listGameServerConfigs as gax.GaxCall, @@ -996,7 +997,8 @@ export class GameServerConfigsServiceClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listGameServerConfigs']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGameServerConfigs.asyncIterate( this.innerApiCalls['listGameServerConfigs'] as GaxCall, 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 index 2ef156cbd25..e6216176129 100644 --- 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 @@ -1608,7 +1608,8 @@ export class GameServerDeploymentsServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listGameServerDeployments']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGameServerDeployments.createStream( this.innerApiCalls.listGameServerDeployments as gax.GaxCall, @@ -1669,7 +1670,8 @@ export class GameServerDeploymentsServiceClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listGameServerDeployments']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGameServerDeployments.asyncIterate( this.innerApiCalls['listGameServerDeployments'] as GaxCall, diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index cf5498bb7d9..9c36fb737d0 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -1157,7 +1157,8 @@ export class RealmsServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listRealms']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listRealms.createStream( this.innerApiCalls.listRealms as gax.GaxCall, @@ -1218,7 +1219,8 @@ export class RealmsServiceClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listRealms']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listRealms.asyncIterate( this.innerApiCalls['listRealms'] as GaxCall, From 8aa9aa8558c865ef60da2994ccbc7e90e496decc Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 14 Oct 2021 00:46:17 +0000 Subject: [PATCH 131/180] build(node): update deps used during postprocessing (#1243) (#224) --- packages/google-cloud-gaming/protos/protos.d.ts | 3 ++- packages/google-cloud-gaming/protos/protos.js | 7 +++++++ packages/google-cloud-gaming/protos/protos.json | 15 ++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/protos/protos.d.ts b/packages/google-cloud-gaming/protos/protos.d.ts index 7ea0df8d539..02208925f8b 100644 --- a/packages/google-cloud-gaming/protos/protos.d.ts +++ b/packages/google-cloud-gaming/protos/protos.d.ts @@ -14344,7 +14344,8 @@ export namespace google { OUTPUT_ONLY = 3, INPUT_ONLY = 4, IMMUTABLE = 5, - UNORDERED_LIST = 6 + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 } /** Properties of a Http. */ diff --git a/packages/google-cloud-gaming/protos/protos.js b/packages/google-cloud-gaming/protos/protos.js index 60f5fee002c..740f8ec9a8e 100644 --- a/packages/google-cloud-gaming/protos/protos.js +++ b/packages/google-cloud-gaming/protos/protos.js @@ -33619,6 +33619,7 @@ * @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); @@ -33629,6 +33630,7 @@ 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; })(); @@ -40701,6 +40703,7 @@ case 4: case 5: case 6: + case 7: break; } } @@ -40805,6 +40808,10 @@ 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) { diff --git a/packages/google-cloud-gaming/protos/protos.json b/packages/google-cloud-gaming/protos/protos.json index 602216ef186..3cbb9d34c73 100644 --- a/packages/google-cloud-gaming/protos/protos.json +++ b/packages/google-cloud-gaming/protos/protos.json @@ -4068,7 +4068,8 @@ "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, "IMMUTABLE": 5, - "UNORDERED_LIST": 6 + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 } }, "http": { @@ -4814,6 +4815,18 @@ ] ], "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], [ 8, 8 From 7043db351acc02efb2c4613df5ac29afdc054f4e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 26 Oct 2021 23:19:09 +0200 Subject: [PATCH 132/180] chore(deps): update dependency @types/node to v16 (#225) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^14.0.0` -> `^16.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/14.17.32/16.11.6) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/compatibility-slim/14.17.32)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/confidence-slim/14.17.32)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 3a771dbeb9b..878aac6217b 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -31,7 +31,7 @@ }, "devDependencies": { "@types/mocha": "^8.0.0", - "@types/node": "^14.0.0", + "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.0.0", "gts": "^2.0.0", From fdbb5ae536ce78b4fb4314c2d09055d91ea4d529 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Wed, 3 Nov 2021 11:52:17 -0400 Subject: [PATCH 133/180] chore(cloud-rad): delete api-extractor config (#226) --- .../google-cloud-gaming/api-extractor.json | 369 ------------------ 1 file changed, 369 deletions(-) delete mode 100644 packages/google-cloud-gaming/api-extractor.json diff --git a/packages/google-cloud-gaming/api-extractor.json b/packages/google-cloud-gaming/api-extractor.json deleted file mode 100644 index de228294b23..00000000000 --- a/packages/google-cloud-gaming/api-extractor.json +++ /dev/null @@ -1,369 +0,0 @@ -/** - * Config file for API Extractor. For more info, please visit: https://api-extractor.com - */ -{ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - - /** - * Optionally specifies another JSON config file that this file extends from. This provides a way for - * standard settings to be shared across multiple projects. - * - * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains - * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be - * resolved using NodeJS require(). - * - * SUPPORTED TOKENS: none - * DEFAULT VALUE: "" - */ - // "extends": "./shared/api-extractor-base.json" - // "extends": "my-package/include/api-extractor-base.json" - - /** - * Determines the "" token that can be used with other config file settings. The project folder - * typically contains the tsconfig.json and package.json config files, but the path is user-defined. - * - * The path is resolved relative to the folder of the config file that contains the setting. - * - * The default value for "projectFolder" is the token "", which means the folder is determined by traversing - * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder - * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error - * will be reported. - * - * SUPPORTED TOKENS: - * DEFAULT VALUE: "" - */ - // "projectFolder": "..", - - /** - * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor - * analyzes the symbols exported by this module. - * - * The file extension must be ".d.ts" and not ".ts". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - */ - "mainEntryPointFilePath": "/protos/protos.d.ts", - - /** - * A list of NPM package names whose exports should be treated as part of this package. - * - * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", - * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part - * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly - * imports library2. To avoid this, we can specify: - * - * "bundledPackages": [ "library2" ], - * - * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been - * local files for library1. - */ - "bundledPackages": [ ], - - /** - * Determines how the TypeScript compiler engine will be invoked by API Extractor. - */ - "compiler": { - /** - * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * Note: This setting will be ignored if "overrideTsconfig" is used. - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/tsconfig.json" - */ - // "tsconfigFilePath": "/tsconfig.json", - - /** - * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. - * The object must conform to the TypeScript tsconfig schema: - * - * http://json.schemastore.org/tsconfig - * - * If omitted, then the tsconfig.json file will be read from the "projectFolder". - * - * DEFAULT VALUE: no overrideTsconfig section - */ - // "overrideTsconfig": { - // . . . - // } - - /** - * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended - * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when - * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses - * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. - * - * DEFAULT VALUE: false - */ - // "skipLibCheck": true, - }, - - /** - * Configures how the API report file (*.api.md) will be generated. - */ - "apiReport": { - /** - * (REQUIRED) Whether to generate an API report. - */ - "enabled": true, - - /** - * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce - * a full file path. - * - * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". - * - * SUPPORTED TOKENS: , - * DEFAULT VALUE: ".api.md" - */ - // "reportFileName": ".api.md", - - /** - * Specifies the folder where the API report file is written. The file name portion is determined by - * the "reportFileName" setting. - * - * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, - * e.g. for an API review. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/etc/" - */ - // "reportFolder": "/etc/", - - /** - * Specifies the folder where the temporary report file is written. The file name portion is determined by - * the "reportFileName" setting. - * - * After the temporary file is written to disk, it is compared with the file in the "reportFolder". - * If they are different, a production build will fail. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/temp/" - */ - // "reportTempFolder": "/temp/" - }, - - /** - * Configures how the doc model file (*.api.json) will be generated. - */ - "docModel": { - /** - * (REQUIRED) Whether to generate a doc model file. - */ - "enabled": true, - - /** - * The output path for the doc model file. The file extension should be ".api.json". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/temp/.api.json" - */ - // "apiJsonFilePath": "/temp/.api.json" - }, - - /** - * Configures how the .d.ts rollup file will be generated. - */ - "dtsRollup": { - /** - * (REQUIRED) Whether to generate the .d.ts rollup file. - */ - "enabled": true, - - /** - * Specifies the output path for a .d.ts rollup file to be generated without any trimming. - * This file will include all declarations that are exported by the main entry point. - * - * If the path is an empty string, then this file will not be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "/dist/.d.ts" - */ - // "untrimmedFilePath": "/dist/.d.ts", - - /** - * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. - * This file will include only declarations that are marked as "@public" or "@beta". - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "betaTrimmedFilePath": "/dist/-beta.d.ts", - - - /** - * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. - * This file will include only declarations that are marked as "@public". - * - * If the path is an empty string, then this file will not be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "publicTrimmedFilePath": "/dist/-public.d.ts", - - /** - * When a declaration is trimmed, by default it will be replaced by a code comment such as - * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the - * declaration completely. - * - * DEFAULT VALUE: false - */ - // "omitTrimmingComments": true - }, - - /** - * Configures how the tsdoc-metadata.json file will be generated. - */ - "tsdocMetadata": { - /** - * Whether to generate the tsdoc-metadata.json file. - * - * DEFAULT VALUE: true - */ - // "enabled": true, - - /** - * Specifies where the TSDoc metadata file should be written. - * - * The path is resolved relative to the folder of the config file that contains the setting; to change this, - * prepend a folder token such as "". - * - * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", - * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup - * falls back to "tsdoc-metadata.json" in the package folder. - * - * SUPPORTED TOKENS: , , - * DEFAULT VALUE: "" - */ - // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" - }, - - /** - * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files - * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. - * To use the OS's default newline kind, specify "os". - * - * DEFAULT VALUE: "crlf" - */ - // "newlineKind": "crlf", - - /** - * Configures how API Extractor reports error and warning messages produced during analysis. - * - * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. - */ - "messages": { - /** - * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing - * the input .d.ts files. - * - * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" - * - * DEFAULT VALUE: A single "default" entry with logLevel=warning. - */ - "compilerMessageReporting": { - /** - * Configures the default routing for messages that don't match an explicit rule in this table. - */ - "default": { - /** - * Specifies whether the message should be written to the the tool's output log. Note that - * the "addToApiReportFile" property may supersede this option. - * - * Possible values: "error", "warning", "none" - * - * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail - * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes - * the "--local" option), the warning is displayed but the build will not fail. - * - * DEFAULT VALUE: "warning" - */ - "logLevel": "warning", - - /** - * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), - * then the message will be written inside that file; otherwise, the message is instead logged according to - * the "logLevel" option. - * - * DEFAULT VALUE: false - */ - // "addToApiReportFile": false - }, - - // "TS2551": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . - }, - - /** - * Configures handling of messages reported by API Extractor during its analysis. - * - * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" - * - * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings - */ - "extractorMessageReporting": { - "default": { - "logLevel": "warning", - // "addToApiReportFile": false - }, - - // "ae-extra-release-tag": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . - }, - - /** - * Configures handling of messages reported by the TSDoc parser when analyzing code comments. - * - * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" - * - * DEFAULT VALUE: A single "default" entry with logLevel=warning. - */ - "tsdocMessageReporting": { - "default": { - "logLevel": "warning", - // "addToApiReportFile": false - } - - // "tsdoc-link-tag-unescaped-text": { - // "logLevel": "warning", - // "addToApiReportFile": true - // }, - // - // . . . - } - } - -} From 1bdd957f5074c0c78e73aa578e5fa723be267f33 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 4 Nov 2021 20:42:21 +0100 Subject: [PATCH 134/180] chore(deps): update dependency sinon to v12 (#227) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^11.0.0` -> `^12.0.0`](https://renovatebot.com/diffs/npm/sinon/11.1.2/12.0.1) | [![age](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/compatibility-slim/11.1.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/confidence-slim/11.1.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v12.0.1`](https://togithub.com/sinonjs/sinon/blob/master/CHANGES.md#​1201) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v12.0.0...v12.0.1) - [`3f598221`](https://togithub.com/sinonjs/sinon/commit/3f598221045904681f2b3b3ba1df617ed5e230e3) Fix issue with npm unlink for npm version > 6 (Carl-Erik Kopseng) > 'npm unlink' would implicitly unlink the current dir > until version 7, which requires an argument - [`51417a38`](https://togithub.com/sinonjs/sinon/commit/51417a38111eeeb7cd14338bfb762cc2df487e1b) Fix bundling of cjs module ([#​2412](https://togithub.com/sinonjs/sinon/issues/2412)) (Julian Grinblat) > - Fix bundling of cjs module > > - Run prettier *Released by [Carl-Erik Kopseng](https://togithub.com/fatso83) on 2021-11-04.* #### 12.0.0 ### [`v12.0.0`](https://togithub.com/sinonjs/sinon/compare/v11.1.2...v12.0.0) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v11.1.2...v12.0.0)
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 878aac6217b..aa954aa5ef5 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -42,7 +42,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^11.0.0", + "sinon": "^12.0.0", "ts-loader": "^9.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", From 47597597748c7c7e1981a882a7153217f4770609 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 8 Nov 2021 12:46:10 -0800 Subject: [PATCH 135/180] docs: fix docstring formatting (#228) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: fix docstring formatting Committer: @parthea PiperOrigin-RevId: 408383287 Source-Link: https://github.com/googleapis/googleapis/commit/2aec4d0e6fdad7022220f4bbecfe96ecce8a7bab Source-Link: https://github.com/googleapis/googleapis-gen/commit/4c0ec029aa7b2c6a783a73f609428e1dc789a096 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGMwZWMwMjlhYTdiMmM2YTc4M2E3M2Y2MDk0MjhlMWRjNzg5YTA5NiJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../protos/google/cloud/gaming/v1/common.proto | 6 ++++-- .../protos/google/cloud/gaming/v1beta/common.proto | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) 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 index 6469efcddc6..5efe00c97f6 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/common.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/common.proto @@ -100,8 +100,10 @@ message RealmSelector { // 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 +// ``` +// 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; 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 index 159167a469b..cb91571300e 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto @@ -101,8 +101,10 @@ message RealmSelector { // 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 +// ``` +// 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; From 5fdd967bed93bd0fcad959956efb627a0d19a4b0 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 11 Nov 2021 14:46:13 -0800 Subject: [PATCH 136/180] docs(samples): add example tags to generated samples (#229) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(samples): add example tags to generated samples PiperOrigin-RevId: 408439482 Source-Link: https://github.com/googleapis/googleapis/commit/b9f61843dc80c7c285fc34fd3a40aae55082c2b9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/eb888bc214efc7bf43bf4634b470254565a659a5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../linkinator.config.json | 2 +- ...ters_service.create_game_server_cluster.js | 6 +- ...ters_service.delete_game_server_cluster.js | 4 +- ...lusters_service.get_game_server_cluster.js | 6 +- ...sters_service.list_game_server_clusters.js | 8 +- ...vice.preview_create_game_server_cluster.js | 10 +- ...vice.preview_delete_game_server_cluster.js | 6 +- ...vice.preview_update_game_server_cluster.js | 10 +- ...ters_service.update_game_server_cluster.js | 8 +- ...nfigs_service.create_game_server_config.js | 6 +- ...nfigs_service.delete_game_server_config.js | 4 +- ..._configs_service.get_game_server_config.js | 4 +- ...onfigs_service.list_game_server_configs.js | 6 +- ...s_service.create_game_server_deployment.js | 6 +- ...s_service.delete_game_server_deployment.js | 4 +- ...loyments_service.fetch_deployment_state.js | 4 +- ...ents_service.get_game_server_deployment.js | 4 +- ...vice.get_game_server_deployment_rollout.js | 4 +- ...ts_service.list_game_server_deployments.js | 6 +- ....preview_game_server_deployment_rollout.js | 10 +- ...s_service.update_game_server_deployment.js | 8 +- ...e.update_game_server_deployment_rollout.js | 8 +- .../v1/realms_service.create_realm.js | 6 +- .../v1/realms_service.delete_realm.js | 4 +- .../generated/v1/realms_service.get_realm.js | 4 +- .../v1/realms_service.list_realms.js | 6 +- .../v1/realms_service.preview_realm_update.js | 10 +- .../v1/realms_service.update_realm.js | 8 +- ...ters_service.create_game_server_cluster.js | 6 +- ...ters_service.delete_game_server_cluster.js | 4 +- ...lusters_service.get_game_server_cluster.js | 4 +- ...sters_service.list_game_server_clusters.js | 6 +- ...vice.preview_create_game_server_cluster.js | 8 +- ...vice.preview_delete_game_server_cluster.js | 6 +- ...vice.preview_update_game_server_cluster.js | 10 +- ...ters_service.update_game_server_cluster.js | 8 +- ...nfigs_service.create_game_server_config.js | 6 +- ...nfigs_service.delete_game_server_config.js | 4 +- ..._configs_service.get_game_server_config.js | 4 +- ...onfigs_service.list_game_server_configs.js | 6 +- ...s_service.create_game_server_deployment.js | 6 +- ...s_service.delete_game_server_deployment.js | 4 +- ...loyments_service.fetch_deployment_state.js | 4 +- ...ents_service.get_game_server_deployment.js | 4 +- ...vice.get_game_server_deployment_rollout.js | 4 +- ...ts_service.list_game_server_deployments.js | 6 +- ....preview_game_server_deployment_rollout.js | 10 +- ...s_service.update_game_server_deployment.js | 8 +- ...e.update_game_server_deployment_rollout.js | 8 +- .../v1beta/realms_service.create_realm.js | 6 +- .../v1beta/realms_service.delete_realm.js | 4 +- .../v1beta/realms_service.get_realm.js | 4 +- .../v1beta/realms_service.list_realms.js | 6 +- .../realms_service.preview_realm_update.js | 10 +- .../v1beta/realms_service.update_realm.js | 8 +- .../v1/game_server_clusters_service_client.ts | 424 ++++++++------- .../v1/game_server_configs_service_client.ts | 216 ++++---- .../game_server_deployments_service_client.ts | 460 ++++++++-------- .../src/v1/realms_service_client.ts | 306 ++++++----- .../game_server_clusters_service_client.ts | 418 +++++++-------- .../game_server_configs_service_client.ts | 222 ++++---- .../game_server_deployments_service_client.ts | 490 +++++++++--------- .../src/v1beta/realms_service_client.ts | 318 ++++++------ 63 files changed, 1531 insertions(+), 1659 deletions(-) diff --git a/packages/google-cloud-gaming/linkinator.config.json b/packages/google-cloud-gaming/linkinator.config.json index 29a223b6db6..0121dfa684f 100644 --- a/packages/google-cloud-gaming/linkinator.config.json +++ b/packages/google-cloud-gaming/linkinator.config.json @@ -6,5 +6,5 @@ "img.shields.io" ], "silent": true, - "concurrency": 10 + "concurrency": 5 } 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 index 86db5d71b11..9d81d1f4f3e 100644 --- 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 @@ -31,7 +31,7 @@ function main(parent, gameServerClusterId, gameServerCluster) { /** * Required. The game server cluster resource to be created. */ - // const gameServerCluster = '' + // const gameServerCluster = {} // Imports the Gaming library const {GameServerClustersServiceClient} = @@ -40,7 +40,7 @@ function main(parent, gameServerClusterId, gameServerCluster) { // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); - async function createGameServerCluster() { + async function callCreateGameServerCluster() { // Construct request const request = { parent, @@ -54,7 +54,7 @@ function main(parent, gameServerClusterId, gameServerCluster) { console.log(response); } - createGameServerCluster(); + callCreateGameServerCluster(); // [END gameservices_v1_generated_GameServerClustersService_CreateGameServerCluster_async] } 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 index fb1fc076182..08e9c161770 100644 --- 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 @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); - async function deleteGameServerCluster() { + async function callDeleteGameServerCluster() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - deleteGameServerCluster(); + callDeleteGameServerCluster(); // [END gameservices_v1_generated_GameServerClustersService_DeleteGameServerCluster_async] } 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 index c74cc5ccc72..d5b0d7f1b75 100644 --- 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 @@ -32,7 +32,7 @@ function main(name) { * value is GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED, same as BASIC, which does * not return the `cluster_state` field. */ - // const view = '' + // const view = {} // Imports the Gaming library const {GameServerClustersServiceClient} = @@ -41,7 +41,7 @@ function main(name) { // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); - async function getGameServerCluster() { + async function callGetGameServerCluster() { // Construct request const request = { name, @@ -52,7 +52,7 @@ function main(name) { console.log(response); } - getGameServerCluster(); + callGetGameServerCluster(); // [END gameservices_v1_generated_GameServerClustersService_GetGameServerCluster_async] } 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 index 4d78ff56fb3..a600d19ff6e 100644 --- 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 @@ -28,7 +28,7 @@ function main(parent) { * 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 + * 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 @@ -53,7 +53,7 @@ function main(parent) { * value is GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED, same as BASIC, which does * not return the `cluster_state` field. */ - // const view = '' + // const view = {} // Imports the Gaming library const {GameServerClustersServiceClient} = @@ -62,7 +62,7 @@ function main(parent) { // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); - async function listGameServerClusters() { + async function callListGameServerClusters() { // Construct request const request = { parent, @@ -75,7 +75,7 @@ function main(parent) { } } - listGameServerClusters(); + callListGameServerClusters(); // [END gameservices_v1_generated_GameServerClustersService_ListGameServerClusters_async] } 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 index 43871a84236..a316e3059fd 100644 --- 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 @@ -31,16 +31,16 @@ function main(parent, gameServerClusterId, gameServerCluster) { /** * Required. The game server cluster resource to be created. */ - // const gameServerCluster = '' + // const gameServerCluster = {} /** * Optional. The target timestamp to compute the preview. */ - // const previewTime = '' + // const previewTime = {} /** * Optional. This field is deprecated, preview will always return * KubernetesClusterState. */ - // const view = '' + // const view = {} // Imports the Gaming library const {GameServerClustersServiceClient} = @@ -49,7 +49,7 @@ function main(parent, gameServerClusterId, gameServerCluster) { // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); - async function previewCreateGameServerCluster() { + async function callPreviewCreateGameServerCluster() { // Construct request const request = { parent, @@ -62,7 +62,7 @@ function main(parent, gameServerClusterId, gameServerCluster) { console.log(response); } - previewCreateGameServerCluster(); + callPreviewCreateGameServerCluster(); // [END gameservices_v1_generated_GameServerClustersService_PreviewCreateGameServerCluster_async] } 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 index 00e7ddfb632..f969af575bc 100644 --- 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 @@ -27,7 +27,7 @@ function main(name) { /** * Optional. The target timestamp to compute the preview. */ - // const previewTime = '' + // const previewTime = {} // Imports the Gaming library const {GameServerClustersServiceClient} = @@ -36,7 +36,7 @@ function main(name) { // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); - async function previewDeleteGameServerCluster() { + async function callPreviewDeleteGameServerCluster() { // Construct request const request = { name, @@ -47,7 +47,7 @@ function main(name) { console.log(response); } - previewDeleteGameServerCluster(); + callPreviewDeleteGameServerCluster(); // [END gameservices_v1_generated_GameServerClustersService_PreviewDeleteGameServerCluster_async] } 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 index 5393942098a..c851f46d718 100644 --- 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 @@ -23,17 +23,17 @@ function main(gameServerCluster, updateMask) { * Required. The game server cluster to be updated. * Only fields specified in update_mask are updated. */ - // const gameServerCluster = '' + // 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 = '' + // const updateMask = {} /** * Optional. The target timestamp to compute the preview. */ - // const previewTime = '' + // const previewTime = {} // Imports the Gaming library const {GameServerClustersServiceClient} = @@ -42,7 +42,7 @@ function main(gameServerCluster, updateMask) { // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); - async function previewUpdateGameServerCluster() { + async function callPreviewUpdateGameServerCluster() { // Construct request const request = { gameServerCluster, @@ -54,7 +54,7 @@ function main(gameServerCluster, updateMask) { console.log(response); } - previewUpdateGameServerCluster(); + callPreviewUpdateGameServerCluster(); // [END gameservices_v1_generated_GameServerClustersService_PreviewUpdateGameServerCluster_async] } 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 index 839dcdb2801..134116d2f83 100644 --- 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 @@ -23,13 +23,13 @@ function main(gameServerCluster, updateMask) { * Required. The game server cluster to be updated. * Only fields specified in update_mask are updated. */ - // const gameServerCluster = '' + // 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 = '' + // const updateMask = {} // Imports the Gaming library const {GameServerClustersServiceClient} = @@ -38,7 +38,7 @@ function main(gameServerCluster, updateMask) { // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); - async function updateGameServerCluster() { + async function callUpdateGameServerCluster() { // Construct request const request = { gameServerCluster, @@ -51,7 +51,7 @@ function main(gameServerCluster, updateMask) { console.log(response); } - updateGameServerCluster(); + callUpdateGameServerCluster(); // [END gameservices_v1_generated_GameServerClustersService_UpdateGameServerCluster_async] } 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 index 1bba8737876..b00270a8bd5 100644 --- 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 @@ -31,7 +31,7 @@ function main(parent, configId, gameServerConfig) { /** * Required. The game server config resource to be created. */ - // const gameServerConfig = '' + // const gameServerConfig = {} // Imports the Gaming library const {GameServerConfigsServiceClient} = @@ -40,7 +40,7 @@ function main(parent, configId, gameServerConfig) { // Instantiates a client const gamingClient = new GameServerConfigsServiceClient(); - async function createGameServerConfig() { + async function callCreateGameServerConfig() { // Construct request const request = { parent, @@ -54,7 +54,7 @@ function main(parent, configId, gameServerConfig) { console.log(response); } - createGameServerConfig(); + callCreateGameServerConfig(); // [END gameservices_v1_generated_GameServerConfigsService_CreateGameServerConfig_async] } 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 index 338f504ec09..e1c6fa0eaf5 100644 --- 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 @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const gamingClient = new GameServerConfigsServiceClient(); - async function deleteGameServerConfig() { + async function callDeleteGameServerConfig() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - deleteGameServerConfig(); + callDeleteGameServerConfig(); // [END gameservices_v1_generated_GameServerConfigsService_DeleteGameServerConfig_async] } 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 index f49e46065dd..4fd433c6a1c 100644 --- 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 @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const gamingClient = new GameServerConfigsServiceClient(); - async function getGameServerConfig() { + async function callGetGameServerConfig() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getGameServerConfig(); + callGetGameServerConfig(); // [END gameservices_v1_generated_GameServerConfigsService_GetGameServerConfig_async] } 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 index 8cd6207c2f8..1b98b61f539 100644 --- 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 @@ -28,7 +28,7 @@ function main(parent) { * 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 + * 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 @@ -53,7 +53,7 @@ function main(parent) { // Instantiates a client const gamingClient = new GameServerConfigsServiceClient(); - async function listGameServerConfigs() { + async function callListGameServerConfigs() { // Construct request const request = { parent, @@ -66,7 +66,7 @@ function main(parent) { } } - listGameServerConfigs(); + callListGameServerConfigs(); // [END gameservices_v1_generated_GameServerConfigsService_ListGameServerConfigs_async] } 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 index 49404fc8220..b84a8301a8a 100644 --- 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 @@ -31,7 +31,7 @@ function main(parent, deploymentId, gameServerDeployment) { /** * Required. The game server delpoyment resource to be created. */ - // const gameServerDeployment = '' + // const gameServerDeployment = {} // Imports the Gaming library const {GameServerDeploymentsServiceClient} = @@ -40,7 +40,7 @@ function main(parent, deploymentId, gameServerDeployment) { // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); - async function createGameServerDeployment() { + async function callCreateGameServerDeployment() { // Construct request const request = { parent, @@ -54,7 +54,7 @@ function main(parent, deploymentId, gameServerDeployment) { console.log(response); } - createGameServerDeployment(); + callCreateGameServerDeployment(); // [END gameservices_v1_generated_GameServerDeploymentsService_CreateGameServerDeployment_async] } 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 index 7490fae3136..c8759d5f396 100644 --- 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 @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); - async function deleteGameServerDeployment() { + async function callDeleteGameServerDeployment() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - deleteGameServerDeployment(); + callDeleteGameServerDeployment(); // [END gameservices_v1_generated_GameServerDeploymentsService_DeleteGameServerDeployment_async] } 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 index bbc19ee7856..8dcd0c7b8f2 100644 --- 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 @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); - async function fetchDeploymentState() { + async function callFetchDeploymentState() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - fetchDeploymentState(); + callFetchDeploymentState(); // [END gameservices_v1_generated_GameServerDeploymentsService_FetchDeploymentState_async] } 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 index 3137207f200..eb72b2fce7f 100644 --- 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 @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); - async function getGameServerDeployment() { + async function callGetGameServerDeployment() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getGameServerDeployment(); + callGetGameServerDeployment(); // [END gameservices_v1_generated_GameServerDeploymentsService_GetGameServerDeployment_async] } 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 index 596aeeb55da..96a1b1fe02c 100644 --- 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 @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); - async function getGameServerDeploymentRollout() { + async function callGetGameServerDeploymentRollout() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getGameServerDeploymentRollout(); + callGetGameServerDeploymentRollout(); // [END gameservices_v1_generated_GameServerDeploymentsService_GetGameServerDeploymentRollout_async] } 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 index 122ff09ded6..7902b098060 100644 --- 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 @@ -28,7 +28,7 @@ function main(parent) { * 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 + * 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 @@ -54,7 +54,7 @@ function main(parent) { // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); - async function listGameServerDeployments() { + async function callListGameServerDeployments() { // Construct request const request = { parent, @@ -67,7 +67,7 @@ function main(parent) { } } - listGameServerDeployments(); + callListGameServerDeployments(); // [END gameservices_v1_generated_GameServerDeploymentsService_ListGameServerDeployments_async] } 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 index f17b9bf4a02..8aa76ba565f 100644 --- 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 @@ -23,18 +23,18 @@ function main(rollout) { * Required. The game server deployment rollout to be updated. * Only fields specified in update_mask are updated. */ - // const rollout = '' + // 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 = '' + // const updateMask = {} /** * Optional. The target timestamp to compute the preview. Defaults to the immediately * after the proposed rollout completes. */ - // const previewTime = '' + // const previewTime = {} // Imports the Gaming library const {GameServerDeploymentsServiceClient} = @@ -43,7 +43,7 @@ function main(rollout) { // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); - async function previewGameServerDeploymentRollout() { + async function callPreviewGameServerDeploymentRollout() { // Construct request const request = { rollout, @@ -56,7 +56,7 @@ function main(rollout) { console.log(response); } - previewGameServerDeploymentRollout(); + callPreviewGameServerDeploymentRollout(); // [END gameservices_v1_generated_GameServerDeploymentsService_PreviewGameServerDeploymentRollout_async] } 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 index 4e9a5482e87..0c7e0135a58 100644 --- 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 @@ -23,13 +23,13 @@ function main(gameServerDeployment, updateMask) { * Required. The game server delpoyment to be updated. * Only fields specified in update_mask are updated. */ - // const gameServerDeployment = '' + // 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 = '' + // const updateMask = {} // Imports the Gaming library const {GameServerDeploymentsServiceClient} = @@ -38,7 +38,7 @@ function main(gameServerDeployment, updateMask) { // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); - async function updateGameServerDeployment() { + async function callUpdateGameServerDeployment() { // Construct request const request = { gameServerDeployment, @@ -51,7 +51,7 @@ function main(gameServerDeployment, updateMask) { console.log(response); } - updateGameServerDeployment(); + callUpdateGameServerDeployment(); // [END gameservices_v1_generated_GameServerDeploymentsService_UpdateGameServerDeployment_async] } 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 index 44d9a90797f..63687b493e4 100644 --- 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 @@ -23,13 +23,13 @@ function main(rollout, updateMask) { * Required. The game server delpoyment rollout to be updated. * Only fields specified in update_mask are updated. */ - // const rollout = '' + // 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 = '' + // const updateMask = {} // Imports the Gaming library const {GameServerDeploymentsServiceClient} = @@ -38,7 +38,7 @@ function main(rollout, updateMask) { // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); - async function updateGameServerDeploymentRollout() { + async function callUpdateGameServerDeploymentRollout() { // Construct request const request = { rollout, @@ -53,7 +53,7 @@ function main(rollout, updateMask) { console.log(response); } - updateGameServerDeploymentRollout(); + callUpdateGameServerDeploymentRollout(); // [END gameservices_v1_generated_GameServerDeploymentsService_UpdateGameServerDeploymentRollout_async] } 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 index 1cf5a86c927..3eb57e7c10b 100644 --- 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 @@ -31,7 +31,7 @@ function main(parent, realmId, realm) { /** * Required. The realm resource to be created. */ - // const realm = '' + // const realm = {} // Imports the Gaming library const {RealmsServiceClient} = require('@google-cloud/game-servers').v1; @@ -39,7 +39,7 @@ function main(parent, realmId, realm) { // Instantiates a client const gamingClient = new RealmsServiceClient(); - async function createRealm() { + async function callCreateRealm() { // Construct request const request = { parent, @@ -53,7 +53,7 @@ function main(parent, realmId, realm) { console.log(response); } - createRealm(); + callCreateRealm(); // [END gameservices_v1_generated_RealmsService_CreateRealm_async] } 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 index dcfcd99bf3e..9ae7732eaec 100644 --- 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 @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const gamingClient = new RealmsServiceClient(); - async function deleteRealm() { + async function callDeleteRealm() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - deleteRealm(); + callDeleteRealm(); // [END gameservices_v1_generated_RealmsService_DeleteRealm_async] } 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 index 9858e1d77ac..4e72bd258cf 100644 --- 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 @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const gamingClient = new RealmsServiceClient(); - async function getRealm() { + async function callGetRealm() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - getRealm(); + callGetRealm(); // [END gameservices_v1_generated_RealmsService_GetRealm_async] } 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 index c78d60d7900..94b606f23b3 100644 --- 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 @@ -28,7 +28,7 @@ function main(parent) { * 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 + * 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 @@ -53,7 +53,7 @@ function main(parent) { // Instantiates a client const gamingClient = new RealmsServiceClient(); - async function listRealms() { + async function callListRealms() { // Construct request const request = { parent, @@ -66,7 +66,7 @@ function main(parent) { } } - listRealms(); + callListRealms(); // [END gameservices_v1_generated_RealmsService_ListRealms_async] } 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 index e0d48f22067..6536851d126 100644 --- 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 @@ -23,17 +23,17 @@ function main(realm, updateMask) { * Required. The realm to be updated. * Only fields specified in update_mask are updated. */ - // const realm = '' + // 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 = '' + // const updateMask = {} /** * Optional. The target timestamp to compute the preview. */ - // const previewTime = '' + // const previewTime = {} // Imports the Gaming library const {RealmsServiceClient} = require('@google-cloud/game-servers').v1; @@ -41,7 +41,7 @@ function main(realm, updateMask) { // Instantiates a client const gamingClient = new RealmsServiceClient(); - async function previewRealmUpdate() { + async function callPreviewRealmUpdate() { // Construct request const request = { realm, @@ -53,7 +53,7 @@ function main(realm, updateMask) { console.log(response); } - previewRealmUpdate(); + callPreviewRealmUpdate(); // [END gameservices_v1_generated_RealmsService_PreviewRealmUpdate_async] } 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 index e6d6bae74d9..e64466e863a 100644 --- 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 @@ -23,13 +23,13 @@ function main(realm, updateMask) { * Required. The realm to be updated. * Only fields specified in update_mask are updated. */ - // const realm = '' + // 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 = '' + // const updateMask = {} // Imports the Gaming library const {RealmsServiceClient} = require('@google-cloud/game-servers').v1; @@ -37,7 +37,7 @@ function main(realm, updateMask) { // Instantiates a client const gamingClient = new RealmsServiceClient(); - async function updateRealm() { + async function callUpdateRealm() { // Construct request const request = { realm, @@ -50,7 +50,7 @@ function main(realm, updateMask) { console.log(response); } - updateRealm(); + callUpdateRealm(); // [END gameservices_v1_generated_RealmsService_UpdateRealm_async] } 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 index 2ee63e67121..fc106621ccc 100644 --- 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 @@ -31,7 +31,7 @@ function main(parent, gameServerClusterId, gameServerCluster) { /** * Required. The game server cluster resource to be created. */ - // const gameServerCluster = '' + // const gameServerCluster = {} // Imports the Gaming library const {GameServerClustersServiceClient} = @@ -40,7 +40,7 @@ function main(parent, gameServerClusterId, gameServerCluster) { // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); - async function createGameServerCluster() { + async function callCreateGameServerCluster() { // Construct request const request = { parent, @@ -54,7 +54,7 @@ function main(parent, gameServerClusterId, gameServerCluster) { console.log(response); } - createGameServerCluster(); + callCreateGameServerCluster(); // [END gameservices_v1beta_generated_GameServerClustersService_CreateGameServerCluster_async] } 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 index 082e32d1c80..a3b81d0822a 100644 --- 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 @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); - async function deleteGameServerCluster() { + async function callDeleteGameServerCluster() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - deleteGameServerCluster(); + callDeleteGameServerCluster(); // [END gameservices_v1beta_generated_GameServerClustersService_DeleteGameServerCluster_async] } 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 index 1d3b65cd002..6b988fcad62 100644 --- 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 @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); - async function getGameServerCluster() { + async function callGetGameServerCluster() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getGameServerCluster(); + callGetGameServerCluster(); // [END gameservices_v1beta_generated_GameServerClustersService_GetGameServerCluster_async] } 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 index 39fdeb1a32a..58f4b6a6fa5 100644 --- 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 @@ -28,7 +28,7 @@ function main(parent) { * 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] + * 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 @@ -54,7 +54,7 @@ function main(parent) { // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); - async function listGameServerClusters() { + async function callListGameServerClusters() { // Construct request const request = { parent, @@ -67,7 +67,7 @@ function main(parent) { } } - listGameServerClusters(); + callListGameServerClusters(); // [END gameservices_v1beta_generated_GameServerClustersService_ListGameServerClusters_async] } 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 index b0db2425fbc..5b1230bcc60 100644 --- 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 @@ -31,11 +31,11 @@ function main(parent, gameServerClusterId, gameServerCluster) { /** * Required. The game server cluster resource to be created. */ - // const gameServerCluster = '' + // const gameServerCluster = {} /** * Optional. The target timestamp to compute the preview. */ - // const previewTime = '' + // const previewTime = {} // Imports the Gaming library const {GameServerClustersServiceClient} = @@ -44,7 +44,7 @@ function main(parent, gameServerClusterId, gameServerCluster) { // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); - async function previewCreateGameServerCluster() { + async function callPreviewCreateGameServerCluster() { // Construct request const request = { parent, @@ -57,7 +57,7 @@ function main(parent, gameServerClusterId, gameServerCluster) { console.log(response); } - previewCreateGameServerCluster(); + callPreviewCreateGameServerCluster(); // [END gameservices_v1beta_generated_GameServerClustersService_PreviewCreateGameServerCluster_async] } 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 index 343ce923977..32fa469fcd4 100644 --- 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 @@ -27,7 +27,7 @@ function main(name) { /** * Optional. The target timestamp to compute the preview. */ - // const previewTime = '' + // const previewTime = {} // Imports the Gaming library const {GameServerClustersServiceClient} = @@ -36,7 +36,7 @@ function main(name) { // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); - async function previewDeleteGameServerCluster() { + async function callPreviewDeleteGameServerCluster() { // Construct request const request = { name, @@ -47,7 +47,7 @@ function main(name) { console.log(response); } - previewDeleteGameServerCluster(); + callPreviewDeleteGameServerCluster(); // [END gameservices_v1beta_generated_GameServerClustersService_PreviewDeleteGameServerCluster_async] } 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 index 4b8c891903e..46a3436daf0 100644 --- 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 @@ -23,7 +23,7 @@ function main(gameServerCluster, updateMask) { * Required. The game server cluster to be updated. * Only fields specified in update_mask are updated. */ - // const gameServerCluster = '' + // const gameServerCluster = {} /** * Required. Mask of fields to update. At least one path must be supplied in * this field. For the `FieldMask` definition, see @@ -31,11 +31,11 @@ function main(gameServerCluster, updateMask) { * //developers.google.com/protocol-buffers * // /docs/reference/google.protobuf#fieldmask */ - // const updateMask = '' + // const updateMask = {} /** * Optional. The target timestamp to compute the preview. */ - // const previewTime = '' + // const previewTime = {} // Imports the Gaming library const {GameServerClustersServiceClient} = @@ -44,7 +44,7 @@ function main(gameServerCluster, updateMask) { // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); - async function previewUpdateGameServerCluster() { + async function callPreviewUpdateGameServerCluster() { // Construct request const request = { gameServerCluster, @@ -56,7 +56,7 @@ function main(gameServerCluster, updateMask) { console.log(response); } - previewUpdateGameServerCluster(); + callPreviewUpdateGameServerCluster(); // [END gameservices_v1beta_generated_GameServerClustersService_PreviewUpdateGameServerCluster_async] } 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 index f876ea73c31..c1b499f9ad1 100644 --- 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 @@ -23,7 +23,7 @@ function main(gameServerCluster, updateMask) { * Required. The game server cluster to be updated. * Only fields specified in update_mask are updated. */ - // const gameServerCluster = '' + // const gameServerCluster = {} /** * Required. Mask of fields to update. At least one path must be supplied in * this field. For the `FieldMask` definition, see @@ -31,7 +31,7 @@ function main(gameServerCluster, updateMask) { * //developers.google.com/protocol-buffers * // /docs/reference/google.protobuf#fieldmask */ - // const updateMask = '' + // const updateMask = {} // Imports the Gaming library const {GameServerClustersServiceClient} = @@ -40,7 +40,7 @@ function main(gameServerCluster, updateMask) { // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); - async function updateGameServerCluster() { + async function callUpdateGameServerCluster() { // Construct request const request = { gameServerCluster, @@ -53,7 +53,7 @@ function main(gameServerCluster, updateMask) { console.log(response); } - updateGameServerCluster(); + callUpdateGameServerCluster(); // [END gameservices_v1beta_generated_GameServerClustersService_UpdateGameServerCluster_async] } 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 index a1f8b4aadf1..c2d07eab3ed 100644 --- 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 @@ -31,7 +31,7 @@ function main(parent, configId, gameServerConfig) { /** * Required. The game server config resource to be created. */ - // const gameServerConfig = '' + // const gameServerConfig = {} // Imports the Gaming library const {GameServerConfigsServiceClient} = @@ -40,7 +40,7 @@ function main(parent, configId, gameServerConfig) { // Instantiates a client const gamingClient = new GameServerConfigsServiceClient(); - async function createGameServerConfig() { + async function callCreateGameServerConfig() { // Construct request const request = { parent, @@ -54,7 +54,7 @@ function main(parent, configId, gameServerConfig) { console.log(response); } - createGameServerConfig(); + callCreateGameServerConfig(); // [END gameservices_v1beta_generated_GameServerConfigsService_CreateGameServerConfig_async] } 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 index cf3e70ff6e0..542e3ae20a0 100644 --- 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 @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const gamingClient = new GameServerConfigsServiceClient(); - async function deleteGameServerConfig() { + async function callDeleteGameServerConfig() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - deleteGameServerConfig(); + callDeleteGameServerConfig(); // [END gameservices_v1beta_generated_GameServerConfigsService_DeleteGameServerConfig_async] } 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 index 3d6415c0313..a1c3286ffc9 100644 --- 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 @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const gamingClient = new GameServerConfigsServiceClient(); - async function getGameServerConfig() { + async function callGetGameServerConfig() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getGameServerConfig(); + callGetGameServerConfig(); // [END gameservices_v1beta_generated_GameServerConfigsService_GetGameServerConfig_async] } 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 index fa8c9cc0d2a..c89d1e5ad2a 100644 --- 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 @@ -28,7 +28,7 @@ function main(parent) { * 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] + * 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 @@ -54,7 +54,7 @@ function main(parent) { // Instantiates a client const gamingClient = new GameServerConfigsServiceClient(); - async function listGameServerConfigs() { + async function callListGameServerConfigs() { // Construct request const request = { parent, @@ -67,7 +67,7 @@ function main(parent) { } } - listGameServerConfigs(); + callListGameServerConfigs(); // [END gameservices_v1beta_generated_GameServerConfigsService_ListGameServerConfigs_async] } 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 index bace431d64a..c59f86509a9 100644 --- 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 @@ -31,7 +31,7 @@ function main(parent, deploymentId, gameServerDeployment) { /** * Required. The game server delpoyment resource to be created. */ - // const gameServerDeployment = '' + // const gameServerDeployment = {} // Imports the Gaming library const {GameServerDeploymentsServiceClient} = @@ -40,7 +40,7 @@ function main(parent, deploymentId, gameServerDeployment) { // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); - async function createGameServerDeployment() { + async function callCreateGameServerDeployment() { // Construct request const request = { parent, @@ -54,7 +54,7 @@ function main(parent, deploymentId, gameServerDeployment) { console.log(response); } - createGameServerDeployment(); + callCreateGameServerDeployment(); // [END gameservices_v1beta_generated_GameServerDeploymentsService_CreateGameServerDeployment_async] } 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 index ecc1cad27d7..5657ae1399e 100644 --- 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 @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); - async function deleteGameServerDeployment() { + async function callDeleteGameServerDeployment() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - deleteGameServerDeployment(); + callDeleteGameServerDeployment(); // [END gameservices_v1beta_generated_GameServerDeploymentsService_DeleteGameServerDeployment_async] } 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 index f869cfb4f9b..d151b9148a5 100644 --- 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 @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); - async function fetchDeploymentState() { + async function callFetchDeploymentState() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - fetchDeploymentState(); + callFetchDeploymentState(); // [END gameservices_v1beta_generated_GameServerDeploymentsService_FetchDeploymentState_async] } 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 index d50635d3864..610399c2496 100644 --- 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 @@ -33,7 +33,7 @@ function main(name) { // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); - async function getGameServerDeployment() { + async function callGetGameServerDeployment() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - getGameServerDeployment(); + callGetGameServerDeployment(); // [END gameservices_v1beta_generated_GameServerDeploymentsService_GetGameServerDeployment_async] } 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 index 3eb5c2cc609..6878f5d45b0 100644 --- 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 @@ -33,7 +33,7 @@ function main(name) { // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); - async function getGameServerDeploymentRollout() { + async function callGetGameServerDeploymentRollout() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - getGameServerDeploymentRollout(); + callGetGameServerDeploymentRollout(); // [END gameservices_v1beta_generated_GameServerDeploymentsService_GetGameServerDeploymentRollout_async] } 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 index 5b63f101eca..4a97f09dfa7 100644 --- 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 @@ -28,7 +28,7 @@ function main(parent) { * 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] + * 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 @@ -54,7 +54,7 @@ function main(parent) { // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); - async function listGameServerDeployments() { + async function callListGameServerDeployments() { // Construct request const request = { parent, @@ -67,7 +67,7 @@ function main(parent) { } } - listGameServerDeployments(); + callListGameServerDeployments(); // [END gameservices_v1beta_generated_GameServerDeploymentsService_ListGameServerDeployments_async] } 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 index 234c777e019..46117d3c4e5 100644 --- 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 @@ -23,7 +23,7 @@ function main(rollout) { * Required. The game server deployment rollout to be updated. * Only fields specified in update_mask are updated. */ - // const rollout = '' + // const rollout = {} /** * Optional. Mask of fields to update. At least one path must be supplied in * this field. For the `FieldMask` definition, see @@ -31,12 +31,12 @@ function main(rollout) { * //developers.google.com/protocol-buffers * // /docs/reference/google.protobuf#fieldmask */ - // const updateMask = '' + // const updateMask = {} /** * Optional. The target timestamp to compute the preview. Defaults to the * immediately after the proposed rollout completes. */ - // const previewTime = '' + // const previewTime = {} // Imports the Gaming library const {GameServerDeploymentsServiceClient} = @@ -45,7 +45,7 @@ function main(rollout) { // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); - async function previewGameServerDeploymentRollout() { + async function callPreviewGameServerDeploymentRollout() { // Construct request const request = { rollout, @@ -58,7 +58,7 @@ function main(rollout) { console.log(response); } - previewGameServerDeploymentRollout(); + callPreviewGameServerDeploymentRollout(); // [END gameservices_v1beta_generated_GameServerDeploymentsService_PreviewGameServerDeploymentRollout_async] } 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 index 46ac7919641..51e0641a4aa 100644 --- 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 @@ -23,7 +23,7 @@ function main(gameServerDeployment, updateMask) { * Required. The game server delpoyment to be updated. * Only fields specified in update_mask are updated. */ - // const gameServerDeployment = '' + // const gameServerDeployment = {} /** * Required. Mask of fields to update. At least one path must be supplied in * this field. For the `FieldMask` definition, see @@ -31,7 +31,7 @@ function main(gameServerDeployment, updateMask) { * //developers.google.com/protocol-buffers * // /docs/reference/google.protobuf#fieldmask */ - // const updateMask = '' + // const updateMask = {} // Imports the Gaming library const {GameServerDeploymentsServiceClient} = @@ -40,7 +40,7 @@ function main(gameServerDeployment, updateMask) { // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); - async function updateGameServerDeployment() { + async function callUpdateGameServerDeployment() { // Construct request const request = { gameServerDeployment, @@ -53,7 +53,7 @@ function main(gameServerDeployment, updateMask) { console.log(response); } - updateGameServerDeployment(); + callUpdateGameServerDeployment(); // [END gameservices_v1beta_generated_GameServerDeploymentsService_UpdateGameServerDeployment_async] } 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 index 3599b1b373b..d14ae6c62db 100644 --- 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 @@ -23,7 +23,7 @@ function main(rollout, updateMask) { * Required. The game server delpoyment rollout to be updated. * Only fields specified in update_mask are updated. */ - // const rollout = '' + // const rollout = {} /** * Required. Mask of fields to update. At least one path must be supplied in * this field. For the `FieldMask` definition, see @@ -31,7 +31,7 @@ function main(rollout, updateMask) { * //developers.google.com/protocol-buffers * // /docs/reference/google.protobuf#fieldmask */ - // const updateMask = '' + // const updateMask = {} // Imports the Gaming library const {GameServerDeploymentsServiceClient} = @@ -40,7 +40,7 @@ function main(rollout, updateMask) { // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); - async function updateGameServerDeploymentRollout() { + async function callUpdateGameServerDeploymentRollout() { // Construct request const request = { rollout, @@ -55,7 +55,7 @@ function main(rollout, updateMask) { console.log(response); } - updateGameServerDeploymentRollout(); + callUpdateGameServerDeploymentRollout(); // [END gameservices_v1beta_generated_GameServerDeploymentsService_UpdateGameServerDeploymentRollout_async] } 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 index 7f57922ea23..d68f8035910 100644 --- 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 @@ -31,7 +31,7 @@ function main(parent, realmId, realm) { /** * Required. The realm resource to be created. */ - // const realm = '' + // const realm = {} // Imports the Gaming library const {RealmsServiceClient} = require('@google-cloud/game-servers').v1beta; @@ -39,7 +39,7 @@ function main(parent, realmId, realm) { // Instantiates a client const gamingClient = new RealmsServiceClient(); - async function createRealm() { + async function callCreateRealm() { // Construct request const request = { parent, @@ -53,7 +53,7 @@ function main(parent, realmId, realm) { console.log(response); } - createRealm(); + callCreateRealm(); // [END gameservices_v1beta_generated_RealmsService_CreateRealm_async] } 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 index 6fac763ee67..1dd3076b9da 100644 --- 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 @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const gamingClient = new RealmsServiceClient(); - async function deleteRealm() { + async function callDeleteRealm() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - deleteRealm(); + callDeleteRealm(); // [END gameservices_v1beta_generated_RealmsService_DeleteRealm_async] } 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 index c730f3260cf..929ee21c41a 100644 --- 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 @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const gamingClient = new RealmsServiceClient(); - async function getRealm() { + async function callGetRealm() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - getRealm(); + callGetRealm(); // [END gameservices_v1beta_generated_RealmsService_GetRealm_async] } 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 index bd56b4deff9..c16b2e36646 100644 --- 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 @@ -28,7 +28,7 @@ function main(parent) { * 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] + * 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 @@ -53,7 +53,7 @@ function main(parent) { // Instantiates a client const gamingClient = new RealmsServiceClient(); - async function listRealms() { + async function callListRealms() { // Construct request const request = { parent, @@ -66,7 +66,7 @@ function main(parent) { } } - listRealms(); + callListRealms(); // [END gameservices_v1beta_generated_RealmsService_ListRealms_async] } 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 index 1958e72b108..ac5c2a80507 100644 --- 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 @@ -23,7 +23,7 @@ function main(realm, updateMask) { * Required. The realm to be updated. * Only fields specified in update_mask are updated. */ - // const realm = '' + // const realm = {} /** * Required. The update mask applies to the resource. For the `FieldMask` * definition, see @@ -31,11 +31,11 @@ function main(realm, updateMask) { * //developers.google.com/protocol-buffers * // /docs/reference/google.protobuf#fieldmask */ - // const updateMask = '' + // const updateMask = {} /** * Optional. The target timestamp to compute the preview. */ - // const previewTime = '' + // const previewTime = {} // Imports the Gaming library const {RealmsServiceClient} = require('@google-cloud/game-servers').v1beta; @@ -43,7 +43,7 @@ function main(realm, updateMask) { // Instantiates a client const gamingClient = new RealmsServiceClient(); - async function previewRealmUpdate() { + async function callPreviewRealmUpdate() { // Construct request const request = { realm, @@ -55,7 +55,7 @@ function main(realm, updateMask) { console.log(response); } - previewRealmUpdate(); + callPreviewRealmUpdate(); // [END gameservices_v1beta_generated_RealmsService_PreviewRealmUpdate_async] } 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 index cbcceb69a6c..7efc58d6695 100644 --- 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 @@ -23,7 +23,7 @@ function main(realm, updateMask) { * Required. The realm to be updated. * Only fields specified in update_mask are updated. */ - // const realm = '' + // const realm = {} /** * Required. The update mask applies to the resource. For the `FieldMask` * definition, see @@ -31,7 +31,7 @@ function main(realm, updateMask) { * //developers.google.com/protocol-buffers * // /docs/reference/google.protobuf#fieldmask */ - // const updateMask = '' + // const updateMask = {} // Imports the Gaming library const {RealmsServiceClient} = require('@google-cloud/game-servers').v1beta; @@ -39,7 +39,7 @@ function main(realm, updateMask) { // Instantiates a client const gamingClient = new RealmsServiceClient(); - async function updateRealm() { + async function callUpdateRealm() { // Construct request const request = { realm, @@ -52,7 +52,7 @@ function main(realm, updateMask) { console.log(response); } - updateRealm(); + callUpdateRealm(); // [END gameservices_v1beta_generated_RealmsService_UpdateRealm_async] } 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 index 9679776f356..1fc312f75fe 100644 --- 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 @@ -401,6 +401,31 @@ export class GameServerClustersServiceClient { // ------------------- // -- 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 @@ -432,31 +457,6 @@ export class GameServerClustersServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [response] = await client.getGameServerCluster(request); - */ getGameServerCluster( request?: protos.google.cloud.gaming.v1.IGetGameServerClusterRequest, optionsOrCallback?: @@ -500,6 +500,34 @@ export class GameServerClustersServiceClient { 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 @@ -534,34 +562,6 @@ export class GameServerClustersServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [response] = await client.previewCreateGameServerCluster(request); - */ previewCreateGameServerCluster( request?: protos.google.cloud.gaming.v1.IPreviewCreateGameServerClusterRequest, optionsOrCallback?: @@ -612,6 +612,26 @@ export class GameServerClustersServiceClient { 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 @@ -646,26 +666,6 @@ export class GameServerClustersServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [response] = await client.previewDeleteGameServerCluster(request); - */ previewDeleteGameServerCluster( request?: protos.google.cloud.gaming.v1.IPreviewDeleteGameServerClusterRequest, optionsOrCallback?: @@ -716,6 +716,30 @@ export class GameServerClustersServiceClient { 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 @@ -750,30 +774,6 @@ export class GameServerClustersServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [response] = await client.previewUpdateGameServerCluster(request); - */ previewUpdateGameServerCluster( request?: protos.google.cloud.gaming.v1.IPreviewUpdateGameServerClusterRequest, optionsOrCallback?: @@ -825,6 +825,30 @@ export class GameServerClustersServiceClient { ); } + /** + * 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 @@ -861,31 +885,6 @@ export class GameServerClustersServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.createGameServerCluster(request); - * const [response] = await operation.promise(); - */ createGameServerCluster( request?: protos.google.cloud.gaming.v1.ICreateGameServerClusterRequest, optionsOrCallback?: @@ -947,11 +946,8 @@ export class GameServerClustersServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkCreateGameServerClusterProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @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 @@ -975,6 +971,26 @@ export class GameServerClustersServiceClient { 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 @@ -1011,27 +1027,6 @@ export class GameServerClustersServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.deleteGameServerCluster(request); - * const [response] = await operation.promise(); - */ deleteGameServerCluster( request?: protos.google.cloud.gaming.v1.IDeleteGameServerClusterRequest, optionsOrCallback?: @@ -1093,11 +1088,8 @@ export class GameServerClustersServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkDeleteGameServerClusterProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @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 @@ -1121,6 +1113,30 @@ export class GameServerClustersServiceClient { 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 @@ -1157,31 +1173,6 @@ export class GameServerClustersServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.updateGameServerCluster(request); - * const [response] = await operation.promise(); - */ updateGameServerCluster( request?: protos.google.cloud.gaming.v1.IUpdateGameServerClusterRequest, optionsOrCallback?: @@ -1243,11 +1234,8 @@ export class GameServerClustersServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkUpdateGameServerClusterProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @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 @@ -1271,37 +1259,6 @@ export class GameServerClustersServiceClient { protos.google.cloud.gaming.v1.OperationMetadata >; } - 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; /** * Lists game server clusters in a given project and location. * @@ -1343,6 +1300,37 @@ export class GameServerClustersServiceClient { * [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?: @@ -1491,11 +1479,8 @@ export class GameServerClustersServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listGameServerClustersAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @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, @@ -1509,7 +1494,6 @@ export class GameServerClustersServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listGameServerClusters']; const callSettings = defaultCallSettings.merge(options); this.initialize(); 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 index 56a2584454b..e8c43eb9752 100644 --- 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 @@ -380,6 +380,24 @@ export class GameServerConfigsServiceClient { // ------------------- // -- 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 @@ -411,24 +429,6 @@ export class GameServerConfigsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [response] = await client.getGameServerConfig(request); - */ getGameServerConfig( request?: protos.google.cloud.gaming.v1.IGetGameServerConfigRequest, optionsOrCallback?: @@ -473,6 +473,32 @@ export class GameServerConfigsServiceClient { 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 @@ -509,33 +535,6 @@ export class GameServerConfigsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.createGameServerConfig(request); - * const [response] = await operation.promise(); - */ createGameServerConfig( request?: protos.google.cloud.gaming.v1.ICreateGameServerConfigRequest, optionsOrCallback?: @@ -597,11 +596,8 @@ export class GameServerConfigsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkCreateGameServerConfigProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @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 @@ -625,6 +621,27 @@ export class GameServerConfigsServiceClient { 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 @@ -661,28 +678,6 @@ export class GameServerConfigsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.deleteGameServerConfig(request); - * const [response] = await operation.promise(); - */ deleteGameServerConfig( request?: protos.google.cloud.gaming.v1.IDeleteGameServerConfigRequest, optionsOrCallback?: @@ -744,11 +739,8 @@ export class GameServerConfigsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkDeleteGameServerConfigProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @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 @@ -772,37 +764,6 @@ export class GameServerConfigsServiceClient { protos.google.cloud.gaming.v1.OperationMetadata >; } - 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; /** * Lists game server configs in a given project, location, and game server * deployment. @@ -838,6 +799,37 @@ export class GameServerConfigsServiceClient { * [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?: @@ -968,11 +960,8 @@ export class GameServerConfigsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listGameServerConfigsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @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, @@ -986,7 +975,6 @@ export class GameServerConfigsServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listGameServerConfigs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); 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 index ec82e53ae2e..3362386bee3 100644 --- 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 @@ -418,6 +418,24 @@ export class GameServerDeploymentsServiceClient { // ------------------- // -- 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 @@ -449,24 +467,6 @@ export class GameServerDeploymentsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [response] = await client.getGameServerDeployment(request); - */ getGameServerDeployment( request?: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRequest, optionsOrCallback?: @@ -514,6 +514,24 @@ export class GameServerDeploymentsServiceClient { 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 @@ -548,24 +566,6 @@ export class GameServerDeploymentsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [response] = await client.getGameServerDeploymentRollout(request); - */ getGameServerDeploymentRollout( request?: protos.google.cloud.gaming.v1.IGetGameServerDeploymentRolloutRequest, optionsOrCallback?: @@ -616,6 +616,32 @@ export class GameServerDeploymentsServiceClient { 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 @@ -650,32 +676,6 @@ export class GameServerDeploymentsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [response] = await client.previewGameServerDeploymentRollout(request); - */ previewGameServerDeploymentRollout( request?: protos.google.cloud.gaming.v1.IPreviewGameServerDeploymentRolloutRequest, optionsOrCallback?: @@ -726,6 +726,26 @@ export class GameServerDeploymentsServiceClient { 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 @@ -757,26 +777,6 @@ export class GameServerDeploymentsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [response] = await client.fetchDeploymentState(request); - */ fetchDeploymentState( request?: protos.google.cloud.gaming.v1.IFetchDeploymentStateRequest, optionsOrCallback?: @@ -821,6 +821,30 @@ export class GameServerDeploymentsServiceClient { 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 @@ -857,31 +881,6 @@ export class GameServerDeploymentsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.createGameServerDeployment(request); - * const [response] = await operation.promise(); - */ createGameServerDeployment( request?: protos.google.cloud.gaming.v1.ICreateGameServerDeploymentRequest, optionsOrCallback?: @@ -943,11 +942,8 @@ export class GameServerDeploymentsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkCreateGameServerDeploymentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @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 @@ -971,6 +967,26 @@ export class GameServerDeploymentsServiceClient { 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 @@ -1007,27 +1023,6 @@ export class GameServerDeploymentsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.deleteGameServerDeployment(request); - * const [response] = await operation.promise(); - */ deleteGameServerDeployment( request?: protos.google.cloud.gaming.v1.IDeleteGameServerDeploymentRequest, optionsOrCallback?: @@ -1089,11 +1084,8 @@ export class GameServerDeploymentsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkDeleteGameServerDeploymentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @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 @@ -1117,6 +1109,30 @@ export class GameServerDeploymentsServiceClient { 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 @@ -1153,31 +1169,6 @@ export class GameServerDeploymentsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.updateGameServerDeployment(request); - * const [response] = await operation.promise(); - */ updateGameServerDeployment( request?: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRequest, optionsOrCallback?: @@ -1239,11 +1230,8 @@ export class GameServerDeploymentsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkUpdateGameServerDeploymentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @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 @@ -1267,6 +1255,35 @@ export class GameServerDeploymentsServiceClient { 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 @@ -1303,36 +1320,6 @@ export class GameServerDeploymentsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.updateGameServerDeploymentRollout(request); - * const [response] = await operation.promise(); - */ updateGameServerDeploymentRollout( request?: protos.google.cloud.gaming.v1.IUpdateGameServerDeploymentRolloutRequest, optionsOrCallback?: @@ -1394,11 +1381,8 @@ export class GameServerDeploymentsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkUpdateGameServerDeploymentRolloutProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @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 @@ -1422,37 +1406,6 @@ export class GameServerDeploymentsServiceClient { protos.google.cloud.gaming.v1.OperationMetadata >; } - 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; /** * Lists game server deployments in a given project and location. * @@ -1488,6 +1441,37 @@ export class GameServerDeploymentsServiceClient { * [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?: @@ -1624,11 +1608,8 @@ export class GameServerDeploymentsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listGameServerDeploymentsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @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, @@ -1642,7 +1623,6 @@ export class GameServerDeploymentsServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listGameServerDeployments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-gaming/src/v1/realms_service_client.ts b/packages/google-cloud-gaming/src/v1/realms_service_client.ts index 8fd92935b01..e4ba9c331e7 100644 --- a/packages/google-cloud-gaming/src/v1/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1/realms_service_client.ts @@ -385,6 +385,24 @@ export class RealmsServiceClient { // ------------------- // -- 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 @@ -412,24 +430,6 @@ export class RealmsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [response] = await client.getRealm(request); - */ getRealm( request?: protos.google.cloud.gaming.v1.IGetRealmRequest, optionsOrCallback?: @@ -469,6 +469,30 @@ export class RealmsServiceClient { 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 @@ -500,30 +524,6 @@ export class RealmsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [response] = await client.previewRealmUpdate(request); - */ previewRealmUpdate( request?: protos.google.cloud.gaming.v1.IPreviewRealmUpdateRequest, optionsOrCallback?: @@ -568,6 +568,30 @@ export class RealmsServiceClient { 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 @@ -604,31 +628,6 @@ export class RealmsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.createRealm(request); - * const [response] = await operation.promise(); - */ createRealm( request?: protos.google.cloud.gaming.v1.ICreateRealmRequest, optionsOrCallback?: @@ -686,11 +685,8 @@ export class RealmsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkCreateRealmProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/realms_service.create_realm.js + * region_tag:gameservices_v1_generated_RealmsService_CreateRealm_async */ async checkCreateRealmProgress( name: string @@ -714,6 +710,26 @@ export class RealmsServiceClient { 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 @@ -750,27 +766,6 @@ export class RealmsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.deleteRealm(request); - * const [response] = await operation.promise(); - */ deleteRealm( request?: protos.google.cloud.gaming.v1.IDeleteRealmRequest, optionsOrCallback?: @@ -828,11 +823,8 @@ export class RealmsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkDeleteRealmProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/realms_service.delete_realm.js + * region_tag:gameservices_v1_generated_RealmsService_DeleteRealm_async */ async checkDeleteRealmProgress( name: string @@ -856,6 +848,30 @@ export class RealmsServiceClient { 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 @@ -892,31 +908,6 @@ export class RealmsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.updateRealm(request); - * const [response] = await operation.promise(); - */ updateRealm( request?: protos.google.cloud.gaming.v1.IUpdateRealmRequest, optionsOrCallback?: @@ -974,11 +965,8 @@ export class RealmsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkUpdateRealmProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/realms_service.update_realm.js + * region_tag:gameservices_v1_generated_RealmsService_UpdateRealm_async */ async checkUpdateRealmProgress( name: string @@ -1002,33 +990,6 @@ export class RealmsServiceClient { protos.google.cloud.gaming.v1.OperationMetadata >; } - 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; /** * Lists realms in a given project and location. * @@ -1064,6 +1025,33 @@ export class RealmsServiceClient { * [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?: @@ -1192,11 +1180,8 @@ export class RealmsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listRealmsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @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, @@ -1210,7 +1195,6 @@ export class RealmsServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listRealms']; const callSettings = defaultCallSettings.merge(options); this.initialize(); 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 index ca8066d158f..8c3691d2537 100644 --- 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 @@ -401,6 +401,25 @@ export class GameServerClustersServiceClient { // ------------------- // -- 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 @@ -435,25 +454,6 @@ export class GameServerClustersServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [response] = await client.getGameServerCluster(request); - */ getGameServerCluster( request?: protos.google.cloud.gaming.v1beta.IGetGameServerClusterRequest, optionsOrCallback?: @@ -500,6 +500,31 @@ export class GameServerClustersServiceClient { 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 @@ -534,31 +559,6 @@ export class GameServerClustersServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [response] = await client.previewCreateGameServerCluster(request); - */ previewCreateGameServerCluster( request?: protos.google.cloud.gaming.v1beta.IPreviewCreateGameServerClusterRequest, optionsOrCallback?: @@ -609,6 +609,26 @@ export class GameServerClustersServiceClient { 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 @@ -643,26 +663,6 @@ export class GameServerClustersServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [response] = await client.previewDeleteGameServerCluster(request); - */ previewDeleteGameServerCluster( request?: protos.google.cloud.gaming.v1beta.IPreviewDeleteGameServerClusterRequest, optionsOrCallback?: @@ -713,6 +713,33 @@ export class GameServerClustersServiceClient { 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 @@ -747,33 +774,6 @@ export class GameServerClustersServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [response] = await client.previewUpdateGameServerCluster(request); - */ previewUpdateGameServerCluster( request?: protos.google.cloud.gaming.v1beta.IPreviewUpdateGameServerClusterRequest, optionsOrCallback?: @@ -825,6 +825,30 @@ export class GameServerClustersServiceClient { ); } + /** + * 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 @@ -861,31 +885,6 @@ export class GameServerClustersServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.createGameServerCluster(request); - * const [response] = await operation.promise(); - */ createGameServerCluster( request?: protos.google.cloud.gaming.v1beta.ICreateGameServerClusterRequest, optionsOrCallback?: @@ -947,11 +946,8 @@ export class GameServerClustersServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkCreateGameServerClusterProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @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 @@ -975,6 +971,26 @@ export class GameServerClustersServiceClient { 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 @@ -1011,27 +1027,6 @@ export class GameServerClustersServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.deleteGameServerCluster(request); - * const [response] = await operation.promise(); - */ deleteGameServerCluster( request?: protos.google.cloud.gaming.v1beta.IDeleteGameServerClusterRequest, optionsOrCallback?: @@ -1093,11 +1088,8 @@ export class GameServerClustersServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkDeleteGameServerClusterProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @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 @@ -1121,6 +1113,33 @@ export class GameServerClustersServiceClient { 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 @@ -1157,34 +1176,6 @@ export class GameServerClustersServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.updateGameServerCluster(request); - * const [response] = await operation.promise(); - */ updateGameServerCluster( request?: protos.google.cloud.gaming.v1beta.IUpdateGameServerClusterRequest, optionsOrCallback?: @@ -1246,11 +1237,8 @@ export class GameServerClustersServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkUpdateGameServerClusterProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @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 @@ -1274,37 +1262,6 @@ export class GameServerClustersServiceClient { protos.google.cloud.gaming.v1beta.OperationMetadata >; } - 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; /** * Lists game server clusters in a given project and location. * @@ -1340,6 +1297,37 @@ export class GameServerClustersServiceClient { * [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?: @@ -1476,11 +1464,8 @@ export class GameServerClustersServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listGameServerClustersAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @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, @@ -1494,7 +1479,6 @@ export class GameServerClustersServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listGameServerClusters']; const callSettings = defaultCallSettings.merge(options); this.initialize(); 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 index 40270037056..b69ea9888ec 100644 --- 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 @@ -381,6 +381,25 @@ export class GameServerConfigsServiceClient { // ------------------- // -- 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 @@ -412,25 +431,6 @@ export class GameServerConfigsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [response] = await client.getGameServerConfig(request); - */ getGameServerConfig( request?: protos.google.cloud.gaming.v1beta.IGetGameServerConfigRequest, optionsOrCallback?: @@ -475,6 +475,33 @@ export class GameServerConfigsServiceClient { 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 @@ -511,34 +538,6 @@ export class GameServerConfigsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.createGameServerConfig(request); - * const [response] = await operation.promise(); - */ createGameServerConfig( request?: protos.google.cloud.gaming.v1beta.ICreateGameServerConfigRequest, optionsOrCallback?: @@ -600,11 +599,8 @@ export class GameServerConfigsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkCreateGameServerConfigProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @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 @@ -628,6 +624,28 @@ export class GameServerConfigsServiceClient { 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 @@ -664,29 +682,6 @@ export class GameServerConfigsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.deleteGameServerConfig(request); - * const [response] = await operation.promise(); - */ deleteGameServerConfig( request?: protos.google.cloud.gaming.v1beta.IDeleteGameServerConfigRequest, optionsOrCallback?: @@ -748,11 +743,8 @@ export class GameServerConfigsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkDeleteGameServerConfigProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @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 @@ -776,37 +768,6 @@ export class GameServerConfigsServiceClient { protos.google.cloud.gaming.v1beta.OperationMetadata >; } - 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; /** * Lists game server configs in a given project, location, and game server * deployment. @@ -844,6 +805,37 @@ export class GameServerConfigsServiceClient { * [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?: @@ -978,11 +970,8 @@ export class GameServerConfigsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listGameServerConfigsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @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, @@ -996,7 +985,6 @@ export class GameServerConfigsServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listGameServerConfigs']; const callSettings = defaultCallSettings.merge(options); this.initialize(); 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 index e6216176129..01765b630e9 100644 --- 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 @@ -418,6 +418,26 @@ export class GameServerDeploymentsServiceClient { // ------------------- // -- 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 @@ -452,26 +472,6 @@ export class GameServerDeploymentsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [response] = await client.getGameServerDeployment(request); - */ getGameServerDeployment( request?: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRequest, optionsOrCallback?: @@ -522,6 +522,26 @@ export class GameServerDeploymentsServiceClient { 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 @@ -556,26 +576,6 @@ export class GameServerDeploymentsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [response] = await client.getGameServerDeploymentRollout(request); - */ getGameServerDeploymentRollout( request?: protos.google.cloud.gaming.v1beta.IGetGameServerDeploymentRolloutRequest, optionsOrCallback?: @@ -626,6 +626,35 @@ export class GameServerDeploymentsServiceClient { 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 @@ -660,35 +689,6 @@ export class GameServerDeploymentsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [response] = await client.previewGameServerDeploymentRollout(request); - */ previewGameServerDeploymentRollout( request?: protos.google.cloud.gaming.v1beta.IPreviewGameServerDeploymentRolloutRequest, optionsOrCallback?: @@ -739,6 +739,27 @@ export class GameServerDeploymentsServiceClient { 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 @@ -773,27 +794,6 @@ export class GameServerDeploymentsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [response] = await client.fetchDeploymentState(request); - */ fetchDeploymentState( request?: protos.google.cloud.gaming.v1beta.IFetchDeploymentStateRequest, optionsOrCallback?: @@ -841,6 +841,30 @@ export class GameServerDeploymentsServiceClient { 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 @@ -877,31 +901,6 @@ export class GameServerDeploymentsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.createGameServerDeployment(request); - * const [response] = await operation.promise(); - */ createGameServerDeployment( request?: protos.google.cloud.gaming.v1beta.ICreateGameServerDeploymentRequest, optionsOrCallback?: @@ -963,11 +962,8 @@ export class GameServerDeploymentsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkCreateGameServerDeploymentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @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 @@ -991,6 +987,27 @@ export class GameServerDeploymentsServiceClient { 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 @@ -1027,28 +1044,6 @@ export class GameServerDeploymentsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.deleteGameServerDeployment(request); - * const [response] = await operation.promise(); - */ deleteGameServerDeployment( request?: protos.google.cloud.gaming.v1beta.IDeleteGameServerDeploymentRequest, optionsOrCallback?: @@ -1110,11 +1105,8 @@ export class GameServerDeploymentsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkDeleteGameServerDeploymentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @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 @@ -1138,6 +1130,33 @@ export class GameServerDeploymentsServiceClient { 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 @@ -1174,34 +1193,6 @@ export class GameServerDeploymentsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.updateGameServerDeployment(request); - * const [response] = await operation.promise(); - */ updateGameServerDeployment( request?: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRequest, optionsOrCallback?: @@ -1263,11 +1254,8 @@ export class GameServerDeploymentsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkUpdateGameServerDeploymentProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @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 @@ -1291,6 +1279,38 @@ export class GameServerDeploymentsServiceClient { 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 @@ -1327,39 +1347,6 @@ export class GameServerDeploymentsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.updateGameServerDeploymentRollout(request); - * const [response] = await operation.promise(); - */ updateGameServerDeploymentRollout( request?: protos.google.cloud.gaming.v1beta.IUpdateGameServerDeploymentRolloutRequest, optionsOrCallback?: @@ -1421,11 +1408,8 @@ export class GameServerDeploymentsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkUpdateGameServerDeploymentRolloutProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @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 @@ -1449,37 +1433,6 @@ export class GameServerDeploymentsServiceClient { protos.google.cloud.gaming.v1beta.OperationMetadata >; } - 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; /** * Lists game server deployments in a given project and location. * @@ -1515,6 +1468,37 @@ export class GameServerDeploymentsServiceClient { * [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?: @@ -1651,11 +1635,8 @@ export class GameServerDeploymentsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listGameServerDeploymentsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @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, @@ -1669,7 +1650,6 @@ export class GameServerDeploymentsServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listGameServerDeployments']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index 9c36fb737d0..c7469a3e18d 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -385,6 +385,24 @@ export class RealmsServiceClient { // ------------------- // -- 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 @@ -412,24 +430,6 @@ export class RealmsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [response] = await client.getRealm(request); - */ getRealm( request?: protos.google.cloud.gaming.v1beta.IGetRealmRequest, optionsOrCallback?: @@ -469,6 +469,33 @@ export class RealmsServiceClient { 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 @@ -500,33 +527,6 @@ export class RealmsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [response] = await client.previewRealmUpdate(request); - */ previewRealmUpdate( request?: protos.google.cloud.gaming.v1beta.IPreviewRealmUpdateRequest, optionsOrCallback?: @@ -571,6 +571,30 @@ export class RealmsServiceClient { 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 @@ -607,31 +631,6 @@ export class RealmsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.createRealm(request); - * const [response] = await operation.promise(); - */ createRealm( request?: protos.google.cloud.gaming.v1beta.ICreateRealmRequest, optionsOrCallback?: @@ -689,11 +688,8 @@ export class RealmsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkCreateRealmProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta/realms_service.create_realm.js + * region_tag:gameservices_v1beta_generated_RealmsService_CreateRealm_async */ async checkCreateRealmProgress( name: string @@ -717,6 +713,26 @@ export class RealmsServiceClient { 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 @@ -753,27 +769,6 @@ export class RealmsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.deleteRealm(request); - * const [response] = await operation.promise(); - */ deleteRealm( request?: protos.google.cloud.gaming.v1beta.IDeleteRealmRequest, optionsOrCallback?: @@ -831,11 +826,8 @@ export class RealmsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkDeleteRealmProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta/realms_service.delete_realm.js + * region_tag:gameservices_v1beta_generated_RealmsService_DeleteRealm_async */ async checkDeleteRealmProgress( name: string @@ -859,6 +851,33 @@ export class RealmsServiceClient { 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 @@ -895,34 +914,6 @@ export class RealmsServiceClient { {} | null | undefined > ): void; - /** - * 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 - * const [operation] = await client.updateRealm(request); - * const [response] = await operation.promise(); - */ updateRealm( request?: protos.google.cloud.gaming.v1beta.IUpdateRealmRequest, optionsOrCallback?: @@ -980,11 +971,8 @@ export class RealmsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkUpdateRealmProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta/realms_service.update_realm.js + * region_tag:gameservices_v1beta_generated_RealmsService_UpdateRealm_async */ async checkUpdateRealmProgress( name: string @@ -1008,33 +996,6 @@ export class RealmsServiceClient { protos.google.cloud.gaming.v1beta.OperationMetadata >; } - 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; /** * Lists realms in a given project and location. * @@ -1070,6 +1031,33 @@ export class RealmsServiceClient { * [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?: @@ -1200,11 +1188,8 @@ export class RealmsServiceClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example - * const iterable = client.listRealmsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @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, @@ -1218,7 +1203,6 @@ export class RealmsServiceClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listRealms']; const callSettings = defaultCallSettings.merge(options); this.initialize(); From ee8bac4eafb6d1a36528fe8d970a15a5d0f96d82 Mon Sep 17 00:00:00 2001 From: Nicholas Cook Date: Thu, 18 Nov 2021 10:07:03 -0800 Subject: [PATCH 137/180] docs: add update samples (#230) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add update samples * Address feedback * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- packages/google-cloud-gaming/README.md | 3 ++ packages/google-cloud-gaming/package.json | 2 +- .../google-cloud-gaming/samples/README.md | 54 +++++++++++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/README.md b/packages/google-cloud-gaming/README.md index 14b91e806fa..d41dd3ec823 100644 --- a/packages/google-cloud-gaming/README.md +++ b/packages/google-cloud-gaming/README.md @@ -119,6 +119,9 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-game-server | List_deployments | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/list_deployments.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_deployments.js,samples/README.md) | | List_realms | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/list_realms.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_realms.js,samples/README.md) | | Create Game Server Realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Update_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_cluster.js,samples/README.md) | +| Update_deployment | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_deployment.js,samples/README.md) | +| Update_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_realm.js,samples/README.md) | | Update_rollout_default | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_rollout_default.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_default.js,samples/README.md) | | Update_rollout_override | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_rollout_override.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_override.js,samples/README.md) | | Update_rollout_remove_default | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_rollout_remove_default.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_remove_default.js,samples/README.md) | diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index aa954aa5ef5..35dc9258f95 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -34,7 +34,7 @@ "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.0.0", - "gts": "^2.0.0", + "gts": "^2.0.2", "jsdoc": "^3.5.5", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", diff --git a/packages/google-cloud-gaming/samples/README.md b/packages/google-cloud-gaming/samples/README.md index d1bb5f5f012..e328ce91234 100644 --- a/packages/google-cloud-gaming/samples/README.md +++ b/packages/google-cloud-gaming/samples/README.md @@ -30,6 +30,9 @@ * [List_deployments](#list_deployments) * [List_realms](#list_realms) * [Create Game Server Realm](#create-game-server-realm) + * [Update_cluster](#update_cluster) + * [Update_deployment](#update_deployment) + * [Update_realm](#update_realm) * [Update_rollout_default](#update_rollout_default) * [Update_rollout_override](#update_rollout_override) * [Update_rollout_remove_default](#update_rollout_remove_default) @@ -358,6 +361,57 @@ __Usage:__ +### Update_cluster + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_cluster.js,samples/README.md) + +__Usage:__ + + +`node samples/update_cluster.js` + + +----- + + + + +### Update_deployment + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_deployment.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_deployment.js,samples/README.md) + +__Usage:__ + + +`node samples/update_deployment.js` + + +----- + + + + +### Update_realm + +View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_realm.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_realm.js,samples/README.md) + +__Usage:__ + + +`node samples/update_realm.js` + + +----- + + + + ### Update_rollout_default View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_rollout_default.js). From e181c47f7992549151a68f1d1920f709a8982d31 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 9 Dec 2021 23:00:17 +0000 Subject: [PATCH 138/180] build: add generated samples to .eslintignore (#231) --- packages/google-cloud-gaming/.eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-gaming/.eslintignore b/packages/google-cloud-gaming/.eslintignore index 9340ad9b86d..ea5b04aebe6 100644 --- a/packages/google-cloud-gaming/.eslintignore +++ b/packages/google-cloud-gaming/.eslintignore @@ -4,3 +4,4 @@ test/fixtures build/ docs/ protos/ +samples/generated/ From 701fdefc54047fc78f9c1462fbb7196b6b931521 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 29 Dec 2021 19:56:25 +0000 Subject: [PATCH 139/180] docs(node): support "stable"/"preview" release level (#1312) (#234) --- packages/google-cloud-gaming/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-gaming/README.md b/packages/google-cloud-gaming/README.md index d41dd3ec823..664e6b71bfe 100644 --- a/packages/google-cloud-gaming/README.md +++ b/packages/google-cloud-gaming/README.md @@ -168,6 +168,8 @@ are addressed with the highest priority. + + More Information: [Google Cloud Platform Launch Stages][launch_stages] [launch_stages]: https://cloud.google.com/terms/launch-stages From 33373faa525af74771fff9e8bca7bb79db6a4612 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 30 Dec 2021 15:22:06 -0500 Subject: [PATCH 140/180] chore: add api_shortname and library_type to repo metadata (#233) --- packages/google-cloud-gaming/.repo-metadata.json | 6 ++++-- packages/google-cloud-gaming/README.md | 9 ++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-gaming/.repo-metadata.json b/packages/google-cloud-gaming/.repo-metadata.json index 4555ac64788..b9cca93c89e 100644 --- a/packages/google-cloud-gaming/.repo-metadata.json +++ b/packages/google-cloud-gaming/.repo-metadata.json @@ -3,12 +3,14 @@ "product_documentation": "https://cloud.google.com/game-servers/", "name": "game-servers", "requires_billing": true, - "release_level": "ga", + "release_level": "stable", "language": "nodejs", "api_id": "gameservices.googleapis.com", "distribution_name": "@google-cloud/game-servers", "repo": "googleapis/nodejs-game-servers", "issue_tracker": "", "name_pretty": "Google Cloud Game Servers", - "default_version": "v1" + "default_version": "v1", + "api_shortname": "gameservices", + "library_type": "GAPIC_AUTO" } diff --git a/packages/google-cloud-gaming/README.md b/packages/google-cloud-gaming/README.md index 664e6b71bfe..4f5367983b5 100644 --- a/packages/google-cloud-gaming/README.md +++ b/packages/google-cloud-gaming/README.md @@ -4,7 +4,7 @@ # [Google Cloud Game Servers: Node.js Client](https://github.com/googleapis/nodejs-game-servers) -[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-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) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-game-servers/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-game-servers) @@ -158,10 +158,10 @@ _Legacy Node.js versions are supported as a best effort:_ This library follows [Semantic Versioning](http://semver.org/). -This library is considered to be **General Availability (GA)**. This means it -is stable; the code surface will not change in backwards-incompatible ways + +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 **GA** libraries +an extensive deprecation period. Issues and requests against **stable** libraries are addressed with the highest priority. @@ -169,7 +169,6 @@ are addressed with the highest priority. - More Information: [Google Cloud Platform Launch Stages][launch_stages] [launch_stages]: https://cloud.google.com/terms/launch-stages From 09fcca185e51cc9869c6fb89254f90b2ada64636 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 30 Dec 2021 23:12:25 +0000 Subject: [PATCH 141/180] docs(badges): tweak badge to use new preview/stable language (#1314) (#236) --- packages/google-cloud-gaming/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/README.md b/packages/google-cloud-gaming/README.md index 4f5367983b5..86740e36ee2 100644 --- a/packages/google-cloud-gaming/README.md +++ b/packages/google-cloud-gaming/README.md @@ -4,9 +4,8 @@ # [Google Cloud Game Servers: Node.js Client](https://github.com/googleapis/nodejs-game-servers) - +[![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) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-game-servers/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-game-servers) From 1c34e582f15b83898d82bb32cbd323bd0fed1516 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 Jan 2022 17:02:26 +0000 Subject: [PATCH 142/180] test(nodejs): remove 15 add 16 (#1322) (#238) --- packages/google-cloud-gaming/protos/protos.d.ts | 2 +- packages/google-cloud-gaming/protos/protos.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/protos/protos.d.ts b/packages/google-cloud-gaming/protos/protos.d.ts index 02208925f8b..12823027b91 100644 --- a/packages/google-cloud-gaming/protos/protos.d.ts +++ b/packages/google-cloud-gaming/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-gaming/protos/protos.js b/packages/google-cloud-gaming/protos/protos.js index 740f8ec9a8e..53d0bba9622 100644 --- a/packages/google-cloud-gaming/protos/protos.js +++ b/packages/google-cloud-gaming/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From 62d6bc3be66a6281e2fbab38a1c8ddc3db8b4296 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 13 Jan 2022 16:36:13 +0100 Subject: [PATCH 143/180] chore(deps): update dependency gts to v3 (#239) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [gts](https://togithub.com/google/gts) | [`^2.0.2` -> `^3.0.0`](https://renovatebot.com/diffs/npm/gts/2.0.2/3.1.0) | [![age](https://badges.renovateapi.com/packages/npm/gts/3.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/gts/3.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/gts/3.1.0/compatibility-slim/2.0.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/gts/3.1.0/confidence-slim/2.0.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
google/gts ### [`v3.1.0`](https://togithub.com/google/gts/blob/HEAD/CHANGELOG.md#​310-httpswwwgithubcomgooglegtscomparev303v310-2021-01-11) [Compare Source](https://togithub.com/google/gts/compare/v3.0.3...v3.1.0) ##### Features - support comments in JSON ([#​571](https://www.togithub.com/google/gts/issues/571)) ([cb6d2ca](https://www.github.com/google/gts/commit/cb6d2cacb5de7bcc9c8e82dd47e14fc5bf9596a3)) ##### Bug Fixes - **deps:** update dependency eslint-config-prettier to v7 ([#​601](https://www.togithub.com/google/gts/issues/601)) ([6e26681](https://www.github.com/google/gts/commit/6e266812da4b90b18e2abead9b2b5a1ca0c6654b)) - **deps:** upgrade to latest version of meow ([#​616](https://www.togithub.com/google/gts/issues/616)) ([634bad9](https://www.github.com/google/gts/commit/634bad9bbbdb4d397bba101dc38ab14881172a30)) ##### [3.0.3](https://www.github.com/google/gts/compare/v3.0.2...v3.0.3) (2020-12-03) ##### Bug Fixes - **deps:** update dependency execa to v5 ([#​600](https://www.togithub.com/google/gts/issues/600)) ([4e5f1e5](https://www.github.com/google/gts/commit/4e5f1e54facf53588bbb3b025b5240edbd7f3c8a)) - **deps:** update dependency meow to v8 ([#​591](https://www.togithub.com/google/gts/issues/591)) ([c7e223e](https://www.github.com/google/gts/commit/c7e223e6a2ff605fabad2f8359a0385033f8de66)) ##### [3.0.2](https://www.github.com/google/gts/compare/v3.0.1...v3.0.2) (2020-10-26) ##### Bug Fixes - **deps:** loosen ts peer dependency ([#​589](https://www.togithub.com/google/gts/issues/589)) ([8f1d381](https://www.github.com/google/gts/commit/8f1d381d7b166a510c42786c4a337e81b7222c84)) ##### [3.0.1](https://www.github.com/google/gts/compare/v3.0.0...v3.0.1) (2020-10-12) ##### Bug Fixes - **rule:** turn off [@​typescript-eslint/no-var-requires](https://togithub.com/typescript-eslint/no-var-requires) ([#​578](https://www.togithub.com/google/gts/issues/578)) ([3b37229](https://www.github.com/google/gts/commit/3b37229c45969a3c53af123c69bb749578ee6b0b)) ### [`v3.0.3`](https://togithub.com/google/gts/blob/HEAD/CHANGELOG.md#​303-httpswwwgithubcomgooglegtscomparev302v303-2020-12-03) [Compare Source](https://togithub.com/google/gts/compare/v3.0.2...v3.0.3) ### [`v3.0.2`](https://togithub.com/google/gts/blob/HEAD/CHANGELOG.md#​302-httpswwwgithubcomgooglegtscomparev301v302-2020-10-26) [Compare Source](https://togithub.com/google/gts/compare/v3.0.1...v3.0.2) ### [`v3.0.1`](https://togithub.com/google/gts/blob/HEAD/CHANGELOG.md#​301-httpswwwgithubcomgooglegtscomparev300v301-2020-10-12) [Compare Source](https://togithub.com/google/gts/compare/v3.0.0...v3.0.1) ### [`v3.0.0`](https://togithub.com/google/gts/blob/HEAD/CHANGELOG.md#​300-httpswwwgithubcomgooglegtscomparev202v300-2020-10-08) [Compare Source](https://togithub.com/google/gts/compare/v2.0.2...v3.0.0) ##### ⚠ BREAKING CHANGES - change default `check` to `lint` ([#​570](https://togithub.com/google/gts/issues/570)) - **deps:** require TypeScript 4.x ([#​565](https://togithub.com/google/gts/issues/565)) ##### Features - Add TypeScript v4 support ([#​551](https://www.togithub.com/google/gts/issues/551)) ([0883956](https://www.github.com/google/gts/commit/08839565a1d2b4b39d532c9b0b596f01b18856fe)) - change default `check` to `lint` ([#​570](https://www.togithub.com/google/gts/issues/570)) ([c527b66](https://www.github.com/google/gts/commit/c527b66be1ef6a78ea14b3d29225a8d7fb7097bd)) - generate .eslintignore when running init ([#​521](https://www.togithub.com/google/gts/issues/521)) ([8bce036](https://www.github.com/google/gts/commit/8bce0368767f0c2ad7d0700deb839962bc928d16)) ##### Bug Fixes - add build/.eslintrc.json to files field ([#​553](https://www.togithub.com/google/gts/issues/553)) ([3b516ad](https://www.github.com/google/gts/commit/3b516ad5e9f0d58201dde469461db7c6ed1c1b78)) - **deps:** require TypeScript 4.x ([#​565](https://www.togithub.com/google/gts/issues/565)) ([cbc5267](https://www.github.com/google/gts/commit/cbc5267579ef24e8c8ceaa2ef794df3ef54ea56a)) - **deps:** update dependency update-notifier to v5 ([#​574](https://www.togithub.com/google/gts/issues/574)) ([9a882bf](https://www.github.com/google/gts/commit/9a882bf4ac30ad06e7b91a65ad5721d8e8b41c4b)) - **deps:** update typescript-eslint monorepo to v2.34.0 ([#​509](https://www.togithub.com/google/gts/issues/509)) ([998a4ac](https://www.github.com/google/gts/commit/998a4ac9b75c97f04d8e5db37563f32d31652f23)) - **deps:** update typescript-eslint monorepo to v3 (major) ([#​528](https://www.togithub.com/google/gts/issues/528)) ([e22e173](https://www.github.com/google/gts/commit/e22e17338db2ddb7eb829c821037c2f4e77ff869)) - **deps:** update typescript-eslint monorepo to v4 ([#​556](https://www.togithub.com/google/gts/issues/556)) ([54148df](https://www.github.com/google/gts/commit/54148dfbd8b5f8b36a0f44f901c5db933393a661)) - better error message for broken tsconfig.json ([#​501](https://www.togithub.com/google/gts/issues/501)) ([0c17a76](https://www.github.com/google/gts/commit/0c17a76c6650eee1d8abaff11a897a432eeaa65f)) - prohibit calls for it.only and describe.only ([#​499](https://www.togithub.com/google/gts/issues/499)) ([071c33c](https://www.github.com/google/gts/commit/071c33ceef0e3765166aaebf6ed4698167ac0f98)) ##### [2.0.2](https://www.github.com/google/gts/compare/v2.0.1...v2.0.2) (2020-05-11) ##### Bug Fixes - Revert 'update dependency eslint to v7'" ([#​507](https://www.togithub.com/google/gts/issues/507)) ([0f9950b](https://www.github.com/google/gts/commit/0f9950b273329dbcce5f3cc20864c3dcd076f08c)) - **deps:** pin release of eslint-typescript ([#​508](https://www.togithub.com/google/gts/issues/508)) ([bd86b42](https://www.github.com/google/gts/commit/bd86b42e2bb904d3765dee82262e4691a11b9958)) - **deps:** update dependency eslint to v7 ([#​504](https://www.togithub.com/google/gts/issues/504)) ([6aee159](https://www.github.com/google/gts/commit/6aee1595d0486ae2c7fd68d16b1b59c4c4015753)) ##### [2.0.1](https://www.github.com/google/gts/compare/v2.0.0...v2.0.1) (2020-05-07) ##### Bug Fixes - throw an error if running with an unsupported version of nodejs ([#​493](https://www.togithub.com/google/gts/issues/493)) ([94fdf1e](https://www.github.com/google/gts/commit/94fdf1eaed634aa73c3e44c7a3d9f1325f773b07)) - **deps:** update dependency meow to v7 ([#​502](https://www.togithub.com/google/gts/issues/502)) ([cf91cda](https://www.github.com/google/gts/commit/cf91cda1afab25759427511d3c97d0037d61c649))
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 35dc9258f95..fcabcb10f4e 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -34,7 +34,7 @@ "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.0.0", - "gts": "^2.0.2", + "gts": "^3.0.0", "jsdoc": "^3.5.5", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", From 7c097e04121b817109af65ad0ee09471a609f53e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 20 Jan 2022 00:05:39 -0800 Subject: [PATCH 144/180] build: update copyright year to 2022 (#241) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): upgrade gapic-generator-java to 2.4.1 PiperOrigin-RevId: 422607515 Source-Link: https://github.com/googleapis/googleapis/commit/ba2ffd6fe6642e28b4fed2ffae217b4c5f084034 Source-Link: https://github.com/googleapis/googleapis-gen/commit/73ba4add239a619da567ffbd4e5730fdd6de04d3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzNiYTRhZGQyMzlhNjE5ZGE1NjdmZmJkNGU1NzMwZmRkNmRlMDRkMyJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- packages/google-cloud-gaming/.jsdoc.js | 4 ++-- ..._server_clusters_service.create_game_server_cluster.js | 4 ++-- ..._server_clusters_service.delete_game_server_cluster.js | 4 ++-- ...ame_server_clusters_service.get_game_server_cluster.js | 4 ++-- ...e_server_clusters_service.list_game_server_clusters.js | 6 +++--- ...clusters_service.preview_create_game_server_cluster.js | 4 ++-- ...clusters_service.preview_delete_game_server_cluster.js | 4 ++-- ...clusters_service.preview_update_game_server_cluster.js | 4 ++-- ..._server_clusters_service.update_game_server_cluster.js | 4 ++-- ...me_server_configs_service.create_game_server_config.js | 4 ++-- ...me_server_configs_service.delete_game_server_config.js | 4 ++-- .../game_server_configs_service.get_game_server_config.js | 4 ++-- ...ame_server_configs_service.list_game_server_configs.js | 6 +++--- ...r_deployments_service.create_game_server_deployment.js | 4 ++-- ...r_deployments_service.delete_game_server_deployment.js | 4 ++-- ...e_server_deployments_service.fetch_deployment_state.js | 4 ++-- ...rver_deployments_service.get_game_server_deployment.js | 4 ++-- ...loyments_service.get_game_server_deployment_rollout.js | 4 ++-- ...er_deployments_service.list_game_server_deployments.js | 6 +++--- ...ents_service.preview_game_server_deployment_rollout.js | 8 +++----- ...r_deployments_service.update_game_server_deployment.js | 4 ++-- ...ments_service.update_game_server_deployment_rollout.js | 8 +++----- .../samples/generated/v1/realms_service.create_realm.js | 1 + .../samples/generated/v1/realms_service.delete_realm.js | 1 + .../samples/generated/v1/realms_service.get_realm.js | 1 + .../samples/generated/v1/realms_service.list_realms.js | 3 ++- .../generated/v1/realms_service.preview_realm_update.js | 1 + .../samples/generated/v1/realms_service.update_realm.js | 1 + ..._server_clusters_service.create_game_server_cluster.js | 4 ++-- ..._server_clusters_service.delete_game_server_cluster.js | 4 ++-- ...ame_server_clusters_service.get_game_server_cluster.js | 4 ++-- ...e_server_clusters_service.list_game_server_clusters.js | 8 ++++---- ...clusters_service.preview_create_game_server_cluster.js | 4 ++-- ...clusters_service.preview_delete_game_server_cluster.js | 4 ++-- ...clusters_service.preview_update_game_server_cluster.js | 4 ++-- ..._server_clusters_service.update_game_server_cluster.js | 4 ++-- ...me_server_configs_service.create_game_server_config.js | 4 ++-- ...me_server_configs_service.delete_game_server_config.js | 4 ++-- .../game_server_configs_service.get_game_server_config.js | 4 ++-- ...ame_server_configs_service.list_game_server_configs.js | 8 ++++---- ...r_deployments_service.create_game_server_deployment.js | 4 ++-- ...r_deployments_service.delete_game_server_deployment.js | 4 ++-- ...e_server_deployments_service.fetch_deployment_state.js | 4 ++-- ...rver_deployments_service.get_game_server_deployment.js | 4 ++-- ...loyments_service.get_game_server_deployment_rollout.js | 4 ++-- ...er_deployments_service.list_game_server_deployments.js | 8 ++++---- ...ents_service.preview_game_server_deployment_rollout.js | 8 +++----- ...r_deployments_service.update_game_server_deployment.js | 4 ++-- ...ments_service.update_game_server_deployment_rollout.js | 8 +++----- .../generated/v1beta/realms_service.create_realm.js | 1 + .../generated/v1beta/realms_service.delete_realm.js | 1 + .../samples/generated/v1beta/realms_service.get_realm.js | 1 + .../generated/v1beta/realms_service.list_realms.js | 5 +++-- .../v1beta/realms_service.preview_realm_update.js | 1 + .../generated/v1beta/realms_service.update_realm.js | 1 + .../src/v1/game_server_clusters_service_client.ts | 2 +- .../src/v1/game_server_configs_service_client.ts | 2 +- .../src/v1/game_server_deployments_service_client.ts | 2 +- packages/google-cloud-gaming/src/v1/index.ts | 2 +- .../google-cloud-gaming/src/v1/realms_service_client.ts | 2 +- .../src/v1beta/game_server_clusters_service_client.ts | 2 +- .../src/v1beta/game_server_configs_service_client.ts | 2 +- .../src/v1beta/game_server_deployments_service_client.ts | 2 +- packages/google-cloud-gaming/src/v1beta/index.ts | 2 +- .../src/v1beta/realms_service_client.ts | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- packages/google-cloud-gaming/system-test/install.ts | 2 +- .../test/gapic_game_server_clusters_service_v1.ts | 2 +- .../test/gapic_game_server_clusters_service_v1beta.ts | 2 +- .../test/gapic_game_server_configs_service_v1.ts | 2 +- .../test/gapic_game_server_configs_service_v1beta.ts | 2 +- .../test/gapic_game_server_deployments_service_v1.ts | 2 +- .../test/gapic_game_server_deployments_service_v1beta.ts | 2 +- .../google-cloud-gaming/test/gapic_realms_service_v1.ts | 2 +- .../test/gapic_realms_service_v1beta.ts | 2 +- 76 files changed, 135 insertions(+), 131 deletions(-) diff --git a/packages/google-cloud-gaming/.jsdoc.js b/packages/google-cloud-gaming/.jsdoc.js index afa8bc52af2..649bdebb185 100644 --- a/packages/google-cloud-gaming/.jsdoc.js +++ b/packages/google-cloud-gaming/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2021 Google LLC', + copyright: 'Copyright 2022 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/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 index 9d81d1f4f3e..1b491dda1c3 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, gameServerClusterId, gameServerCluster) { @@ -34,8 +35,7 @@ function main(parent, gameServerClusterId, gameServerCluster) { // const gameServerCluster = {} // Imports the Gaming library - const {GameServerClustersServiceClient} = - require('@google-cloud/game-servers').v1; + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1; // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); 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 index 08e9c161770..cbae0a2941f 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Gaming library - const {GameServerClustersServiceClient} = - require('@google-cloud/game-servers').v1; + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1; // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); 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 index d5b0d7f1b75..3f6b27faebb 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -35,8 +36,7 @@ function main(name) { // const view = {} // Imports the Gaming library - const {GameServerClustersServiceClient} = - require('@google-cloud/game-servers').v1; + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1; // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); 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 index a600d19ff6e..40164730eaf 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -56,8 +57,7 @@ function main(parent) { // const view = {} // Imports the Gaming library - const {GameServerClustersServiceClient} = - require('@google-cloud/game-servers').v1; + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1; // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); @@ -71,7 +71,7 @@ function main(parent) { // Run request const iterable = await gamingClient.listGameServerClustersAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } 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 index a316e3059fd..5bf08151e2e 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, gameServerClusterId, gameServerCluster) { @@ -43,8 +44,7 @@ function main(parent, gameServerClusterId, gameServerCluster) { // const view = {} // Imports the Gaming library - const {GameServerClustersServiceClient} = - require('@google-cloud/game-servers').v1; + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1; // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); 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 index f969af575bc..597cf932c3d 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -30,8 +31,7 @@ function main(name) { // const previewTime = {} // Imports the Gaming library - const {GameServerClustersServiceClient} = - require('@google-cloud/game-servers').v1; + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1; // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); 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 index c851f46d718..89f73166539 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(gameServerCluster, updateMask) { @@ -36,8 +37,7 @@ function main(gameServerCluster, updateMask) { // const previewTime = {} // Imports the Gaming library - const {GameServerClustersServiceClient} = - require('@google-cloud/game-servers').v1; + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1; // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); 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 index 134116d2f83..e7295274f82 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(gameServerCluster, updateMask) { @@ -32,8 +33,7 @@ function main(gameServerCluster, updateMask) { // const updateMask = {} // Imports the Gaming library - const {GameServerClustersServiceClient} = - require('@google-cloud/game-servers').v1; + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1; // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); 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 index b00270a8bd5..4ca6464fc17 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, configId, gameServerConfig) { @@ -34,8 +35,7 @@ function main(parent, configId, gameServerConfig) { // const gameServerConfig = {} // Imports the Gaming library - const {GameServerConfigsServiceClient} = - require('@google-cloud/game-servers').v1; + const {GameServerConfigsServiceClient} = require('@google-cloud/game-servers').v1; // Instantiates a client const gamingClient = new GameServerConfigsServiceClient(); 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 index e1c6fa0eaf5..9adc5282961 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Gaming library - const {GameServerConfigsServiceClient} = - require('@google-cloud/game-servers').v1; + const {GameServerConfigsServiceClient} = require('@google-cloud/game-servers').v1; // Instantiates a client const gamingClient = new GameServerConfigsServiceClient(); 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 index 4fd433c6a1c..55e36f6e3a8 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Gaming library - const {GameServerConfigsServiceClient} = - require('@google-cloud/game-servers').v1; + const {GameServerConfigsServiceClient} = require('@google-cloud/game-servers').v1; // Instantiates a client const gamingClient = new GameServerConfigsServiceClient(); 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 index 1b98b61f539..e2267756b10 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -47,8 +48,7 @@ function main(parent) { // const orderBy = 'abc123' // Imports the Gaming library - const {GameServerConfigsServiceClient} = - require('@google-cloud/game-servers').v1; + const {GameServerConfigsServiceClient} = require('@google-cloud/game-servers').v1; // Instantiates a client const gamingClient = new GameServerConfigsServiceClient(); @@ -62,7 +62,7 @@ function main(parent) { // Run request const iterable = await gamingClient.listGameServerConfigsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } 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 index b84a8301a8a..584ca1b8bd9 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, deploymentId, gameServerDeployment) { @@ -34,8 +35,7 @@ function main(parent, deploymentId, gameServerDeployment) { // const gameServerDeployment = {} // Imports the Gaming library - const {GameServerDeploymentsServiceClient} = - require('@google-cloud/game-servers').v1; + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1; // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); 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 index c8759d5f396..c5011979690 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Gaming library - const {GameServerDeploymentsServiceClient} = - require('@google-cloud/game-servers').v1; + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1; // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); 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 index 8dcd0c7b8f2..11b708d1dcf 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Gaming library - const {GameServerDeploymentsServiceClient} = - require('@google-cloud/game-servers').v1; + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1; // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); 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 index eb72b2fce7f..d1c20fa720c 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Gaming library - const {GameServerDeploymentsServiceClient} = - require('@google-cloud/game-servers').v1; + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1; // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); 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 index 96a1b1fe02c..6c950c54c96 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Gaming library - const {GameServerDeploymentsServiceClient} = - require('@google-cloud/game-servers').v1; + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1; // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); 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 index 7902b098060..988847e5a90 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -48,8 +49,7 @@ function main(parent) { // const orderBy = 'abc123' // Imports the Gaming library - const {GameServerDeploymentsServiceClient} = - require('@google-cloud/game-servers').v1; + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1; // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); @@ -63,7 +63,7 @@ function main(parent) { // Run request const iterable = await gamingClient.listGameServerDeploymentsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } 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 index 8aa76ba565f..e0c26bde661 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(rollout) { @@ -37,8 +38,7 @@ function main(rollout) { // const previewTime = {} // Imports the Gaming library - const {GameServerDeploymentsServiceClient} = - require('@google-cloud/game-servers').v1; + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1; // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); @@ -50,9 +50,7 @@ function main(rollout) { }; // Run request - const response = await gamingClient.previewGameServerDeploymentRollout( - request - ); + const response = await gamingClient.previewGameServerDeploymentRollout(request); console.log(response); } 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 index 0c7e0135a58..cf0bdeb2fb1 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(gameServerDeployment, updateMask) { @@ -32,8 +33,7 @@ function main(gameServerDeployment, updateMask) { // const updateMask = {} // Imports the Gaming library - const {GameServerDeploymentsServiceClient} = - require('@google-cloud/game-servers').v1; + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1; // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); 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 index 63687b493e4..847b94a878b 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(rollout, updateMask) { @@ -32,8 +33,7 @@ function main(rollout, updateMask) { // const updateMask = {} // Imports the Gaming library - const {GameServerDeploymentsServiceClient} = - require('@google-cloud/game-servers').v1; + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1; // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); @@ -46,9 +46,7 @@ function main(rollout, updateMask) { }; // Run request - const [operation] = await gamingClient.updateGameServerDeploymentRollout( - request - ); + const [operation] = await gamingClient.updateGameServerDeploymentRollout(request); const [response] = await operation.promise(); console.log(response); } 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 index 3eb57e7c10b..2861a76b578 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, realmId, realm) { 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 index 9ae7732eaec..0d3db7ecaf3 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { 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 index 4e72bd258cf..54fea01d8ba 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { 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 index 94b606f23b3..34a6cb69677 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -62,7 +63,7 @@ function main(parent) { // Run request const iterable = await gamingClient.listRealmsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } 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 index 6536851d126..a17ef4bc7cf 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(realm, updateMask) { 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 index e64466e863a..5d37c1116db 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(realm, updateMask) { 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 index fc106621ccc..ec95445d0ae 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, gameServerClusterId, gameServerCluster) { @@ -34,8 +35,7 @@ function main(parent, gameServerClusterId, gameServerCluster) { // const gameServerCluster = {} // Imports the Gaming library - const {GameServerClustersServiceClient} = - require('@google-cloud/game-servers').v1beta; + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1beta; // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); 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 index a3b81d0822a..5b3dc3745ba 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Gaming library - const {GameServerClustersServiceClient} = - require('@google-cloud/game-servers').v1beta; + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1beta; // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); 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 index 6b988fcad62..642862abd53 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Gaming library - const {GameServerClustersServiceClient} = - require('@google-cloud/game-servers').v1beta; + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1beta; // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); 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 index 58f4b6a6fa5..b11734560bf 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -28,7 +29,7 @@ function main(parent) { * 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 + * 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 @@ -48,8 +49,7 @@ function main(parent) { // const orderBy = 'abc123' // Imports the Gaming library - const {GameServerClustersServiceClient} = - require('@google-cloud/game-servers').v1beta; + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1beta; // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); @@ -63,7 +63,7 @@ function main(parent) { // Run request const iterable = await gamingClient.listGameServerClustersAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } 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 index 5b1230bcc60..d03e0806af6 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, gameServerClusterId, gameServerCluster) { @@ -38,8 +39,7 @@ function main(parent, gameServerClusterId, gameServerCluster) { // const previewTime = {} // Imports the Gaming library - const {GameServerClustersServiceClient} = - require('@google-cloud/game-servers').v1beta; + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1beta; // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); 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 index 32fa469fcd4..0f9a6024745 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -30,8 +31,7 @@ function main(name) { // const previewTime = {} // Imports the Gaming library - const {GameServerClustersServiceClient} = - require('@google-cloud/game-servers').v1beta; + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1beta; // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); 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 index 46a3436daf0..5852893624c 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(gameServerCluster, updateMask) { @@ -38,8 +39,7 @@ function main(gameServerCluster, updateMask) { // const previewTime = {} // Imports the Gaming library - const {GameServerClustersServiceClient} = - require('@google-cloud/game-servers').v1beta; + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1beta; // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); 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 index c1b499f9ad1..b1311769d6c 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(gameServerCluster, updateMask) { @@ -34,8 +35,7 @@ function main(gameServerCluster, updateMask) { // const updateMask = {} // Imports the Gaming library - const {GameServerClustersServiceClient} = - require('@google-cloud/game-servers').v1beta; + const {GameServerClustersServiceClient} = require('@google-cloud/game-servers').v1beta; // Instantiates a client const gamingClient = new GameServerClustersServiceClient(); 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 index c2d07eab3ed..8f513a44ae3 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, configId, gameServerConfig) { @@ -34,8 +35,7 @@ function main(parent, configId, gameServerConfig) { // const gameServerConfig = {} // Imports the Gaming library - const {GameServerConfigsServiceClient} = - require('@google-cloud/game-servers').v1beta; + const {GameServerConfigsServiceClient} = require('@google-cloud/game-servers').v1beta; // Instantiates a client const gamingClient = new GameServerConfigsServiceClient(); 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 index 542e3ae20a0..f5d0a3edef9 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Gaming library - const {GameServerConfigsServiceClient} = - require('@google-cloud/game-servers').v1beta; + const {GameServerConfigsServiceClient} = require('@google-cloud/game-servers').v1beta; // Instantiates a client const gamingClient = new GameServerConfigsServiceClient(); 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 index a1c3286ffc9..2470ef8ac98 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Gaming library - const {GameServerConfigsServiceClient} = - require('@google-cloud/game-servers').v1beta; + const {GameServerConfigsServiceClient} = require('@google-cloud/game-servers').v1beta; // Instantiates a client const gamingClient = new GameServerConfigsServiceClient(); 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 index c89d1e5ad2a..2c3a8f277ad 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -28,7 +29,7 @@ function main(parent) { * 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 + * 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 @@ -48,8 +49,7 @@ function main(parent) { // const orderBy = 'abc123' // Imports the Gaming library - const {GameServerConfigsServiceClient} = - require('@google-cloud/game-servers').v1beta; + const {GameServerConfigsServiceClient} = require('@google-cloud/game-servers').v1beta; // Instantiates a client const gamingClient = new GameServerConfigsServiceClient(); @@ -63,7 +63,7 @@ function main(parent) { // Run request const iterable = await gamingClient.listGameServerConfigsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } 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 index c59f86509a9..0caafdf77c6 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, deploymentId, gameServerDeployment) { @@ -34,8 +35,7 @@ function main(parent, deploymentId, gameServerDeployment) { // const gameServerDeployment = {} // Imports the Gaming library - const {GameServerDeploymentsServiceClient} = - require('@google-cloud/game-servers').v1beta; + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1beta; // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); 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 index 5657ae1399e..64f6abb9969 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Gaming library - const {GameServerDeploymentsServiceClient} = - require('@google-cloud/game-servers').v1beta; + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1beta; // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); 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 index d151b9148a5..eca2261ca3e 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Gaming library - const {GameServerDeploymentsServiceClient} = - require('@google-cloud/game-servers').v1beta; + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1beta; // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); 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 index 610399c2496..7c72499cf1d 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -27,8 +28,7 @@ function main(name) { // const name = 'abc123' // Imports the Gaming library - const {GameServerDeploymentsServiceClient} = - require('@google-cloud/game-servers').v1beta; + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1beta; // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); 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 index 6878f5d45b0..cace5989c75 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -27,8 +28,7 @@ function main(name) { // const name = 'abc123' // Imports the Gaming library - const {GameServerDeploymentsServiceClient} = - require('@google-cloud/game-servers').v1beta; + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1beta; // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); 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 index 4a97f09dfa7..6946901690a 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -28,7 +29,7 @@ function main(parent) { * 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 + * 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 @@ -48,8 +49,7 @@ function main(parent) { // const orderBy = 'abc123' // Imports the Gaming library - const {GameServerDeploymentsServiceClient} = - require('@google-cloud/game-servers').v1beta; + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1beta; // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); @@ -63,7 +63,7 @@ function main(parent) { // Run request const iterable = await gamingClient.listGameServerDeploymentsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } 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 index 46117d3c4e5..4877a525b23 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(rollout) { @@ -39,8 +40,7 @@ function main(rollout) { // const previewTime = {} // Imports the Gaming library - const {GameServerDeploymentsServiceClient} = - require('@google-cloud/game-servers').v1beta; + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1beta; // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); @@ -52,9 +52,7 @@ function main(rollout) { }; // Run request - const response = await gamingClient.previewGameServerDeploymentRollout( - request - ); + const response = await gamingClient.previewGameServerDeploymentRollout(request); console.log(response); } 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 index 51e0641a4aa..317c7699ec3 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(gameServerDeployment, updateMask) { @@ -34,8 +35,7 @@ function main(gameServerDeployment, updateMask) { // const updateMask = {} // Imports the Gaming library - const {GameServerDeploymentsServiceClient} = - require('@google-cloud/game-servers').v1beta; + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1beta; // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); 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 index d14ae6c62db..f93d1291128 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(rollout, updateMask) { @@ -34,8 +35,7 @@ function main(rollout, updateMask) { // const updateMask = {} // Imports the Gaming library - const {GameServerDeploymentsServiceClient} = - require('@google-cloud/game-servers').v1beta; + const {GameServerDeploymentsServiceClient} = require('@google-cloud/game-servers').v1beta; // Instantiates a client const gamingClient = new GameServerDeploymentsServiceClient(); @@ -48,9 +48,7 @@ function main(rollout, updateMask) { }; // Run request - const [operation] = await gamingClient.updateGameServerDeploymentRollout( - request - ); + const [operation] = await gamingClient.updateGameServerDeploymentRollout(request); const [response] = await operation.promise(); console.log(response); } 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 index d68f8035910..e0315948f75 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, realmId, realm) { 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 index 1dd3076b9da..d2efc481afb 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { 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 index 929ee21c41a..25a1f5e6f2f 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { 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 index c16b2e36646..012301b9ee8 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -28,7 +29,7 @@ function main(parent) { * 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 + * 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 @@ -62,7 +63,7 @@ function main(parent) { // Run request const iterable = await gamingClient.listRealmsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } 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 index ac5c2a80507..5214e7dbb83 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(realm, updateMask) { 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 index 7efc58d6695..8729b17d85c 100644 --- 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 @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(realm, updateMask) { 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 index 1fc312f75fe..024ceb90121 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 index e8c43eb9752..787aa4c3242 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 index 3362386bee3..d4b7f4dbcaf 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-gaming/src/v1/index.ts b/packages/google-cloud-gaming/src/v1/index.ts index 497ac69df5c..86b711bd392 100644 --- a/packages/google-cloud-gaming/src/v1/index.ts +++ b/packages/google-cloud-gaming/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-gaming/src/v1/realms_service_client.ts b/packages/google-cloud-gaming/src/v1/realms_service_client.ts index e4ba9c331e7..f4772911c46 100644 --- a/packages/google-cloud-gaming/src/v1/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1/realms_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 index 8c3691d2537..091a1a84d4a 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 index b69ea9888ec..23a91db2730 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 index 01765b630e9..03fb50e8adf 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-gaming/src/v1beta/index.ts b/packages/google-cloud-gaming/src/v1beta/index.ts index 497ac69df5c..86b711bd392 100644 --- a/packages/google-cloud-gaming/src/v1beta/index.ts +++ b/packages/google-cloud-gaming/src/v1beta/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index c7469a3e18d..ad85f21ed27 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 index 08fcf40d666..84204c96442 100644 --- a/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 index 86f5b7f598b..6d282fc65bd 100644 --- a/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-gaming/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-gaming/system-test/install.ts b/packages/google-cloud-gaming/system-test/install.ts index d2d61c0396f..6dd1eaadafa 100644 --- a/packages/google-cloud-gaming/system-test/install.ts +++ b/packages/google-cloud-gaming/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 index 4652b8ea7ad..94d0cf0d47f 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 index e4f036f2fe2..271c5477ca2 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 index 179a1836da5..79b656151dd 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 index 02172636575..62860309899 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 index 6798bbe5872..cfd7d4d1c9f 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. 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 index cee5b2ccc0d..adc57bbe562 100644 --- 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 @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts b/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts index 12c02763ee7..887bfa18c38 100644 --- a/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts index d983b06edbc..d1fe20e8050 100644 --- a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. From c3e3ece94b7b598af1cc29723be82b6d0d6bf978 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 26 Jan 2022 19:56:18 +0000 Subject: [PATCH 145/180] chore: update v2.12.0 gapic-generator-typescript (#243) - [ ] Regenerate this pull request now. Committer: @summer-ji-eng PiperOrigin-RevId: 424244721 Source-Link: https://github.com/googleapis/googleapis/commit/4b6b01f507ebc3df95fdf8e1d76b0ae0ae33e52c Source-Link: https://github.com/googleapis/googleapis-gen/commit/8ac83fba606d008c7e8a42e7d55b6596ec4be35f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGFjODNmYmE2MDZkMDA4YzdlOGE0MmU3ZDU1YjY1OTZlYzRiZTM1ZiJ9 --- packages/google-cloud-gaming/linkinator.config.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-gaming/linkinator.config.json b/packages/google-cloud-gaming/linkinator.config.json index 0121dfa684f..befd23c8633 100644 --- a/packages/google-cloud-gaming/linkinator.config.json +++ b/packages/google-cloud-gaming/linkinator.config.json @@ -3,8 +3,14 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "img.shields.io" + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" ], "silent": true, - "concurrency": 5 + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 } From f63d276ad9349fac3913183eb4627777fa1264ae Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 31 Jan 2022 23:28:36 +0100 Subject: [PATCH 146/180] chore(deps): update dependency sinon to v13 (#245) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^12.0.0` -> `^13.0.0`](https://renovatebot.com/diffs/npm/sinon/12.0.1/13.0.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/compatibility-slim/12.0.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/13.0.0/confidence-slim/12.0.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v13.0.0`](https://togithub.com/sinonjs/sinon/blob/HEAD/CHANGES.md#​1300) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v12.0.1...v13.0.0) - [`cf3d6c0c`](https://togithub.com/sinonjs/sinon/commit/cf3d6c0cd9689c0ee673b3daa8bf9abd70304392) Upgrade packages ([#​2431](https://togithub.com/sinonjs/sinon/issues/2431)) (Carl-Erik Kopseng) > - Update all @​sinonjs/ packages > > - Upgrade to fake-timers 9 > > - chore: ensure always using latest LTS release - [`41710467`](https://togithub.com/sinonjs/sinon/commit/417104670d575e96a1b645ea40ce763afa76fb1b) Adjust deploy scripts to archive old releases in a separate branch, move existing releases out of master ([#​2426](https://togithub.com/sinonjs/sinon/issues/2426)) (Joel Bradshaw) > Co-authored-by: Carl-Erik Kopseng - [`c80a7266`](https://togithub.com/sinonjs/sinon/commit/c80a72660e89d88b08275eff1028ecb9e26fd8e9) Bump node-fetch from 2.6.1 to 2.6.7 ([#​2430](https://togithub.com/sinonjs/sinon/issues/2430)) (dependabot\[bot]) > Co-authored-by: dependabot\[bot] <49699333+dependabot\[bot][@​users](https://togithub.com/users).noreply.github.com> - [`a00f14a9`](https://togithub.com/sinonjs/sinon/commit/a00f14a97dbe8c65afa89674e16ad73fc7d2fdc0) Add explicit export for `./*` ([#​2413](https://togithub.com/sinonjs/sinon/issues/2413)) (なつき) - [`b82ca7ad`](https://togithub.com/sinonjs/sinon/commit/b82ca7ad9b1add59007771f65a18ee34415de8ca) Bump cached-path-relative from 1.0.2 to 1.1.0 ([#​2428](https://togithub.com/sinonjs/sinon/issues/2428)) (dependabot\[bot]) - [`a9ea1427`](https://togithub.com/sinonjs/sinon/commit/a9ea142716c094ef3c432ecc4089f8207b8dd8b6) Add documentation for assert.calledOnceWithMatch ([#​2424](https://togithub.com/sinonjs/sinon/issues/2424)) (Mathias Schreck) - [`1d5ab86b`](https://togithub.com/sinonjs/sinon/commit/1d5ab86ba60e50dd69593ffed2bffd4b8faa0d38) Be more general in stripping off stack frames to fix Firefox tests ([#​2425](https://togithub.com/sinonjs/sinon/issues/2425)) (Joel Bradshaw) - [`56b06129`](https://togithub.com/sinonjs/sinon/commit/56b06129e223eae690265c37b1113067e2b31bdc) Check call count type ([#​2410](https://togithub.com/sinonjs/sinon/issues/2410)) (Joel Bradshaw) - [`7863e2df`](https://togithub.com/sinonjs/sinon/commit/7863e2dfdbda79e0a32e42af09e6539fc2f2b80f) Fix [#​2414](https://togithub.com/sinonjs/sinon/issues/2414): make Sinon available on homepage (Carl-Erik Kopseng) - [`fabaabdd`](https://togithub.com/sinonjs/sinon/commit/fabaabdda82f39a7f5b75b55bd56cf77b1cd4a8f) Bump nokogiri from 1.11.4 to 1.13.1 ([#​2423](https://togithub.com/sinonjs/sinon/issues/2423)) (dependabot\[bot]) - [`dbc0fbd2`](https://togithub.com/sinonjs/sinon/commit/dbc0fbd263c8419fa47f9c3b20cf47890a242d21) Bump shelljs from 0.8.4 to 0.8.5 ([#​2422](https://togithub.com/sinonjs/sinon/issues/2422)) (dependabot\[bot]) - [`fb8b3d72`](https://togithub.com/sinonjs/sinon/commit/fb8b3d72a85dc8fb0547f859baf3f03a22a039f7) Run Prettier (Carl-Erik Kopseng) - [`12a45939`](https://togithub.com/sinonjs/sinon/commit/12a45939e9b047b6d3663fe55f2eb383ec63c4e1) Fix 2377: Throw error when trying to stub non-configurable or non-writable properties ([#​2417](https://togithub.com/sinonjs/sinon/issues/2417)) (Stuart Dotson) > Fixes issue [#​2377](https://togithub.com/sinonjs/sinon/issues/2377) by throwing an error when trying to stub non-configurable or non-writable properties *Released by [Carl-Erik Kopseng](https://togithub.com/fatso83) on 2022-01-28.*
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index fcabcb10f4e..0e02815cebc 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -42,7 +42,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^12.0.0", + "sinon": "^13.0.0", "ts-loader": "^9.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", From 3672d728481d4134e083e6a294463dc48f0d137d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 3 Feb 2022 22:04:58 +0000 Subject: [PATCH 147/180] docs(nodejs): version support policy edits (#1346) (#247) --- packages/google-cloud-gaming/README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-gaming/README.md b/packages/google-cloud-gaming/README.md index 86740e36ee2..cb39069f4bb 100644 --- a/packages/google-cloud-gaming/README.md +++ b/packages/google-cloud-gaming/README.md @@ -136,21 +136,21 @@ also contains samples. 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. -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. - -_Legacy Node.js versions are supported as a best effort:_ +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: -* Legacy versions will not be tested in continuous integration. -* Some security patches may not be able to be backported. -* Dependencies will not be kept up-to-date, and features will not be backported. +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. -#### Legacy tags available - -* `legacy-8`: install client libraries from this dist-tag for versions - compatible with Node.js 8. +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 From 34ba82d3ad9424d332197c0b3594cfc3ac6c4528 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 18 Feb 2022 02:08:56 +0000 Subject: [PATCH 148/180] docs(samples): include metadata file, add exclusions for samples to handwritten libraries (#248) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 429395631 Source-Link: https://github.com/googleapis/googleapis/commit/84594b35af0c38efcd6967e8179d801702ad96ff Source-Link: https://github.com/googleapis/googleapis-gen/commit/ed74f970fd82914874e6b27b04763cfa66bafe9b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWQ3NGY5NzBmZDgyOTE0ODc0ZTZiMjdiMDQ3NjNjZmE2NmJhZmU5YiJ9 --- ...ters_service.create_game_server_cluster.js | 9 +- ...ters_service.delete_game_server_cluster.js | 9 +- ...lusters_service.get_game_server_cluster.js | 9 +- ...sters_service.list_game_server_clusters.js | 9 +- ...vice.preview_create_game_server_cluster.js | 9 +- ...vice.preview_delete_game_server_cluster.js | 9 +- ...vice.preview_update_game_server_cluster.js | 9 +- ...ters_service.update_game_server_cluster.js | 9 +- ...nfigs_service.create_game_server_config.js | 9 +- ...nfigs_service.delete_game_server_config.js | 9 +- ..._configs_service.get_game_server_config.js | 9 +- ...onfigs_service.list_game_server_configs.js | 9 +- ...s_service.create_game_server_deployment.js | 9 +- ...s_service.delete_game_server_deployment.js | 9 +- ...loyments_service.fetch_deployment_state.js | 9 +- ...ents_service.get_game_server_deployment.js | 9 +- ...vice.get_game_server_deployment_rollout.js | 9 +- ...ts_service.list_game_server_deployments.js | 9 +- ....preview_game_server_deployment_rollout.js | 9 +- ...s_service.update_game_server_deployment.js | 9 +- ...e.update_game_server_deployment_rollout.js | 9 +- .../v1/realms_service.create_realm.js | 9 +- .../v1/realms_service.delete_realm.js | 9 +- .../generated/v1/realms_service.get_realm.js | 9 +- .../v1/realms_service.list_realms.js | 9 +- .../v1/realms_service.preview_realm_update.js | 9 +- .../v1/realms_service.update_realm.js | 9 +- ...ippet_metadata.google.cloud.gaming.v1.json | 1259 +++++++++++++++++ ...ters_service.create_game_server_cluster.js | 9 +- ...ters_service.delete_game_server_cluster.js | 9 +- ...lusters_service.get_game_server_cluster.js | 9 +- ...sters_service.list_game_server_clusters.js | 9 +- ...vice.preview_create_game_server_cluster.js | 9 +- ...vice.preview_delete_game_server_cluster.js | 9 +- ...vice.preview_update_game_server_cluster.js | 9 +- ...ters_service.update_game_server_cluster.js | 9 +- ...nfigs_service.create_game_server_config.js | 9 +- ...nfigs_service.delete_game_server_config.js | 9 +- ..._configs_service.get_game_server_config.js | 9 +- ...onfigs_service.list_game_server_configs.js | 9 +- ...s_service.create_game_server_deployment.js | 9 +- ...s_service.delete_game_server_deployment.js | 9 +- ...loyments_service.fetch_deployment_state.js | 9 +- ...ents_service.get_game_server_deployment.js | 9 +- ...vice.get_game_server_deployment_rollout.js | 9 +- ...ts_service.list_game_server_deployments.js | 9 +- ....preview_game_server_deployment_rollout.js | 9 +- ...s_service.update_game_server_deployment.js | 9 +- ...e.update_game_server_deployment_rollout.js | 9 +- .../v1beta/realms_service.create_realm.js | 9 +- .../v1beta/realms_service.delete_realm.js | 9 +- .../v1beta/realms_service.get_realm.js | 9 +- .../v1beta/realms_service.list_realms.js | 9 +- .../realms_service.preview_realm_update.js | 9 +- .../v1beta/realms_service.update_realm.js | 9 +- ...t_metadata.google.cloud.gaming.v1beta.json | 1247 ++++++++++++++++ .../v1/game_server_clusters_service_client.ts | 5 +- .../v1/game_server_configs_service_client.ts | 5 +- .../game_server_deployments_service_client.ts | 5 +- .../src/v1/realms_service_client.ts | 5 +- .../game_server_clusters_service_client.ts | 5 +- .../game_server_configs_service_client.ts | 5 +- .../game_server_deployments_service_client.ts | 5 +- .../src/v1beta/realms_service_client.ts | 5 +- .../gapic_game_server_clusters_service_v1.ts | 98 +- ...pic_game_server_clusters_service_v1beta.ts | 108 +- .../gapic_game_server_configs_service_v1.ts | 37 +- ...apic_game_server_configs_service_v1beta.ts | 39 +- ...apic_game_server_deployments_service_v1.ts | 108 +- ..._game_server_deployments_service_v1beta.ts | 108 +- .../test/gapic_realms_service_v1.ts | 52 +- .../test/gapic_realms_service_v1beta.ts | 52 +- 72 files changed, 3486 insertions(+), 148 deletions(-) create mode 100644 packages/google-cloud-gaming/samples/generated/v1/snippet_metadata.google.cloud.gaming.v1.json create mode 100644 packages/google-cloud-gaming/samples/generated/v1beta/snippet_metadata.google.cloud.gaming.v1beta.json 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 index 1b491dda1c3..13050309aae 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index cbae0a2941f..df81eef6b4f 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 3f6b27faebb..0a724779815 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 40164730eaf..18dd322052d 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 5bf08151e2e..b758128f841 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 597cf932c3d..3c9385b20bc 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 89f73166539..3b654d16a0c 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index e7295274f82..157dba34d13 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 4ca6464fc17..68c32348668 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 9adc5282961..3b6ac2b286b 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 55e36f6e3a8..bc8668be39e 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index e2267756b10..926292b6400 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 584ca1b8bd9..579d2aed4e8 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index c5011979690..c1764e7d178 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 11b708d1dcf..88a9378d120 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index d1c20fa720c..46e1f6dcf97 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 6c950c54c96..0ace7cd4780 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 988847e5a90..cd7aa5b94c4 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index e0c26bde661..0632186c9d3 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index cf0bdeb2fb1..37f0ebf9425 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 847b94a878b..21de72e147f 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 2861a76b578..e0ff05579d3 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 0d3db7ecaf3..8bd12c0e81c 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 54fea01d8ba..0cafdb3515b 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 34a6cb69677..49a416dff2f 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index a17ef4bc7cf..de43ea2dc0b 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 5d37c1116db..c878c0efe96 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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..d3ad67d4b59 --- /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": "0.1.0", + "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": 83, + "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": 60, + "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": 62, + "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": 70, + "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": 52, + "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": 55, + "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": 59, + "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": 62, + "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": 74, + "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": 51, + "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": 62, + "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": 52, + "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": 75, + "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": 51, + "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": 62, + "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": 52, + "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": 59, + "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": 51, + "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": 59, + "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": 62, + "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": 51, + "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": 75, + "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": 51, + "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": 62, + "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": 52, + "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": 59, + "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": 62, + "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" + } + } + } + } + ] +} 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 index ec95445d0ae..ef5d601d369 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 5b3dc3745ba..2a62e7880a7 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 642862abd53..e7f1b11d259 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index b11734560bf..696634bff36 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index d03e0806af6..044068729b3 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 0f9a6024745..1fade1029db 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 5852893624c..bde1416614a 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index b1311769d6c..3b6cc045b4a 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 8f513a44ae3..fb49085c1d9 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index f5d0a3edef9..2b6c0dc87f1 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 2470ef8ac98..a633554f0f2 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 2c3a8f277ad..0172aad78b4 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 0caafdf77c6..1bb5584958d 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 64f6abb9969..8ea0e556757 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index eca2261ca3e..4b59aeb94e2 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 7c72499cf1d..b856e6699ac 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index cace5989c75..b3dcc1d196e 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 6946901690a..f592e7f1b0b 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 4877a525b23..cd4fe13f700 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 317c7699ec3..69fe50d038a 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index f93d1291128..402f60f424b 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index e0315948f75..240e45545b6 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index d2efc481afb..6b4b5e9d481 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 25a1f5e6f2f..ba1726f2e78 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 012301b9ee8..cd1b5f2c49e 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 5214e7dbb83..38f7cebd15c 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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 index 8729b17d85c..d9066825449 100644 --- 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 @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.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 +// https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + 'use strict'; 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..40642960f2e --- /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": "0.1.0", + "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": 75, + "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": 51, + "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": 62, + "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": 65, + "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": 52, + "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": 55, + "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": 61, + "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": 64, + "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": 75, + "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": 51, + "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": 62, + "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": 52, + "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": 75, + "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": 52, + "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": 62, + "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": 52, + "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": 61, + "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": 52, + "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": 61, + "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": 64, + "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": 51, + "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": 75, + "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": 51, + "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": 62, + "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": 52, + "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": 61, + "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": 64, + "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" + } + } + } + } + ] +} 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 index 024ceb90121..b0b07cd456a 100644 --- 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 @@ -1839,9 +1839,8 @@ export class GameServerClustersServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.gameServerClustersServiceStub!.then(stub => { + if (this.gameServerClustersServiceStub && !this._terminated) { + return this.gameServerClustersServiceStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); 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 index 787aa4c3242..c5b02cc372a 100644 --- 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 @@ -1320,9 +1320,8 @@ export class GameServerConfigsServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.gameServerConfigsServiceStub!.then(stub => { + if (this.gameServerConfigsServiceStub && !this._terminated) { + return this.gameServerConfigsServiceStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); 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 index d4b7f4dbcaf..623c3b8e85c 100644 --- 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 @@ -1968,9 +1968,8 @@ export class GameServerDeploymentsServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.gameServerDeploymentsServiceStub!.then(stub => { + if (this.gameServerDeploymentsServiceStub && !this._terminated) { + return this.gameServerDeploymentsServiceStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-gaming/src/v1/realms_service_client.ts b/packages/google-cloud-gaming/src/v1/realms_service_client.ts index f4772911c46..b9a7369602d 100644 --- a/packages/google-cloud-gaming/src/v1/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1/realms_service_client.ts @@ -1540,9 +1540,8 @@ export class RealmsServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.realmsServiceStub!.then(stub => { + if (this.realmsServiceStub && !this._terminated) { + return this.realmsServiceStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); 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 index 091a1a84d4a..01f549aa283 100644 --- 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 @@ -1824,9 +1824,8 @@ export class GameServerClustersServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.gameServerClustersServiceStub!.then(stub => { + if (this.gameServerClustersServiceStub && !this._terminated) { + return this.gameServerClustersServiceStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); 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 index 23a91db2730..2be8685d3f5 100644 --- 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 @@ -1330,9 +1330,8 @@ export class GameServerConfigsServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.gameServerConfigsServiceStub!.then(stub => { + if (this.gameServerConfigsServiceStub && !this._terminated) { + return this.gameServerConfigsServiceStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); 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 index 03fb50e8adf..cad82938282 100644 --- 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 @@ -1995,9 +1995,8 @@ export class GameServerDeploymentsServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.gameServerDeploymentsServiceStub!.then(stub => { + if (this.gameServerDeploymentsServiceStub && !this._terminated) { + return this.gameServerDeploymentsServiceStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index ad85f21ed27..b07fbbc933c 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -1548,9 +1548,8 @@ export class RealmsServiceClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.realmsServiceStub!.then(stub => { + if (this.realmsServiceStub && !this._terminated) { + return this.realmsServiceStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); 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 index 94d0cf0d47f..3a56d6e3f03 100644 --- 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 @@ -191,13 +191,29 @@ describe('v1.GameServerClustersServiceClient', () => { assert(client.gameServerClustersServiceStub); }); - it('has close method', () => { + 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.close(); + 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 () => { @@ -349,6 +365,23 @@ describe('v1.GameServerClustersServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getGameServerCluster(request), expectedError); + }); }); describe('previewCreateGameServerCluster', () => { @@ -467,6 +500,26 @@ describe('v1.GameServerClustersServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.previewCreateGameServerCluster(request), + expectedError + ); + }); }); describe('previewDeleteGameServerCluster', () => { @@ -585,6 +638,26 @@ describe('v1.GameServerClustersServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.previewDeleteGameServerCluster(request), + expectedError + ); + }); }); describe('previewUpdateGameServerCluster', () => { @@ -706,6 +779,27 @@ describe('v1.GameServerClustersServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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 = {}; + request.gameServerCluster.name = ''; + const expectedHeaderRequestParams = 'game_server_cluster.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.previewUpdateGameServerCluster(request), + expectedError + ); + }); }); describe('createGameServerCluster', () => { 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 index 271c5477ca2..b0a19340240 100644 --- 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 @@ -196,7 +196,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { assert(client.gameServerClustersServiceStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient( { @@ -204,7 +204,25 @@ describe('v1beta.GameServerClustersServiceClient', () => { projectId: 'bogus', } ); - client.close(); + 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 () => { @@ -366,6 +384,25 @@ describe('v1beta.GameServerClustersServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getGameServerCluster(request), expectedError); + }); }); describe('previewCreateGameServerCluster', () => { @@ -490,6 +527,28 @@ describe('v1beta.GameServerClustersServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.previewCreateGameServerCluster(request), + expectedError + ); + }); }); describe('previewDeleteGameServerCluster', () => { @@ -614,6 +673,28 @@ describe('v1beta.GameServerClustersServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.previewDeleteGameServerCluster(request), + expectedError + ); + }); }); describe('previewUpdateGameServerCluster', () => { @@ -741,6 +822,29 @@ describe('v1beta.GameServerClustersServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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 = {}; + request.gameServerCluster.name = ''; + const expectedHeaderRequestParams = 'game_server_cluster.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.previewUpdateGameServerCluster(request), + expectedError + ); + }); }); describe('createGameServerCluster', () => { 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 index 79b656151dd..65946acaa09 100644 --- 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 @@ -191,13 +191,29 @@ describe('v1.GameServerConfigsServiceClient', () => { assert(client.gameServerConfigsServiceStub); }); - it('has close method', () => { + 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.close(); + 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 () => { @@ -349,6 +365,23 @@ describe('v1.GameServerConfigsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getGameServerConfig(request), expectedError); + }); }); describe('createGameServerConfig', () => { 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 index 62860309899..717c906a8f5 100644 --- 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 @@ -191,13 +191,29 @@ describe('v1beta.GameServerConfigsServiceClient', () => { assert(client.gameServerConfigsServiceStub); }); - it('has close method', () => { + 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.close(); + 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 () => { @@ -355,6 +371,25 @@ describe('v1beta.GameServerConfigsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getGameServerConfig(request), expectedError); + }); }); describe('createGameServerConfig', () => { 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 index cfd7d4d1c9f..0b0c60135e8 100644 --- 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 @@ -196,7 +196,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { assert(client.gameServerDeploymentsServiceStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient( { @@ -204,7 +204,25 @@ describe('v1.GameServerDeploymentsServiceClient', () => { projectId: 'bogus', } ); - client.close(); + 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 () => { @@ -369,6 +387,28 @@ describe('v1.GameServerDeploymentsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getGameServerDeployment(request), + expectedError + ); + }); }); describe('getGameServerDeploymentRollout', () => { @@ -493,6 +533,28 @@ describe('v1.GameServerDeploymentsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getGameServerDeploymentRollout(request), + expectedError + ); + }); }); describe('previewGameServerDeploymentRollout', () => { @@ -622,6 +684,29 @@ describe('v1.GameServerDeploymentsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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 = {}; + request.rollout.name = ''; + const expectedHeaderRequestParams = 'rollout.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.previewGameServerDeploymentRollout(request), + expectedError + ); + }); }); describe('fetchDeploymentState', () => { @@ -743,6 +828,25 @@ describe('v1.GameServerDeploymentsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.fetchDeploymentState(request), expectedError); + }); }); describe('createGameServerDeployment', () => { 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 index adc57bbe562..ea45b9b6476 100644 --- 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 @@ -196,7 +196,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { assert(client.gameServerDeploymentsServiceStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new gameserverdeploymentsserviceModule.v1beta.GameServerDeploymentsServiceClient( { @@ -204,7 +204,25 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { projectId: 'bogus', } ); - client.close(); + 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 () => { @@ -369,6 +387,28 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getGameServerDeployment(request), + expectedError + ); + }); }); describe('getGameServerDeploymentRollout', () => { @@ -493,6 +533,28 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getGameServerDeploymentRollout(request), + expectedError + ); + }); }); describe('previewGameServerDeploymentRollout', () => { @@ -622,6 +684,29 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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 = {}; + request.rollout.name = ''; + const expectedHeaderRequestParams = 'rollout.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.previewGameServerDeploymentRollout(request), + expectedError + ); + }); }); describe('fetchDeploymentState', () => { @@ -743,6 +828,25 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.fetchDeploymentState(request), expectedError); + }); }); describe('createGameServerDeployment', () => { diff --git a/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts b/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts index 887bfa18c38..124ea34695d 100644 --- a/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts @@ -183,12 +183,27 @@ describe('v1.RealmsServiceClient', () => { assert(client.realmsServiceStub); }); - it('has close method', () => { + 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.close(); + 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 () => { @@ -331,6 +346,22 @@ describe('v1.RealmsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getRealm(request), expectedError); + }); }); describe('previewRealmUpdate', () => { @@ -446,6 +477,23 @@ describe('v1.RealmsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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 = {}; + request.realm.name = ''; + const expectedHeaderRequestParams = 'realm.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.previewRealmUpdate(request), expectedError); + }); }); describe('createRealm', () => { diff --git a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts index d1fe20e8050..1d9d186dd83 100644 --- a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts @@ -185,12 +185,27 @@ describe('v1beta.RealmsServiceClient', () => { assert(client.realmsServiceStub); }); - it('has close method', () => { + 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.close(); + 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 () => { @@ -333,6 +348,22 @@ describe('v1beta.RealmsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getRealm(request), expectedError); + }); }); describe('previewRealmUpdate', () => { @@ -448,6 +479,23 @@ describe('v1beta.RealmsServiceClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + 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 = {}; + request.realm.name = ''; + const expectedHeaderRequestParams = 'realm.name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.previewRealmUpdate(request), expectedError); + }); }); describe('createRealm', () => { From e768ea03ec4ffacd66e02a56ffd1e504d94ca2c8 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 16 Mar 2022 18:16:24 -0700 Subject: [PATCH 149/180] chore: update v2.14.2 gapic-generator-typescript (#252) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update v2.14.2 gapic-generator-typescript Committer: @summer-ji-eng PiperOrigin-RevId: 434859890 Source-Link: https://github.com/googleapis/googleapis/commit/bc2432d50cba657e95212122e3fa112591b5bec2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/930b673103e92523f8cfed38decd7d3afae8ebe7 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTMwYjY3MzEwM2U5MjUyM2Y4Y2ZlZDM4ZGVjZDdkM2FmYWU4ZWJlNyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../test/gapic_game_server_clusters_service_v1.ts | 4 ---- .../test/gapic_game_server_clusters_service_v1beta.ts | 4 ---- .../test/gapic_game_server_configs_service_v1.ts | 1 - .../test/gapic_game_server_configs_service_v1beta.ts | 1 - .../test/gapic_game_server_deployments_service_v1.ts | 4 ---- .../test/gapic_game_server_deployments_service_v1beta.ts | 4 ---- packages/google-cloud-gaming/test/gapic_realms_service_v1.ts | 2 -- .../google-cloud-gaming/test/gapic_realms_service_v1beta.ts | 2 -- 8 files changed, 22 deletions(-) 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 index 3a56d6e3f03..b85c56907bc 100644 --- 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 @@ -377,7 +377,6 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.GetGameServerClusterRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getGameServerCluster(request), expectedError); @@ -512,7 +511,6 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -650,7 +648,6 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -792,7 +789,6 @@ describe('v1.GameServerClustersServiceClient', () => { ); request.gameServerCluster = {}; request.gameServerCluster.name = ''; - const expectedHeaderRequestParams = 'game_server_cluster.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( 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 index b0a19340240..b9792e77342 100644 --- 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 @@ -398,7 +398,6 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.GetGameServerClusterRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getGameServerCluster(request), expectedError); @@ -541,7 +540,6 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -687,7 +685,6 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -837,7 +834,6 @@ describe('v1beta.GameServerClustersServiceClient', () => { ); request.gameServerCluster = {}; request.gameServerCluster.name = ''; - const expectedHeaderRequestParams = 'game_server_cluster.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( 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 index 65946acaa09..6b2da5a767b 100644 --- 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 @@ -377,7 +377,6 @@ describe('v1.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1.GetGameServerConfigRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getGameServerConfig(request), expectedError); 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 index 717c906a8f5..14159995ddc 100644 --- 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 @@ -385,7 +385,6 @@ describe('v1beta.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1beta.GetGameServerConfigRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getGameServerConfig(request), expectedError); 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 index 0b0c60135e8..e9b98c4cb4b 100644 --- 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 @@ -401,7 +401,6 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.GetGameServerDeploymentRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -547,7 +546,6 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -699,7 +697,6 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ); request.rollout = {}; request.rollout.name = ''; - const expectedHeaderRequestParams = 'rollout.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -842,7 +839,6 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.FetchDeploymentStateRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.fetchDeploymentState(request), expectedError); 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 index ea45b9b6476..91d7b82c109 100644 --- 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 @@ -401,7 +401,6 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -547,7 +546,6 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -699,7 +697,6 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); request.rollout = {}; request.rollout.name = ''; - const expectedHeaderRequestParams = 'rollout.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -842,7 +839,6 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.FetchDeploymentStateRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.fetchDeploymentState(request), expectedError); diff --git a/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts b/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts index 124ea34695d..2d6b6a71913 100644 --- a/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts @@ -357,7 +357,6 @@ describe('v1.RealmsServiceClient', () => { new protos.google.cloud.gaming.v1.GetRealmRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getRealm(request), expectedError); @@ -489,7 +488,6 @@ describe('v1.RealmsServiceClient', () => { ); request.realm = {}; request.realm.name = ''; - const expectedHeaderRequestParams = 'realm.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.previewRealmUpdate(request), expectedError); diff --git a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts index 1d9d186dd83..e2f2cc48020 100644 --- a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts @@ -359,7 +359,6 @@ describe('v1beta.RealmsServiceClient', () => { new protos.google.cloud.gaming.v1beta.GetRealmRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getRealm(request), expectedError); @@ -491,7 +490,6 @@ describe('v1beta.RealmsServiceClient', () => { ); request.realm = {}; request.realm.name = ''; - const expectedHeaderRequestParams = 'realm.name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.previewRealmUpdate(request), expectedError); From df315fe2409c6f10b6f67fde2cf3cd6a89daa8fb Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 31 Mar 2022 17:27:08 -0700 Subject: [PATCH 150/180] chore: remove unused imports (#253) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: remove unused imports PiperOrigin-RevId: 437796977 Source-Link: https://github.com/googleapis/googleapis/commit/9346947b1ce6173e9c82fe3267af02360517398c Source-Link: https://github.com/googleapis/googleapis-gen/commit/6af642d98282ff31310bd686d21adb1d207f38a6 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNmFmNjQyZDk4MjgyZmYzMTMxMGJkNjg2ZDIxYWRiMWQyMDdmMzhhNiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../google/cloud/gaming/v1/common.proto | 1 - .../gaming/v1/game_server_clusters.proto | 1 - .../cloud/gaming/v1/game_server_configs.proto | 1 - .../gaming/v1/game_server_deployments.proto | 1 - .../google/cloud/gaming/v1/realms.proto | 1 - .../google-cloud-gaming/protos/protos.d.ts | 476 ++--- packages/google-cloud-gaming/protos/protos.js | 1710 ++++++++--------- .../google-cloud-gaming/protos/protos.json | 154 +- 8 files changed, 1170 insertions(+), 1175 deletions(-) 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 index 5efe00c97f6..843042671ff 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/common.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/common.proto @@ -19,7 +19,6 @@ package google.cloud.gaming.v1; import "google/api/field_behavior.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1;gaming"; option java_multiple_files = true; 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 index ba6a5586cdd..02fbc0f890b 100644 --- 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 @@ -21,7 +21,6 @@ import "google/api/resource.proto"; import "google/cloud/gaming/v1/common.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1;gaming"; option java_multiple_files = true; 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 index e92448d2fae..c9848654e85 100644 --- 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 @@ -20,7 +20,6 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/gaming/v1/common.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1;gaming"; option java_multiple_files = true; 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 index 169558092cb..3c01717dd9b 100644 --- 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 @@ -21,7 +21,6 @@ import "google/api/resource.proto"; import "google/cloud/gaming/v1/common.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1;gaming"; option java_multiple_files = true; 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 index 8acadf57779..007071a9063 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/realms.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1/realms.proto @@ -21,7 +21,6 @@ import "google/api/resource.proto"; import "google/cloud/gaming/v1/common.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1;gaming"; option java_multiple_files = true; diff --git a/packages/google-cloud-gaming/protos/protos.d.ts b/packages/google-cloud-gaming/protos/protos.d.ts index 12823027b91..84e8a7f6041 100644 --- a/packages/google-cloud-gaming/protos/protos.d.ts +++ b/packages/google-cloud-gaming/protos/protos.d.ts @@ -14348,6 +14348,244 @@ export namespace google { 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 }; + } + + 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 }; + } + /** Properties of a Http. */ interface IHttp { @@ -14686,244 +14924,6 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } - - /** 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 }; - } - - 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 }; - } } /** Namespace protobuf. */ diff --git a/packages/google-cloud-gaming/protos/protos.js b/packages/google-cloud-gaming/protos/protos.js index 53d0bba9622..e3a3f223d6c 100644 --- a/packages/google-cloud-gaming/protos/protos.js +++ b/packages/google-cloud-gaming/protos/protos.js @@ -33634,26 +33634,32 @@ return values; })(); - api.Http = (function() { + api.ResourceDescriptor = (function() { /** - * Properties of a Http. + * Properties of a ResourceDescriptor. * @memberof google.api - * @interface IHttp - * @property {Array.|null} [rules] Http rules - * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion + * @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 Http. + * Constructs a new ResourceDescriptor. * @memberof google.api - * @classdesc Represents a Http. - * @implements IHttp + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor * @constructor - * @param {google.api.IHttp=} [properties] Properties to set + * @param {google.api.IResourceDescriptor=} [properties] Properties to set */ - function Http(properties) { - this.rules = []; + 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) @@ -33661,91 +33667,167 @@ } /** - * Http rules. - * @member {Array.} rules - * @memberof google.api.Http + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor * @instance */ - Http.prototype.rules = $util.emptyArray; + ResourceDescriptor.prototype.type = ""; /** - * Http fullyDecodeReservedExpansion. - * @member {boolean} fullyDecodeReservedExpansion - * @memberof google.api.Http + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor * @instance */ - Http.prototype.fullyDecodeReservedExpansion = false; + ResourceDescriptor.prototype.pattern = $util.emptyArray; /** - * Creates a new Http instance using the specified properties. + * 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.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttp=} [properties] Properties to set - * @returns {google.api.Http} Http instance + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance */ - Http.create = function create(properties) { - return new Http(properties); + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); }; /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encode - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encode = function encode(message, writer) { + ResourceDescriptor.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); + 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 Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.IHttp} message Http message or plain object to encode + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Http.encodeDelimited = function encodeDelimited(message, writer) { + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Http message from the specified reader or buffer. + * Decodes a ResourceDescriptor message from the specified reader or buffer. * @function decode - * @memberof google.api.Http + * @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.Http} Http + * @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 */ - Http.decode = function decode(reader, length) { + 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.Http(); + 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: - if (!(message.rules && message.rules.length)) - message.rules = []; - message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); + message.type = reader.string(); break; case 2: - message.fullyDecodeReservedExpansion = reader.bool(); + 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); @@ -33756,143 +33838,246 @@ }; /** - * Decodes a Http message from the specified reader or buffer, length delimited. + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.Http} Http + * @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 */ - Http.decodeDelimited = function decodeDelimited(reader) { + ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Http message. + * Verifies a ResourceDescriptor message. * @function verify - * @memberof google.api.Http + * @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 */ - Http.verify = function verify(message) { + ResourceDescriptor.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.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; + } } - 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. + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static * @param {Object.} object Plain object - * @returns {google.api.Http} Http + * @returns {google.api.ResourceDescriptor} ResourceDescriptor */ - Http.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.Http) + ResourceDescriptor.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceDescriptor) 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]); - } + 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) { + 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: + case "STYLE_UNSPECIFIED": + case 0: + message.style[i] = 0; + break; + case "DECLARATIVE_FRIENDLY": + case 1: + message.style[i] = 1; + break; + } } - 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. + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @static - * @param {google.api.Http} message Http + * @param {google.api.ResourceDescriptor} message ResourceDescriptor * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Http.toObject = function toObject(message, options) { + ResourceDescriptor.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 (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] : 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]] : message.style[j]; } - if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) - object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; return object; }; /** - * Converts this Http to JSON. + * Converts this ResourceDescriptor to JSON. * @function toJSON - * @memberof google.api.Http + * @memberof google.api.ResourceDescriptor * @instance * @returns {Object.} JSON object */ - Http.prototype.toJSON = function toJSON() { + ResourceDescriptor.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Http; + /** + * 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.HttpRule = (function() { + api.ResourceReference = (function() { /** - * Properties of a HttpRule. + * Properties of a ResourceReference. * @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 + * @interface IResourceReference + * @property {string|null} [type] ResourceReference type + * @property {string|null} [childType] ResourceReference childType */ /** - * Constructs a new HttpRule. + * Constructs a new ResourceReference. * @memberof google.api - * @classdesc Represents a HttpRule. - * @implements IHttpRule + * @classdesc Represents a ResourceReference. + * @implements IResourceReference * @constructor - * @param {google.api.IHttpRule=} [properties] Properties to set + * @param {google.api.IResourceReference=} [properties] Properties to set */ - function HttpRule(properties) { - this.additionalBindings = []; + function ResourceReference(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -33900,209 +34085,88 @@ } /** - * 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 + * ResourceReference type. + * @member {string} type + * @memberof google.api.ResourceReference * @instance */ - HttpRule.prototype.additionalBindings = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ResourceReference.prototype.type = ""; /** - * HttpRule pattern. - * @member {"get"|"put"|"post"|"delete"|"patch"|"custom"|undefined} pattern - * @memberof google.api.HttpRule + * ResourceReference childType. + * @member {string} childType + * @memberof google.api.ResourceReference * @instance */ - Object.defineProperty(HttpRule.prototype, "pattern", { - get: $util.oneOfGetter($oneOfFields = ["get", "put", "post", "delete", "patch", "custom"]), - set: $util.oneOfSetter($oneOfFields) - }); + ResourceReference.prototype.childType = ""; /** - * Creates a new HttpRule instance using the specified properties. + * Creates a new ResourceReference instance using the specified properties. * @function create - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.IHttpRule=} [properties] Properties to set - * @returns {google.api.HttpRule} HttpRule instance + * @param {google.api.IResourceReference=} [properties] Properties to set + * @returns {google.api.ResourceReference} ResourceReference instance */ - HttpRule.create = function create(properties) { - return new HttpRule(properties); + ResourceReference.create = function create(properties) { + return new ResourceReference(properties); }; /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encode - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encode = function encode(message, writer) { + ResourceReference.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); + 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 HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.IHttpRule} message HttpRule message or plain object to encode + * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - HttpRule.encodeDelimited = function encodeDelimited(message, writer) { + ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a HttpRule message from the specified reader or buffer. + * Decodes a ResourceReference message from the specified reader or buffer. * @function decode - * @memberof google.api.HttpRule + * @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.HttpRule} HttpRule + * @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 */ - HttpRule.decode = function decode(reader, length) { + 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.HttpRule(); + 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.selector = reader.string(); + message.type = 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())); + message.childType = reader.string(); break; default: reader.skipType(tag & 7); @@ -34113,240 +34177,118 @@ }; /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.HttpRule} HttpRule + * @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 */ - HttpRule.decodeDelimited = function decodeDelimited(reader) { + ResourceReference.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a HttpRule message. + * Verifies a ResourceReference message. * @function verify - * @memberof google.api.HttpRule + * @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 - */ - 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; - } - } + */ + 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 HttpRule message from a plain object. Also converts values to their respective internal types. + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static * @param {Object.} object Plain object - * @returns {google.api.HttpRule} HttpRule + * @returns {google.api.ResourceReference} ResourceReference */ - HttpRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.HttpRule) + ResourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.ResourceReference) 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]); - } - } + 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 HttpRule message. Also converts values to other types if specified. + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @static - * @param {google.api.HttpRule} message HttpRule + * @param {google.api.ResourceReference} message ResourceReference * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - HttpRule.toObject = function toObject(message, options) { + ResourceReference.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); + object.type = ""; + object.childType = ""; } - if (message.responseBody != null && message.hasOwnProperty("responseBody")) - object.responseBody = message.responseBody; + 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 HttpRule to JSON. + * Converts this ResourceReference to JSON. * @function toJSON - * @memberof google.api.HttpRule + * @memberof google.api.ResourceReference * @instance * @returns {Object.} JSON object */ - HttpRule.prototype.toJSON = function toJSON() { + ResourceReference.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return HttpRule; + return ResourceReference; })(); - api.CustomHttpPattern = (function() { + api.Http = (function() { /** - * Properties of a CustomHttpPattern. + * Properties of a Http. * @memberof google.api - * @interface ICustomHttpPattern - * @property {string|null} [kind] CustomHttpPattern kind - * @property {string|null} [path] CustomHttpPattern path + * @interface IHttp + * @property {Array.|null} [rules] Http rules + * @property {boolean|null} [fullyDecodeReservedExpansion] Http fullyDecodeReservedExpansion */ /** - * Constructs a new CustomHttpPattern. + * Constructs a new Http. * @memberof google.api - * @classdesc Represents a CustomHttpPattern. - * @implements ICustomHttpPattern + * @classdesc Represents a Http. + * @implements IHttp * @constructor - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @param {google.api.IHttp=} [properties] Properties to set */ - function CustomHttpPattern(properties) { + function Http(properties) { + this.rules = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34354,88 +34296,91 @@ } /** - * CustomHttpPattern kind. - * @member {string} kind - * @memberof google.api.CustomHttpPattern + * Http rules. + * @member {Array.} rules + * @memberof google.api.Http * @instance */ - CustomHttpPattern.prototype.kind = ""; + Http.prototype.rules = $util.emptyArray; /** - * CustomHttpPattern path. - * @member {string} path - * @memberof google.api.CustomHttpPattern + * Http fullyDecodeReservedExpansion. + * @member {boolean} fullyDecodeReservedExpansion + * @memberof google.api.Http * @instance */ - CustomHttpPattern.prototype.path = ""; + Http.prototype.fullyDecodeReservedExpansion = false; /** - * Creates a new CustomHttpPattern instance using the specified properties. + * Creates a new Http instance using the specified properties. * @function create - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.ICustomHttpPattern=} [properties] Properties to set - * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance + * @param {google.api.IHttp=} [properties] Properties to set + * @returns {google.api.Http} Http instance */ - CustomHttpPattern.create = function create(properties) { - return new CustomHttpPattern(properties); + Http.create = function create(properties) { + return new Http(properties); }; /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encode - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encode = function encode(message, writer) { + Http.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); + 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 CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode + * @param {google.api.IHttp} message Http message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { + Http.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. + * Decodes a Http message from the specified reader or buffer. * @function decode - * @memberof google.api.CustomHttpPattern + * @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.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decode = function decode(reader, length) { + 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.CustomHttpPattern(); + 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: - message.kind = reader.string(); + if (!(message.rules && message.rules.length)) + message.rules = []; + message.rules.push($root.google.api.HttpRule.decode(reader, reader.uint32())); break; case 2: - message.path = reader.string(); + message.fullyDecodeReservedExpansion = reader.bool(); break; default: reader.skipType(tag & 7); @@ -34446,124 +34391,143 @@ }; /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * Decodes a Http message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @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 */ - CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { + Http.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CustomHttpPattern message. + * Verifies a Http message. * @function verify - * @memberof google.api.CustomHttpPattern + * @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 */ - CustomHttpPattern.verify = function verify(message) { + Http.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"; + 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 CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * Creates a Http message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static * @param {Object.} object Plain object - * @returns {google.api.CustomHttpPattern} CustomHttpPattern + * @returns {google.api.Http} Http */ - CustomHttpPattern.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.CustomHttpPattern) + Http.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.Http) 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); + 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 CustomHttpPattern message. Also converts values to other types if specified. + * Creates a plain object from a Http message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @static - * @param {google.api.CustomHttpPattern} message CustomHttpPattern + * @param {google.api.Http} message Http * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CustomHttpPattern.toObject = function toObject(message, options) { + Http.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.kind = ""; - object.path = ""; + 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.kind != null && message.hasOwnProperty("kind")) - object.kind = message.kind; - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; + if (message.fullyDecodeReservedExpansion != null && message.hasOwnProperty("fullyDecodeReservedExpansion")) + object.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion; return object; }; /** - * Converts this CustomHttpPattern to JSON. + * Converts this Http to JSON. * @function toJSON - * @memberof google.api.CustomHttpPattern + * @memberof google.api.Http * @instance * @returns {Object.} JSON object */ - CustomHttpPattern.prototype.toJSON = function toJSON() { + Http.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CustomHttpPattern; + return Http; })(); - api.ResourceDescriptor = (function() { + api.HttpRule = (function() { /** - * Properties of a ResourceDescriptor. + * Properties of a HttpRule. * @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 + * @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 ResourceDescriptor. + * Constructs a new HttpRule. * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor + * @classdesc Represents a HttpRule. + * @implements IHttpRule * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @param {google.api.IHttpRule=} [properties] Properties to set */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; + function HttpRule(properties) { + this.additionalBindings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34571,167 +34535,209 @@ } /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor + * HttpRule selector. + * @member {string} selector + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.type = ""; + HttpRule.prototype.selector = ""; /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor + * HttpRule get. + * @member {string|null|undefined} get + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; + HttpRule.prototype.get = null; /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor + * HttpRule put. + * @member {string|null|undefined} put + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.nameField = ""; + HttpRule.prototype.put = null; /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor + * HttpRule post. + * @member {string|null|undefined} post + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.history = 0; + HttpRule.prototype.post = null; /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor + * HttpRule delete. + * @member {string|null|undefined} delete + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.plural = ""; + HttpRule.prototype["delete"] = null; /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor + * HttpRule patch. + * @member {string|null|undefined} patch + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.singular = ""; + HttpRule.prototype.patch = null; /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor + * HttpRule custom. + * @member {google.api.ICustomHttpPattern|null|undefined} custom + * @memberof google.api.HttpRule * @instance */ - ResourceDescriptor.prototype.style = $util.emptyArray; + HttpRule.prototype.custom = null; /** - * Creates a new ResourceDescriptor instance using the specified properties. + * 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.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + * @param {google.api.IHttpRule=} [properties] Properties to set + * @returns {google.api.HttpRule} HttpRule instance */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); + HttpRule.create = function create(properties) { + return new HttpRule(properties); }; /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encode - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encode = function encode(message, writer) { + HttpRule.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(); - } + 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 ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {google.api.IHttpRule} message HttpRule message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + HttpRule.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. + * Decodes a HttpRule message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceDescriptor + * @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.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.decode = function decode(reader, length) { + 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.ResourceDescriptor(); + 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.type = reader.string(); + message.selector = reader.string(); break; case 2: - if (!(message.pattern && message.pattern.length)) - message.pattern = []; - message.pattern.push(reader.string()); + message.get = reader.string(); break; case 3: - message.nameField = reader.string(); + message.put = reader.string(); break; case 4: - message.history = reader.int32(); + message.post = reader.string(); break; case 5: - message.plural = reader.string(); + message["delete"] = reader.string(); break; case 6: - message.singular = reader.string(); + message.patch = 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()); + 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); @@ -34742,246 +34748,240 @@ }; /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * Decodes a HttpRule message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @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 */ - ResourceDescriptor.decodeDelimited = function decodeDelimited(reader) { + HttpRule.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceDescriptor message. + * Verifies a HttpRule message. * @function verify - * @memberof google.api.ResourceDescriptor + * @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 */ - ResourceDescriptor.verify = function verify(message) { + HttpRule.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"; + 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.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.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; } - 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. + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @returns {google.api.HttpRule} HttpRule */ - ResourceDescriptor.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceDescriptor) + HttpRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.HttpRule) 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) { - 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; + 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.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: - case "STYLE_UNSPECIFIED": - case 0: - message.style[i] = 0; - break; - case "DECLARATIVE_FRIENDLY": - case 1: - message.style[i] = 1; - break; - } + 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 ResourceDescriptor message. Also converts values to other types if specified. + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @static - * @param {google.api.ResourceDescriptor} message ResourceDescriptor + * @param {google.api.HttpRule} message HttpRule * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceDescriptor.toObject = function toObject(message, options) { + HttpRule.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.pattern = []; - object.style = []; + 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 (options.defaults) { - object.type = ""; - object.nameField = ""; - object.history = options.enums === String ? "HISTORY_UNSPECIFIED" : 0; - object.plural = ""; - object.singular = ""; + if (message.put != null && message.hasOwnProperty("put")) { + object.put = message.put; + if (options.oneofs) + object.pattern = "put"; } - 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.post != null && message.hasOwnProperty("post")) { + object.post = message.post; + if (options.oneofs) + object.pattern = "post"; } - 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] : 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]] : message.style[j]; + 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 ResourceDescriptor to JSON. + * Converts this HttpRule to JSON. * @function toJSON - * @memberof google.api.ResourceDescriptor + * @memberof google.api.HttpRule * @instance * @returns {Object.} JSON object */ - ResourceDescriptor.prototype.toJSON = function toJSON() { + HttpRule.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * 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; + return HttpRule; })(); - api.ResourceReference = (function() { + api.CustomHttpPattern = (function() { /** - * Properties of a ResourceReference. + * Properties of a CustomHttpPattern. * @memberof google.api - * @interface IResourceReference - * @property {string|null} [type] ResourceReference type - * @property {string|null} [childType] ResourceReference childType + * @interface ICustomHttpPattern + * @property {string|null} [kind] CustomHttpPattern kind + * @property {string|null} [path] CustomHttpPattern path */ /** - * Constructs a new ResourceReference. + * Constructs a new CustomHttpPattern. * @memberof google.api - * @classdesc Represents a ResourceReference. - * @implements IResourceReference + * @classdesc Represents a CustomHttpPattern. + * @implements ICustomHttpPattern * @constructor - * @param {google.api.IResourceReference=} [properties] Properties to set + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set */ - function ResourceReference(properties) { + function CustomHttpPattern(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34989,88 +34989,88 @@ } /** - * ResourceReference type. - * @member {string} type - * @memberof google.api.ResourceReference + * CustomHttpPattern kind. + * @member {string} kind + * @memberof google.api.CustomHttpPattern * @instance */ - ResourceReference.prototype.type = ""; + CustomHttpPattern.prototype.kind = ""; /** - * ResourceReference childType. - * @member {string} childType - * @memberof google.api.ResourceReference + * CustomHttpPattern path. + * @member {string} path + * @memberof google.api.CustomHttpPattern * @instance */ - ResourceReference.prototype.childType = ""; + CustomHttpPattern.prototype.path = ""; /** - * Creates a new ResourceReference instance using the specified properties. + * Creates a new CustomHttpPattern instance using the specified properties. * @function create - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceReference=} [properties] Properties to set - * @returns {google.api.ResourceReference} ResourceReference instance + * @param {google.api.ICustomHttpPattern=} [properties] Properties to set + * @returns {google.api.CustomHttpPattern} CustomHttpPattern instance */ - ResourceReference.create = function create(properties) { - return new ResourceReference(properties); + CustomHttpPattern.create = function create(properties) { + return new CustomHttpPattern(properties); }; /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encode - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encode = function encode(message, writer) { + CustomHttpPattern.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); + 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 ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. * @function encodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.IResourceReference} message ResourceReference message or plain object to encode + * @param {google.api.ICustomHttpPattern} message CustomHttpPattern message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ResourceReference.encodeDelimited = function encodeDelimited(message, writer) { + CustomHttpPattern.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ResourceReference message from the specified reader or buffer. + * Decodes a CustomHttpPattern message from the specified reader or buffer. * @function decode - * @memberof google.api.ResourceReference + * @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.ResourceReference} ResourceReference + * @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 */ - ResourceReference.decode = function decode(reader, length) { + 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.ResourceReference(); + 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.type = reader.string(); + message.kind = reader.string(); break; case 2: - message.childType = reader.string(); + message.path = reader.string(); break; default: reader.skipType(tag & 7); @@ -35081,96 +35081,96 @@ }; /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.ResourceReference} ResourceReference + * @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 */ - ResourceReference.decodeDelimited = function decodeDelimited(reader) { + CustomHttpPattern.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ResourceReference message. + * Verifies a CustomHttpPattern message. * @function verify - * @memberof google.api.ResourceReference + * @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 */ - ResourceReference.verify = function verify(message) { + CustomHttpPattern.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"; + 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 ResourceReference message from a plain object. Also converts values to their respective internal types. + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static * @param {Object.} object Plain object - * @returns {google.api.ResourceReference} ResourceReference + * @returns {google.api.CustomHttpPattern} CustomHttpPattern */ - ResourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.ResourceReference) + CustomHttpPattern.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.CustomHttpPattern) 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); + 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 ResourceReference message. Also converts values to other types if specified. + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. * @function toObject - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @static - * @param {google.api.ResourceReference} message ResourceReference + * @param {google.api.CustomHttpPattern} message CustomHttpPattern * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ResourceReference.toObject = function toObject(message, options) { + CustomHttpPattern.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.type = ""; - object.childType = ""; + object.kind = ""; + object.path = ""; } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.childType != null && message.hasOwnProperty("childType")) - object.childType = message.childType; + 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 ResourceReference to JSON. + * Converts this CustomHttpPattern to JSON. * @function toJSON - * @memberof google.api.ResourceReference + * @memberof google.api.CustomHttpPattern * @instance * @returns {Object.} JSON object */ - ResourceReference.prototype.toJSON = function toJSON() { + CustomHttpPattern.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ResourceReference; + return CustomHttpPattern; })(); return api; diff --git a/packages/google-cloud-gaming/protos/protos.json b/packages/google-cloud-gaming/protos/protos.json index 3cbb9d34c73..1f0bc0af631 100644 --- a/packages/google-cloud-gaming/protos/protos.json +++ b/packages/google-cloud-gaming/protos/protos.json @@ -4072,6 +4072,83 @@ "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, @@ -4159,83 +4236,6 @@ } } }, - "resourceReference": { - "type": "google.api.ResourceReference", - "id": 1055, - "extend": "google.protobuf.FieldOptions" - }, - "resourceDefinition": { - "rule": "repeated", - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.FileOptions" - }, - "resource": { - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.MessageOptions" - }, - "ResourceDescriptor": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "pattern": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "nameField": { - "type": "string", - "id": 3 - }, - "history": { - "type": "History", - "id": 4 - }, - "plural": { - "type": "string", - "id": 5 - }, - "singular": { - "type": "string", - "id": 6 - }, - "style": { - "rule": "repeated", - "type": "Style", - "id": 10 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - }, - "Style": { - "values": { - "STYLE_UNSPECIFIED": 0, - "DECLARATIVE_FRIENDLY": 1 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - }, "methodSignature": { "rule": "repeated", "type": "string", From e88c98bdca64a19301b2392ad77824c1196f5697 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 18:30:15 +0000 Subject: [PATCH 151/180] build(node): update client library version in samples metadata (#1356) (#260) * build(node): add feat in node post-processor to add client library version number in snippet metadata Co-authored-by: Benjamin E. Coe Source-Link: https://github.com/googleapis/synthtool/commit/d337b88dd1494365183718a2de0b7b4056b6fdfe Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:d106724ad2a96daa1b8d88de101ba50bdb30b8df62ffa0aa2b451d93b4556641 --- ...ippet_metadata.google.cloud.gaming.v1.json | 2408 ++++++++--------- ...t_metadata.google.cloud.gaming.v1beta.json | 2384 ++++++++-------- 2 files changed, 2396 insertions(+), 2396 deletions(-) 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 index d3ad67d4b59..df21cddba1c 100644 --- 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 @@ -1,1259 +1,1259 @@ { - "clientLibrary": { - "name": "nodejs-gaming", - "version": "0.1.0", - "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": 83, - "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" - } - } - } + "clientLibrary": { + "name": "nodejs-gaming", + "version": "2.5.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.gaming.v1", + "version": "v1" + } + ] }, - { - "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": [ + "snippets": [ { - "start": 25, - "end": 60, - "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" + "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": 83, + "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" + } + } + } }, - "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": 62, - "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" + "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": 60, + "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" + } + } + } }, - "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": 70, - "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" + "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": 62, + "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" + } + } + } }, - "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": 52, - "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" + "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": 70, + "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" + } + } + } }, - "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": 55, - "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" + "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": 52, + "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" + } + } + } }, - "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": 59, - "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" + "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": 55, + "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" + } + } + } }, - "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": 62, - "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" + "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": 59, + "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" + } + } + } }, - "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": 74, - "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" + "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": 62, + "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" + } + } + } }, - "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": 51, - "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" + "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": 74, + "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" + } + } + } }, - "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": 62, - "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" + "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": 51, + "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" + } + } + } }, - "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": 52, - "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" + "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": 62, + "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" + } + } + } }, - "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": 75, - "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" + "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": 52, + "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" + } + } + } }, - "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": 51, - "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" + "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": 75, + "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" + } + } + } }, - "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": 62, - "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" + "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": 51, + "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" + } + } + } }, - "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": 52, - "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" + "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": 62, + "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" + } + } + } }, - "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": 59, - "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" + "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": 52, + "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" + } + } + } }, - "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": 51, - "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" + "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": 59, + "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" + } + } + } }, - "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": 59, - "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" + "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": 51, + "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" + } + } + } }, - "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": 62, - "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" + "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": 59, + "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" + } + } + } }, - "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": 51, - "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" + "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": 62, + "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" + } + } + } }, - "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": 75, - "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" + "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": 51, + "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" + } + } + } }, - "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": 51, - "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" + "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": 75, + "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" + } + } + } }, - "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": 62, - "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" + "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": 51, + "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" + } + } + } }, - "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": 52, - "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" + "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": 62, + "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" + } + } + } }, - "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": 59, - "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" + "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": 52, + "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" + } + } + } }, - "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": 62, - "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" + "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": 59, + "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" + } + } + } }, - "method": { - "shortName": "PreviewRealmUpdate", - "fullName": "google.cloud.gaming.v1.RealmsService.PreviewRealmUpdate", - "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": 62, + "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/snippet_metadata.google.cloud.gaming.v1beta.json b/packages/google-cloud-gaming/samples/generated/v1beta/snippet_metadata.google.cloud.gaming.v1beta.json index 40642960f2e..fd8ae59f91b 100644 --- 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 @@ -1,1247 +1,1247 @@ { - "clientLibrary": { - "name": "nodejs-gaming", - "version": "0.1.0", - "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": 75, - "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" - } - } - } + "clientLibrary": { + "name": "nodejs-gaming", + "version": "2.5.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.gaming.v1beta", + "version": "v1beta" + } + ] }, - { - "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": [ + "snippets": [ { - "start": 25, - "end": 51, - "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" + "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": 75, + "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" + } + } + } }, - "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": 62, - "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" + "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": 51, + "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" + } + } + } }, - "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": 65, - "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" + "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": 62, + "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" + } + } + } }, - "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": 52, - "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" + "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": 65, + "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" + } + } + } }, - "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": 55, - "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" + "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": 52, + "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" + } + } + } }, - "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": 61, - "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" + "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": 55, + "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" + } + } + } }, - "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": 64, - "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" + "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": 61, + "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" + } + } + } }, - "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": 75, - "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" + "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": 64, + "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" + } + } + } }, - "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": 51, - "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" + "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": 75, + "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" + } + } + } }, - "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": 62, - "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" + "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": 51, + "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" + } + } + } }, - "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": 52, - "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" + "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": 62, + "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" + } + } + } }, - "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": 75, - "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" + "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": 52, + "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" + } + } + } }, - "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": 52, - "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" + "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": 75, + "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" + } + } + } }, - "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": 62, - "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" + "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": 52, + "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" + } + } + } }, - "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": 52, - "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" + "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": 62, + "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" + } + } + } }, - "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": 61, - "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" + "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": 52, + "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" + } + } + } }, - "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": 52, - "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" + "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": 61, + "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" + } + } + } }, - "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": 61, - "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" + "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": 52, + "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" + } + } + } }, - "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": 64, - "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" + "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": 61, + "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" + } + } + } }, - "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": 51, - "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" + "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": 64, + "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" + } + } + } }, - "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": 75, - "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" + "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": 51, + "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" + } + } + } }, - "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": 51, - "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" + "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": 75, + "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" + } + } + } }, - "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": 62, - "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" + "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": 51, + "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" + } + } + } }, - "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": 52, - "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" + "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": 62, + "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" + } + } + } }, - "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": 61, - "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" + "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": 52, + "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" + } + } + } }, - "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": 64, - "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" + "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": 61, + "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" + } + } + } }, - "method": { - "shortName": "PreviewRealmUpdate", - "fullName": "google.cloud.gaming.v1beta.RealmsService.PreviewRealmUpdate", - "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": 64, + "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 From a31b9e29769258ed6bc3831a27f83bde69d0572f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 3 May 2022 02:26:33 +0200 Subject: [PATCH 152/180] chore(deps): update dependency @types/mocha to v9 (#261) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/mocha](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^8.0.0` -> `^9.0.0`](https://renovatebot.com/diffs/npm/@types%2fmocha/8.2.3/9.1.1) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/compatibility-slim/8.2.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.1.1/confidence-slim/8.2.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 0e02815cebc..b85a4d73128 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -30,7 +30,7 @@ "google-gax": "^2.24.1" }, "devDependencies": { - "@types/mocha": "^8.0.0", + "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.0.0", From 1b73165a32d0cbc7da9349019d6ba52396e031c8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 9 May 2022 17:34:29 +0200 Subject: [PATCH 153/180] chore(deps): update dependency sinon to v14 (#264) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^13.0.0` -> `^14.0.0`](https://renovatebot.com/diffs/npm/sinon/13.0.2/14.0.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/compatibility-slim/13.0.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/confidence-slim/13.0.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v14.0.0`](https://togithub.com/sinonjs/sinon/blob/HEAD/CHANGES.md#​1400) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v13.0.2...v14.0.0) - [`c2bbd826`](https://togithub.com/sinonjs/sinon/commit/c2bbd82641444eb5b32822489ae40f185afbbf00) Drop node 12 (Morgan Roderick) > And embrace Node 18 > > See https://nodejs.org/en/about/releases/ *Released by Morgan Roderick on 2022-05-07.*
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index b85a4d73128..1b41879c7e9 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -42,7 +42,7 @@ "mocha": "^8.0.0", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", - "sinon": "^13.0.0", + "sinon": "^14.0.0", "ts-loader": "^9.0.0", "typescript": "^3.8.3", "webpack": "^5.0.0", From c1af2fc8084edf2508db71987d022abddce93895 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Mon, 16 May 2022 17:35:19 -0700 Subject: [PATCH 154/180] build!: update library to use Node 12 (#266) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat!: Update library to use Node 12 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- packages/google-cloud-gaming/package.json | 10 +++++----- packages/google-cloud-gaming/samples/package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 1b41879c7e9..4bde148758b 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -27,28 +27,28 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^2.24.1" + "google-gax": "^3.0.1" }, "devDependencies": { "@types/mocha": "^9.0.0", "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.0.0", - "gts": "^3.0.0", + "gts": "^3.1.0", "jsdoc": "^3.5.5", "jsdoc-fresh": "^1.0.1", "jsdoc-region-tag": "^1.0.2", "linkinator": "^2.0.3", - "mocha": "^8.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": "^3.8.3", + "typescript": "^4.6.4", "webpack": "^5.0.0", "webpack-cli": "^4.0.0" }, "engines": { - "node": ">=10" + "node": ">=12.0.0" } } diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index 589bce6b6a4..fb42c43aee0 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=10" + "node": ">=12.0.0" }, "files": [ "*.js" From 7977bdfad636f5c81ecff8c44aea877bdf9938ed Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 17 May 2022 17:04:19 -0700 Subject: [PATCH 155/180] chore(main): release 3.0.0 (#267) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 3.0.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-gaming/CHANGELOG.md | 11 +++++++++++ packages/google-cloud-gaming/package.json | 2 +- .../v1/snippet_metadata.google.cloud.gaming.v1.json | 2 +- .../snippet_metadata.google.cloud.gaming.v1beta.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index e2c0559c93e..5fbc8788da8 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 4bde148758b..97747e8915a 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "2.5.0", + "version": "3.0.0", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", 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 index df21cddba1c..74bd7a7325e 100644 --- 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 @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gaming", - "version": "2.5.0", + "version": "3.0.0", "language": "TYPESCRIPT", "apis": [ { 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 index fd8ae59f91b..6eb15e80484 100644 --- 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 @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gaming", - "version": "2.5.0", + "version": "3.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index fb42c43aee0..6efa1c0e168 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^2.5.0" + "@google-cloud/game-servers": "^3.0.0" }, "devDependencies": { "c8": "^7.2.1", From 98c067d1224165cdab4f09bf3d1b05e49c44d6f8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jun 2022 16:58:12 +0200 Subject: [PATCH 156/180] chore(deps): update dependency jsdoc-fresh to v2 (#269) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jsdoc-fresh](https://togithub.com/googleapis/jsdoc-fresh) | [`^1.0.1` -> `^2.0.0`](https://renovatebot.com/diffs/npm/jsdoc-fresh/1.1.1/2.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/compatibility-slim/1.1.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/confidence-slim/1.1.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/jsdoc-fresh ### [`v2.0.0`](https://togithub.com/googleapis/jsdoc-fresh/blob/HEAD/CHANGELOG.md#​200-httpsgithubcomgoogleapisjsdoc-freshcomparev111v200-2022-05-18) [Compare Source](https://togithub.com/googleapis/jsdoc-fresh/compare/v1.1.1...v2.0.0) ##### ⚠ BREAKING CHANGES - update library to use Node 12 ([#​108](https://togithub.com/googleapis/jsdoc-fresh/issues/108)) ##### Build System - update library to use Node 12 ([#​108](https://togithub.com/googleapis/jsdoc-fresh/issues/108)) ([e61c223](https://togithub.com/googleapis/jsdoc-fresh/commit/e61c2238db8900e339e5fe7fb8aea09642290182)) ##### [1.1.1](https://www.github.com/googleapis/jsdoc-fresh/compare/v1.1.0...v1.1.1) (2021-08-11) ##### Bug Fixes - **build:** migrate to using main branch ([#​83](https://www.togithub.com/googleapis/jsdoc-fresh/issues/83)) ([9474adb](https://www.github.com/googleapis/jsdoc-fresh/commit/9474adbf0d559d319ff207397ba2be6b557999ac))
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 97747e8915a..4e4d994a9e4 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -36,7 +36,7 @@ "c8": "^7.0.0", "gts": "^3.1.0", "jsdoc": "^3.5.5", - "jsdoc-fresh": "^1.0.1", + "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^1.0.2", "linkinator": "^2.0.3", "mocha": "^9.2.2", From 2be8063d2e315f35c4cb8afdc95c789d94b986c3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jun 2022 17:22:56 +0200 Subject: [PATCH 157/180] chore(deps): update dependency jsdoc-region-tag to v2 (#270) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jsdoc-region-tag](https://togithub.com/googleapis/jsdoc-region-tag) | [`^1.0.2` -> `^2.0.0`](https://renovatebot.com/diffs/npm/jsdoc-region-tag/1.3.1/2.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/compatibility-slim/1.3.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/confidence-slim/1.3.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/jsdoc-region-tag ### [`v2.0.0`](https://togithub.com/googleapis/jsdoc-region-tag/blob/HEAD/CHANGELOG.md#​200-httpsgithubcomgoogleapisjsdoc-region-tagcomparev131v200-2022-05-20) [Compare Source](https://togithub.com/googleapis/jsdoc-region-tag/compare/v1.3.1...v2.0.0) ##### ⚠ BREAKING CHANGES - update library to use Node 12 ([#​107](https://togithub.com/googleapis/jsdoc-region-tag/issues/107)) ##### Build System - update library to use Node 12 ([#​107](https://togithub.com/googleapis/jsdoc-region-tag/issues/107)) ([5b51796](https://togithub.com/googleapis/jsdoc-region-tag/commit/5b51796771984cf8b978990025f14faa03c19923)) ##### [1.3.1](https://www.github.com/googleapis/jsdoc-region-tag/compare/v1.3.0...v1.3.1) (2021-08-11) ##### Bug Fixes - **build:** migrate to using main branch ([#​79](https://www.togithub.com/googleapis/jsdoc-region-tag/issues/79)) ([5050615](https://www.github.com/googleapis/jsdoc-region-tag/commit/50506150b7758592df5e389c6a5c3d82b3b20881))
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 4e4d994a9e4..76e4935b25d 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -37,7 +37,7 @@ "gts": "^3.1.0", "jsdoc": "^3.5.5", "jsdoc-fresh": "^2.0.0", - "jsdoc-region-tag": "^1.0.2", + "jsdoc-region-tag": "^2.0.0", "linkinator": "^2.0.3", "mocha": "^9.2.2", "null-loader": "^4.0.0", From fc932ce93d0c8021bedf528222d15de7cfc8e36e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 5 Jul 2022 11:12:20 -0400 Subject: [PATCH 158/180] feat: support regapic LRO PiperOrigin-RevId: 456946341 Source-Link: https://github.com/googleapis/googleapis/commit/88fd18d9d3b872b3d06a3d9392879f50b5bf3ce5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/accfa371f667439313335c64042b063c1c53102e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWNjZmEzNzFmNjY3NDM5MzEzMzM1YzY0MDQyYjA2M2MxYzUzMTAyZSJ9 See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md fix(gaming): publish v1beta LRO HTTP rules PiperOrigin-RevId: 458259504 Source-Link: https://github.com/googleapis/googleapis/commit/181b8566f3a77e041a2c5b4e28ab0e16e16ac139 Source-Link: https://github.com/googleapis/googleapis-gen/commit/7cd7f14f98fb8d17e64da1ef26acb546b6c57fac Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiN2NkN2YxNGY5OGZiOGQxN2U2NGRhMWVmMjZhY2I1NDZiNmM1N2ZhYyJ9 See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md PiperOrigin-RevId: 458552034 Source-Link: https://github.com/googleapis/googleapis/commit/ae65014049c6eb195741d7efbd0b10bee3f83d4f Source-Link: https://github.com/googleapis/googleapis-gen/commit/b09ede435cce110446d4ab9f62a081b571d37e3f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjA5ZWRlNDM1Y2NlMTEwNDQ2ZDRhYjlmNjJhMDgxYjU3MWQzN2UzZiJ9 See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../v1/game_server_clusters_service_client.ts | 67 +++++++++++++++---- .../v1/game_server_configs_service_client.ts | 67 +++++++++++++++---- .../game_server_deployments_service_client.ts | 67 +++++++++++++++---- .../src/v1/realms_service_client.ts | 67 +++++++++++++++---- .../game_server_clusters_service_client.ts | 45 +++++++++---- .../game_server_configs_service_client.ts | 45 +++++++++---- .../game_server_deployments_service_client.ts | 45 +++++++++---- .../src/v1beta/realms_service_client.ts | 45 +++++++++---- 8 files changed, 352 insertions(+), 96 deletions(-) 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 index b0b07cd456a..65354b23dae 100644 --- 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 @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -73,7 +74,7 @@ export class 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/master/client-libraries.md#creating-the-client-instance). + * 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] @@ -96,11 +97,10 @@ export class GameServerClustersServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @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}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. @@ -197,16 +197,59 @@ export class GameServerClustersServiceClient { }; 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({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const createGameServerClusterResponse = protoFilesRoot.lookup( '.google.cloud.gaming.v1.GameServerCluster' 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 index c5b02cc372a..de02273b3c6 100644 --- 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 @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -72,7 +73,7 @@ export class 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/master/client-libraries.md#creating-the-client-instance). + * 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] @@ -95,11 +96,10 @@ export class GameServerConfigsServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @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}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. @@ -196,16 +196,59 @@ export class GameServerConfigsServiceClient { }; 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({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const createGameServerConfigResponse = protoFilesRoot.lookup( '.google.cloud.gaming.v1.GameServerConfig' 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 index 623c3b8e85c..051d668286e 100644 --- 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 @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -73,7 +74,7 @@ export class 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/master/client-libraries.md#creating-the-client-instance). + * 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] @@ -96,11 +97,10 @@ export class GameServerDeploymentsServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @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}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. @@ -197,16 +197,59 @@ export class GameServerDeploymentsServiceClient { }; 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({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const createGameServerDeploymentResponse = protoFilesRoot.lookup( '.google.cloud.gaming.v1.GameServerDeployment' diff --git a/packages/google-cloud-gaming/src/v1/realms_service_client.ts b/packages/google-cloud-gaming/src/v1/realms_service_client.ts index b9a7369602d..4271c321174 100644 --- a/packages/google-cloud-gaming/src/v1/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1/realms_service_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -73,7 +74,7 @@ export class 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/master/client-libraries.md#creating-the-client-instance). + * 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] @@ -96,11 +97,10 @@ export class RealmsServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @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}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. @@ -196,16 +196,59 @@ export class RealmsServiceClient { }; 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({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const createRealmResponse = protoFilesRoot.lookup( '.google.cloud.gaming.v1.Realm' 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 index 01f549aa283..5bcb0b8063c 100644 --- 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 @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -73,7 +74,7 @@ export class 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/master/client-libraries.md#creating-the-client-instance). + * 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] @@ -96,11 +97,10 @@ export class GameServerClustersServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @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}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. @@ -197,16 +197,37 @@ export class GameServerClustersServiceClient { }; 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({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const createGameServerClusterResponse = protoFilesRoot.lookup( '.google.cloud.gaming.v1beta.GameServerCluster' 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 index 2be8685d3f5..dc5c3fc6542 100644 --- 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 @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -72,7 +73,7 @@ export class 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/master/client-libraries.md#creating-the-client-instance). + * 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] @@ -95,11 +96,10 @@ export class GameServerConfigsServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @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}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. @@ -196,16 +196,37 @@ export class GameServerConfigsServiceClient { }; 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({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const createGameServerConfigResponse = protoFilesRoot.lookup( '.google.cloud.gaming.v1beta.GameServerConfig' 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 index cad82938282..d29135eae89 100644 --- 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 @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -73,7 +74,7 @@ export class 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/master/client-libraries.md#creating-the-client-instance). + * 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] @@ -96,11 +97,10 @@ export class GameServerDeploymentsServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @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}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. @@ -197,16 +197,37 @@ export class GameServerDeploymentsServiceClient { }; 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({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const createGameServerDeploymentResponse = protoFilesRoot.lookup( '.google.cloud.gaming.v1beta.GameServerDeployment' diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index b07fbbc933c..a07eaab2b0f 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -73,7 +74,7 @@ export class 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/master/client-libraries.md#creating-the-client-instance). + * 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] @@ -96,11 +97,10 @@ export class RealmsServiceClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @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}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. @@ -196,16 +196,37 @@ export class RealmsServiceClient { }; 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({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const createRealmResponse = protoFilesRoot.lookup( '.google.cloud.gaming.v1beta.Realm' From 099b4f9e1df51235c3ae612560aff4b9a10f6ae3 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 5 Jul 2022 11:21:16 -0400 Subject: [PATCH 159/180] chore(main): release 3.1.0 (#272) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 3.1.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-gaming/CHANGELOG.md | 7 +++++++ packages/google-cloud-gaming/package.json | 2 +- .../v1/snippet_metadata.google.cloud.gaming.v1.json | 2 +- .../snippet_metadata.google.cloud.gaming.v1beta.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index 5fbc8788da8..4f160269634 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 76e4935b25d..13754bc0a13 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "3.0.0", + "version": "3.1.0", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", 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 index 74bd7a7325e..335980fe8b7 100644 --- 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 @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gaming", - "version": "3.0.0", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { 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 index 6eb15e80484..0476d2c8b26 100644 --- 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 @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gaming", - "version": "3.0.0", + "version": "3.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index 6efa1c0e168..1a9843e3a47 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^3.0.0" + "@google-cloud/game-servers": "^3.1.0" }, "devDependencies": { "c8": "^7.2.1", From a9dc9f158d3aff490e66f477452bd73661a38793 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 8 Jul 2022 23:04:12 +0200 Subject: [PATCH 160/180] chore(deps): update dependency linkinator to v4 (#274) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [linkinator](https://togithub.com/JustinBeckwith/linkinator) | [`^2.0.3` -> `^4.0.0`](https://renovatebot.com/diffs/npm/linkinator/2.16.2/4.0.0) | [![age](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/compatibility-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/confidence-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
JustinBeckwith/linkinator ### [`v4.0.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v4.0.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.1.0...v4.0.0) ##### Features - create new release with notes ([#​508](https://togithub.com/JustinBeckwith/linkinator/issues/508)) ([2cab633](https://togithub.com/JustinBeckwith/linkinator/commit/2cab633c9659eb10794a4bac06f8b0acdc3e2c0c)) ##### BREAKING CHANGES - The commits in [#​507](https://togithub.com/JustinBeckwith/linkinator/issues/507) and [#​506](https://togithub.com/JustinBeckwith/linkinator/issues/506) both had breaking changes. They included dropping support for Node.js 12.x and updating the CSV export to be streaming, and to use a new way of writing the CSV file. This is an empty to commit using the `BREAKING CHANGE` format in the commit message to ensure a release is triggered. ### [`v3.1.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.1.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.6...v3.1.0) ##### Features - allow --skip to be defined multiple times ([#​399](https://togithub.com/JustinBeckwith/linkinator/issues/399)) ([5ca5a46](https://togithub.com/JustinBeckwith/linkinator/commit/5ca5a461508e688de12e5ae6b4cfb6565f832ebf)) ### [`v3.0.6`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.6) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.5...v3.0.6) ##### Bug Fixes - **deps:** upgrade node-glob to v8 ([#​397](https://togithub.com/JustinBeckwith/linkinator/issues/397)) ([d334dc6](https://togithub.com/JustinBeckwith/linkinator/commit/d334dc6734cd7c2b73d7ed3dea0550a6c3072ad5)) ### [`v3.0.5`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.5) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.4...v3.0.5) ##### Bug Fixes - **deps:** upgrade to htmlparser2 v8.0.1 ([#​396](https://togithub.com/JustinBeckwith/linkinator/issues/396)) ([ba3b9a8](https://togithub.com/JustinBeckwith/linkinator/commit/ba3b9a8a9b19d39af6ed91790135e833b80c1eb6)) ### [`v3.0.4`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.4) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.3...v3.0.4) ##### Bug Fixes - **deps:** update dependency gaxios to v5 ([#​391](https://togithub.com/JustinBeckwith/linkinator/issues/391)) ([48af50e](https://togithub.com/JustinBeckwith/linkinator/commit/48af50e787731204aeb7eff41325c62291311e45)) ### [`v3.0.3`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.3) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.2...v3.0.3) ##### Bug Fixes - export getConfig from index ([#​371](https://togithub.com/JustinBeckwith/linkinator/issues/371)) ([0bc0355](https://togithub.com/JustinBeckwith/linkinator/commit/0bc0355c7e2ea457f247e6b52d1577b8c4ecb3a1)) ### [`v3.0.2`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.2) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.1...v3.0.2) ##### Bug Fixes - allow server root with trailing slash ([#​370](https://togithub.com/JustinBeckwith/linkinator/issues/370)) ([8adf6b0](https://togithub.com/JustinBeckwith/linkinator/commit/8adf6b025fda250e38461f1cdad40fe08c3b3b7c)) ### [`v3.0.1`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.1) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.0...v3.0.1) ##### Bug Fixes - decode path parts in local web server ([#​369](https://togithub.com/JustinBeckwith/linkinator/issues/369)) ([4696a0c](https://togithub.com/JustinBeckwith/linkinator/commit/4696a0c38c341b178ed815f47371fca955979feb)) ### [`v3.0.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v2.16.2...v3.0.0) ##### Bug Fixes - **deps:** update dependency chalk to v5 ([#​362](https://togithub.com/JustinBeckwith/linkinator/issues/362)) ([4b17a8d](https://togithub.com/JustinBeckwith/linkinator/commit/4b17a8d87b649eaf813428f8ee6955e1d21dae4f)) - feat!: convert to es modules, drop node 10 ([#​359](https://togithub.com/JustinBeckwith/linkinator/issues/359)) ([efee299](https://togithub.com/JustinBeckwith/linkinator/commit/efee299ab8a805accef751eecf8538915a4e7783)), closes [#​359](https://togithub.com/JustinBeckwith/linkinator/issues/359) ##### BREAKING CHANGES - this module now requires node.js 12 and above, and has moved to es modules by default.
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 13754bc0a13..993a24c6f8d 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -38,7 +38,7 @@ "jsdoc": "^3.5.5", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^2.0.3", + "linkinator": "^4.0.0", "mocha": "^9.2.2", "null-loader": "^4.0.0", "pack-n-play": "^1.0.0-2", From f8e5e60dce3d84fd6c56f5bd838804f19a9238a3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 19 Aug 2022 20:24:19 +0000 Subject: [PATCH 161/180] chore: remove unused proto imports (#304) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 468735472 Source-Link: https://github.com/googleapis/googleapis/commit/cfa1b3782da7ccae31673d45401a0b79d2d4a84b Source-Link: https://github.com/googleapis/googleapis-gen/commit/09b7666656510f5b00b893f003a0ba5766f9e250 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDliNzY2NjY1NjUxMGY1YjAwYjg5M2YwMDNhMGJhNTc2NmY5ZTI1MCJ9 --- .../protos/google/cloud/gaming/v1beta/common.proto | 1 - .../protos/google/cloud/gaming/v1beta/game_server_clusters.proto | 1 - .../protos/google/cloud/gaming/v1beta/game_server_configs.proto | 1 - .../google/cloud/gaming/v1beta/game_server_deployments.proto | 1 - .../protos/google/cloud/gaming/v1beta/realms.proto | 1 - 5 files changed, 5 deletions(-) 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 index cb91571300e..4059404fcc2 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/common.proto @@ -19,7 +19,6 @@ package google.cloud.gaming.v1beta; import "google/api/field_behavior.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming"; 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 index 6816f2cc206..0a91a635d80 100644 --- 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 @@ -21,7 +21,6 @@ import "google/api/resource.proto"; import "google/cloud/gaming/v1beta/common.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming"; 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 index a94b40b33cf..1ffc0c816ef 100644 --- 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 @@ -20,7 +20,6 @@ import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/cloud/gaming/v1beta/common.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming"; 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 index 1dde396bfbf..01e8fef934a 100644 --- 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 @@ -21,7 +21,6 @@ import "google/api/resource.proto"; import "google/cloud/gaming/v1beta/common.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming"; 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 index f39fc938a29..e80bae0a9f4 100644 --- a/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto +++ b/packages/google-cloud-gaming/protos/google/cloud/gaming/v1beta/realms.proto @@ -21,7 +21,6 @@ import "google/api/resource.proto"; import "google/cloud/gaming/v1beta/common.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option go_package = "google.golang.org/genproto/googleapis/cloud/gaming/v1beta;gaming"; From 396b9b489ab31862807213deeb49dfc0c940082a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 00:08:15 +0000 Subject: [PATCH 162/180] fix: better support for fallback mode (#305) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 468790263 Source-Link: https://github.com/googleapis/googleapis/commit/873ab456273d105245df0fb82a6c17a814553b80 Source-Link: https://github.com/googleapis/googleapis-gen/commit/cb6f37aeff2a3472e40a7bbace8c67d75e24bee5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2I2ZjM3YWVmZjJhMzQ3MmU0MGE3YmJhY2U4YzY3ZDc1ZTI0YmVlNSJ9 --- ...ters_service.create_game_server_cluster.js | 3 + ...ters_service.delete_game_server_cluster.js | 3 + ...lusters_service.get_game_server_cluster.js | 3 + ...sters_service.list_game_server_clusters.js | 3 + ...vice.preview_create_game_server_cluster.js | 3 + ...vice.preview_delete_game_server_cluster.js | 3 + ...vice.preview_update_game_server_cluster.js | 3 + ...ters_service.update_game_server_cluster.js | 3 + ...nfigs_service.create_game_server_config.js | 3 + ...nfigs_service.delete_game_server_config.js | 3 + ..._configs_service.get_game_server_config.js | 3 + ...onfigs_service.list_game_server_configs.js | 3 + ...s_service.create_game_server_deployment.js | 3 + ...s_service.delete_game_server_deployment.js | 3 + ...loyments_service.fetch_deployment_state.js | 3 + ...ents_service.get_game_server_deployment.js | 3 + ...vice.get_game_server_deployment_rollout.js | 3 + ...ts_service.list_game_server_deployments.js | 3 + ....preview_game_server_deployment_rollout.js | 3 + ...s_service.update_game_server_deployment.js | 3 + ...e.update_game_server_deployment_rollout.js | 3 + .../v1/realms_service.create_realm.js | 3 + .../v1/realms_service.delete_realm.js | 3 + .../generated/v1/realms_service.get_realm.js | 3 + .../v1/realms_service.list_realms.js | 3 + .../v1/realms_service.preview_realm_update.js | 3 + .../v1/realms_service.update_realm.js | 3 + ...ippet_metadata.google.cloud.gaming.v1.json | 54 ++--- ...ters_service.create_game_server_cluster.js | 3 + ...ters_service.delete_game_server_cluster.js | 3 + ...lusters_service.get_game_server_cluster.js | 3 + ...sters_service.list_game_server_clusters.js | 3 + ...vice.preview_create_game_server_cluster.js | 3 + ...vice.preview_delete_game_server_cluster.js | 3 + ...vice.preview_update_game_server_cluster.js | 3 + ...ters_service.update_game_server_cluster.js | 3 + ...nfigs_service.create_game_server_config.js | 3 + ...nfigs_service.delete_game_server_config.js | 3 + ..._configs_service.get_game_server_config.js | 3 + ...onfigs_service.list_game_server_configs.js | 3 + ...s_service.create_game_server_deployment.js | 3 + ...s_service.delete_game_server_deployment.js | 3 + ...loyments_service.fetch_deployment_state.js | 3 + ...ents_service.get_game_server_deployment.js | 3 + ...vice.get_game_server_deployment_rollout.js | 3 + ...ts_service.list_game_server_deployments.js | 3 + ....preview_game_server_deployment_rollout.js | 3 + ...s_service.update_game_server_deployment.js | 3 + ...e.update_game_server_deployment_rollout.js | 3 + .../v1beta/realms_service.create_realm.js | 3 + .../v1beta/realms_service.delete_realm.js | 3 + .../v1beta/realms_service.get_realm.js | 3 + .../v1beta/realms_service.list_realms.js | 3 + .../realms_service.preview_realm_update.js | 3 + .../v1beta/realms_service.update_realm.js | 3 + ...t_metadata.google.cloud.gaming.v1beta.json | 54 ++--- .../v1/game_server_clusters_service_client.ts | 14 +- .../v1/game_server_configs_service_client.ts | 12 +- .../game_server_deployments_service_client.ts | 16 +- .../src/v1/realms_service_client.ts | 14 +- .../game_server_clusters_service_client.ts | 14 +- .../game_server_configs_service_client.ts | 12 +- .../game_server_deployments_service_client.ts | 16 +- .../src/v1beta/realms_service_client.ts | 14 +- .../gapic_game_server_clusters_service_v1.ts | 182 +++++++-------- ...pic_game_server_clusters_service_v1beta.ts | 212 +++++++++--------- .../gapic_game_server_configs_service_v1.ts | 182 +++++++-------- ...apic_game_server_configs_service_v1beta.ts | 195 ++++++++-------- ...apic_game_server_deployments_service_v1.ts | 212 +++++++++--------- ..._game_server_deployments_service_v1beta.ts | 212 +++++++++--------- .../test/gapic_realms_service_v1.ts | 158 ++++++------- .../test/gapic_realms_service_v1beta.ts | 160 ++++++------- 72 files changed, 1044 insertions(+), 851 deletions(-) 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 index 13050309aae..b9a8eecf7d7 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index df81eef6b4f..1966da6a808 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 0a724779815..6a741c5ce8a 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 18dd322052d..f6411da17ba 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index b758128f841..0713a62e3d7 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 3c9385b20bc..786f351980d 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 3b654d16a0c..6348196369d 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 157dba34d13..4da22444a26 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 68c32348668..78e713d7911 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 3b6ac2b286b..889474896f0 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index bc8668be39e..3d31a53248b 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 926292b6400..b583c33dd2f 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 579d2aed4e8..e3f2af1d78d 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index c1764e7d178..1112f3ff169 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 88a9378d120..d2f510c0d27 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 46e1f6dcf97..612f36c9dab 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 0ace7cd4780..dd2864a56bb 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index cd7aa5b94c4..5b163c39d24 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 0632186c9d3..5293fca061f 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 37f0ebf9425..cabc47340ff 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 21de72e147f..f6f3711069e 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index e0ff05579d3..fbc6a819f4f 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 8bd12c0e81c..eced01aade0 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 0cafdb3515b..d3f94b17120 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 49a416dff2f..68bef442eeb 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index de43ea2dc0b..644e93d491e 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index c878c0efe96..4179dbef7ab 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 335980fe8b7..7ea1b6a86ed 100644 --- 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 @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 83, + "end": 86, "type": "FULL" } ], @@ -82,7 +82,7 @@ "segments": [ { "start": 25, - "end": 60, + "end": 63, "type": "FULL" } ], @@ -126,7 +126,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -174,7 +174,7 @@ "segments": [ { "start": 25, - "end": 70, + "end": 73, "type": "FULL" } ], @@ -230,7 +230,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -270,7 +270,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -314,7 +314,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 62, "type": "FULL" } ], @@ -358,7 +358,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -406,7 +406,7 @@ "segments": [ { "start": 25, - "end": 74, + "end": 77, "type": "FULL" } ], @@ -462,7 +462,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -502,7 +502,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -550,7 +550,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -590,7 +590,7 @@ "segments": [ { "start": 25, - "end": 75, + "end": 78, "type": "FULL" } ], @@ -646,7 +646,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -686,7 +686,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -734,7 +734,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -774,7 +774,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 62, "type": "FULL" } ], @@ -818,7 +818,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -858,7 +858,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 62, "type": "FULL" } ], @@ -902,7 +902,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -950,7 +950,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -990,7 +990,7 @@ "segments": [ { "start": 25, - "end": 75, + "end": 78, "type": "FULL" } ], @@ -1046,7 +1046,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -1086,7 +1086,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -1134,7 +1134,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -1174,7 +1174,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 62, "type": "FULL" } ], @@ -1218,7 +1218,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], 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 index ef5d601d369..fe5320c14c6 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 2a62e7880a7..84cabe9b3a2 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index e7f1b11d259..4c507a67da9 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 696634bff36..31a2a5947b6 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 044068729b3..9bf2f6dc0ce 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 1fade1029db..eaf085e0639 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index bde1416614a..95cabe4e80e 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 3b6cc045b4a..fcd3349436e 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index fb49085c1d9..878996af867 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 2b6c0dc87f1..e3f307627d4 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index a633554f0f2..9fd03435d64 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 0172aad78b4..459bf2af4a5 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 1bb5584958d..491fa247370 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 8ea0e556757..64d0d47e951 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 4b59aeb94e2..fe8618d547d 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index b856e6699ac..99533e086cb 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index b3dcc1d196e..60c630a448b 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index f592e7f1b0b..f216b0082d0 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index cd4fe13f700..d1050e5f01f 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 69fe50d038a..3c29a23adae 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 402f60f424b..f4033b8ee3d 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 240e45545b6..62c0fcd4b7a 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 6b4b5e9d481..f082d26994c 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index ba1726f2e78..3a0f0606622 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index cd1b5f2c49e..10b0feb181e 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 38f7cebd15c..67c55bd2f72 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index d9066825449..ba91f2afba8 100644 --- 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 @@ -23,6 +23,9 @@ 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. */ /** 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 index 0476d2c8b26..1fba6b48d5a 100644 --- 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 @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 75, + "end": 78, "type": "FULL" } ], @@ -78,7 +78,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -118,7 +118,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -166,7 +166,7 @@ "segments": [ { "start": 25, - "end": 65, + "end": 68, "type": "FULL" } ], @@ -218,7 +218,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -258,7 +258,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -302,7 +302,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], @@ -346,7 +346,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -394,7 +394,7 @@ "segments": [ { "start": 25, - "end": 75, + "end": 78, "type": "FULL" } ], @@ -450,7 +450,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -490,7 +490,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -538,7 +538,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -578,7 +578,7 @@ "segments": [ { "start": 25, - "end": 75, + "end": 78, "type": "FULL" } ], @@ -634,7 +634,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -674,7 +674,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -722,7 +722,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -762,7 +762,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], @@ -806,7 +806,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -846,7 +846,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], @@ -890,7 +890,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -938,7 +938,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -978,7 +978,7 @@ "segments": [ { "start": 25, - "end": 75, + "end": 78, "type": "FULL" } ], @@ -1034,7 +1034,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -1074,7 +1074,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -1122,7 +1122,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -1162,7 +1162,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], @@ -1206,7 +1206,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], 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 index 65354b23dae..598cbd8b149 100644 --- 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 @@ -30,7 +30,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -382,7 +381,8 @@ export class GameServerClustersServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -1007,7 +1007,7 @@ export class GameServerClustersServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createGameServerCluster, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.gaming.v1.GameServerCluster, @@ -1149,7 +1149,7 @@ export class GameServerClustersServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteGameServerCluster, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -1295,7 +1295,7 @@ export class GameServerClustersServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.updateGameServerCluster, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.gaming.v1.GameServerCluster, @@ -1477,7 +1477,7 @@ export class GameServerClustersServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGameServerClusters.createStream( - this.innerApiCalls.listGameServerClusters as gax.GaxCall, + this.innerApiCalls.listGameServerClusters as GaxCall, request, callSettings ); @@ -1542,7 +1542,7 @@ export class GameServerClustersServiceClient { this.initialize(); return this.descriptors.page.listGameServerClusters.asyncIterate( this.innerApiCalls['listGameServerClusters'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } 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 index de02273b3c6..eac3be4778a 100644 --- 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 @@ -30,7 +30,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -361,7 +360,8 @@ export class GameServerConfigsServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -657,7 +657,7 @@ export class GameServerConfigsServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createGameServerConfig, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.gaming.v1.GameServerConfig, @@ -800,7 +800,7 @@ export class GameServerConfigsServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteGameServerConfig, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -965,7 +965,7 @@ export class GameServerConfigsServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGameServerConfigs.createStream( - this.innerApiCalls.listGameServerConfigs as gax.GaxCall, + this.innerApiCalls.listGameServerConfigs as GaxCall, request, callSettings ); @@ -1023,7 +1023,7 @@ export class GameServerConfigsServiceClient { this.initialize(); return this.descriptors.page.listGameServerConfigs.asyncIterate( this.innerApiCalls['listGameServerConfigs'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } 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 index 051d668286e..bcdf3183f4a 100644 --- 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 @@ -30,7 +30,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -399,7 +398,8 @@ export class GameServerDeploymentsServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -1003,7 +1003,7 @@ export class GameServerDeploymentsServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createGameServerDeployment, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.gaming.v1.GameServerDeployment, @@ -1145,7 +1145,7 @@ export class GameServerDeploymentsServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteGameServerDeployment, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -1291,7 +1291,7 @@ export class GameServerDeploymentsServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.updateGameServerDeployment, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.gaming.v1.GameServerDeployment, @@ -1442,7 +1442,7 @@ export class GameServerDeploymentsServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.updateGameServerDeploymentRollout, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.gaming.v1.GameServerDeployment, @@ -1612,7 +1612,7 @@ export class GameServerDeploymentsServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGameServerDeployments.createStream( - this.innerApiCalls.listGameServerDeployments as gax.GaxCall, + this.innerApiCalls.listGameServerDeployments as GaxCall, request, callSettings ); @@ -1671,7 +1671,7 @@ export class GameServerDeploymentsServiceClient { this.initialize(); return this.descriptors.page.listGameServerDeployments.asyncIterate( this.innerApiCalls['listGameServerDeployments'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-gaming/src/v1/realms_service_client.ts b/packages/google-cloud-gaming/src/v1/realms_service_client.ts index 4271c321174..a263aab3ab2 100644 --- a/packages/google-cloud-gaming/src/v1/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1/realms_service_client.ts @@ -30,7 +30,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -366,7 +365,8 @@ export class RealmsServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -746,7 +746,7 @@ export class RealmsServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createRealm, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.gaming.v1.Realm, @@ -884,7 +884,7 @@ export class RealmsServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteRealm, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -1026,7 +1026,7 @@ export class RealmsServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.updateRealm, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.gaming.v1.Realm, @@ -1184,7 +1184,7 @@ export class RealmsServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listRealms.createStream( - this.innerApiCalls.listRealms as gax.GaxCall, + this.innerApiCalls.listRealms as GaxCall, request, callSettings ); @@ -1243,7 +1243,7 @@ export class RealmsServiceClient { this.initialize(); return this.descriptors.page.listRealms.asyncIterate( this.innerApiCalls['listRealms'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } 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 index 5bcb0b8063c..51f51a727b3 100644 --- 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 @@ -30,7 +30,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -360,7 +359,8 @@ export class GameServerClustersServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -985,7 +985,7 @@ export class GameServerClustersServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createGameServerCluster, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.gaming.v1beta.GameServerCluster, @@ -1127,7 +1127,7 @@ export class GameServerClustersServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteGameServerCluster, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -1276,7 +1276,7 @@ export class GameServerClustersServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.updateGameServerCluster, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.gaming.v1beta.GameServerCluster, @@ -1446,7 +1446,7 @@ export class GameServerClustersServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGameServerClusters.createStream( - this.innerApiCalls.listGameServerClusters as gax.GaxCall, + this.innerApiCalls.listGameServerClusters as GaxCall, request, callSettings ); @@ -1505,7 +1505,7 @@ export class GameServerClustersServiceClient { this.initialize(); return this.descriptors.page.listGameServerClusters.asyncIterate( this.innerApiCalls['listGameServerClusters'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } 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 index dc5c3fc6542..2b4ee42a85b 100644 --- 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 @@ -30,7 +30,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -340,7 +339,8 @@ export class GameServerConfigsServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -638,7 +638,7 @@ export class GameServerConfigsServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createGameServerConfig, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.gaming.v1beta.GameServerConfig, @@ -782,7 +782,7 @@ export class GameServerConfigsServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteGameServerConfig, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -951,7 +951,7 @@ export class GameServerConfigsServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGameServerConfigs.createStream( - this.innerApiCalls.listGameServerConfigs as gax.GaxCall, + this.innerApiCalls.listGameServerConfigs as GaxCall, request, callSettings ); @@ -1011,7 +1011,7 @@ export class GameServerConfigsServiceClient { this.initialize(); return this.descriptors.page.listGameServerConfigs.asyncIterate( this.innerApiCalls['listGameServerConfigs'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } 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 index d29135eae89..665ff5a39a1 100644 --- 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 @@ -30,7 +30,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -377,7 +376,8 @@ export class GameServerDeploymentsServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -1001,7 +1001,7 @@ export class GameServerDeploymentsServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createGameServerDeployment, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.gaming.v1beta.GameServerDeployment, @@ -1144,7 +1144,7 @@ export class GameServerDeploymentsServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteGameServerDeployment, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -1293,7 +1293,7 @@ export class GameServerDeploymentsServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.updateGameServerDeployment, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.gaming.v1beta.GameServerDeployment, @@ -1447,7 +1447,7 @@ export class GameServerDeploymentsServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.updateGameServerDeploymentRollout, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.gaming.v1beta.GameServerDeployment, @@ -1617,7 +1617,7 @@ export class GameServerDeploymentsServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listGameServerDeployments.createStream( - this.innerApiCalls.listGameServerDeployments as gax.GaxCall, + this.innerApiCalls.listGameServerDeployments as GaxCall, request, callSettings ); @@ -1676,7 +1676,7 @@ export class GameServerDeploymentsServiceClient { this.initialize(); return this.descriptors.page.listGameServerDeployments.asyncIterate( this.innerApiCalls['listGameServerDeployments'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index a07eaab2b0f..2f8cc63ba28 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -30,7 +30,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -344,7 +343,8 @@ export class RealmsServiceClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -727,7 +727,7 @@ export class RealmsServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createRealm, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.gaming.v1beta.Realm, @@ -865,7 +865,7 @@ export class RealmsServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteRealm, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -1010,7 +1010,7 @@ export class RealmsServiceClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.updateRealm, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.gaming.v1beta.Realm, @@ -1170,7 +1170,7 @@ export class RealmsServiceClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listRealms.createStream( - this.innerApiCalls.listRealms as gax.GaxCall, + this.innerApiCalls.listRealms as GaxCall, request, callSettings ); @@ -1229,7 +1229,7 @@ export class RealmsServiceClient { this.initialize(); return this.descriptors.page.listRealms.asyncIterate( this.innerApiCalls['listRealms'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } 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 index b85c56907bc..ed708820d19 100644 --- 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 @@ -145,111 +145,113 @@ function stubAsyncIterationCall( } describe('v1.GameServerClustersServiceClient', () => { - it('has servicePath', () => { - const servicePath = - gameserverclustersserviceModule.v1.GameServerClustersServiceClient - .servicePath; - assert(servicePath); - }); + 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 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('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 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('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 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', + 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(); }); - 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', + 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(); }); - 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', 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); - } + 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); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('getGameServerCluster', () => { 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 index b9792e77342..4ff1aa37ae4 100644 --- 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 @@ -145,124 +145,126 @@ function stubAsyncIterationCall( } describe('v1beta.GameServerClustersServiceClient', () => { - it('has servicePath', () => { - const servicePath = - gameserverclustersserviceModule.v1beta.GameServerClustersServiceClient - .servicePath; - assert(servicePath); - }); + 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 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('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 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('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 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 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 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', 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); - } + 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); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('getGameServerCluster', () => { 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 index 6b2da5a767b..895a36c06b4 100644 --- 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 @@ -145,111 +145,113 @@ function stubAsyncIterationCall( } describe('v1.GameServerConfigsServiceClient', () => { - it('has servicePath', () => { - const servicePath = - gameserverconfigsserviceModule.v1.GameServerConfigsServiceClient - .servicePath; - assert(servicePath); - }); + 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 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('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 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('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 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', + 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(); }); - 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', + 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(); }); - 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', 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); - } + 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); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('getGameServerConfig', () => { 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 index 14159995ddc..bfc92c6658f 100644 --- 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 @@ -145,111 +145,126 @@ function stubAsyncIterationCall( } describe('v1beta.GameServerConfigsServiceClient', () => { - it('has servicePath', () => { - const servicePath = - gameserverconfigsserviceModule.v1beta.GameServerConfigsServiceClient - .servicePath; - assert(servicePath); - }); + 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 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('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 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('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 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', + 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(); }); - 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', + 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(); }); - 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', 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); - } + 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); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('getGameServerConfig', () => { 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 index e9b98c4cb4b..40a820de5c4 100644 --- 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 @@ -145,124 +145,126 @@ function stubAsyncIterationCall( } describe('v1.GameServerDeploymentsServiceClient', () => { - it('has servicePath', () => { - const servicePath = - gameserverdeploymentsserviceModule.v1.GameServerDeploymentsServiceClient - .servicePath; - assert(servicePath); - }); + 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 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('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 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('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 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 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 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', 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); - } + 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); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('getGameServerDeployment', () => { 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 index 91d7b82c109..822cfcd3868 100644 --- 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 @@ -145,124 +145,126 @@ function stubAsyncIterationCall( } describe('v1beta.GameServerDeploymentsServiceClient', () => { - it('has servicePath', () => { - const servicePath = - gameserverdeploymentsserviceModule.v1beta - .GameServerDeploymentsServiceClient.servicePath; - assert(servicePath); - }); + 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 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('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 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('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 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 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 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', 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); - } + 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); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('getGameServerDeployment', () => { diff --git a/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts b/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts index 2d6b6a71913..6f772331a8e 100644 --- a/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts @@ -145,99 +145,103 @@ function stubAsyncIterationCall( } describe('v1.RealmsServiceClient', () => { - 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); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + realmsserviceModule.v1.RealmsServiceClient.servicePath; + assert(servicePath); + }); - it('should create a client with gRPC fallback', () => { - const client = new realmsserviceModule.v1.RealmsServiceClient({ - fallback: true, + it('has apiEndpoint', () => { + const apiEndpoint = + realmsserviceModule.v1.RealmsServiceClient.apiEndpoint; + assert(apiEndpoint); }); - 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', + it('has port', () => { + const port = realmsserviceModule.v1.RealmsServiceClient.port; + assert(port); + assert(typeof port === 'number'); }); - 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', + it('should create a client with no option', () => { + const client = new realmsserviceModule.v1.RealmsServiceClient(); + assert(client); }); - client.initialize(); - assert(client.realmsServiceStub); - client.close().then(() => { - done(); + + it('should create a client with gRPC fallback', () => { + const client = new realmsserviceModule.v1.RealmsServiceClient({ + fallback: true, + }); + assert(client); }); - }); - 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', + 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); }); - assert.strictEqual(client.realmsServiceStub, undefined); - client.close().then(() => { - done(); + + 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 getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new realmsserviceModule.v1.RealmsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + 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(); + }); }); - 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', + 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()); }); - 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); - } + + 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); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('getRealm', () => { diff --git a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts index e2f2cc48020..7a180c26264 100644 --- a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts @@ -145,101 +145,103 @@ function stubAsyncIterationCall( } describe('v1beta.RealmsServiceClient', () => { - 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); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + realmsserviceModule.v1beta.RealmsServiceClient.servicePath; + assert(servicePath); + }); - it('should create a client with gRPC fallback', () => { - const client = new realmsserviceModule.v1beta.RealmsServiceClient({ - fallback: true, + it('has apiEndpoint', () => { + const apiEndpoint = + realmsserviceModule.v1beta.RealmsServiceClient.apiEndpoint; + assert(apiEndpoint); }); - 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', + it('has port', () => { + const port = realmsserviceModule.v1beta.RealmsServiceClient.port; + assert(port); + assert(typeof port === 'number'); }); - 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', + it('should create a client with no option', () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient(); + assert(client); }); - client.initialize(); - assert(client.realmsServiceStub); - client.close().then(() => { - done(); + + it('should create a client with gRPC fallback', () => { + const client = new realmsserviceModule.v1beta.RealmsServiceClient({ + fallback: true, + }); + assert(client); }); - }); - 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', + 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); }); - assert.strictEqual(client.realmsServiceStub, undefined); - client.close().then(() => { - done(); + + 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 getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new realmsserviceModule.v1beta.RealmsServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + 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(); + }); }); - 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', + 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()); }); - 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); - } + + 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); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('getRealm', () => { From c506d56846f25fbe74adca3b3ec2cb4975609250 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 17:02:14 +0000 Subject: [PATCH 163/180] fix: change import long to require (#306) Source-Link: https://github.com/googleapis/synthtool/commit/d229a1258999f599a90a9b674a1c5541e00db588 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:74ab2b3c71ef27e6d8b69b1d0a0c9d31447777b79ac3cd4be82c265b45f37e5e --- .../google-cloud-gaming/protos/protos.d.ts | 1359 ++- packages/google-cloud-gaming/protos/protos.js | 7514 ++++++++++++----- .../google-cloud-gaming/protos/protos.json | 24 + 3 files changed, 6706 insertions(+), 2191 deletions(-) diff --git a/packages/google-cloud-gaming/protos/protos.d.ts b/packages/google-cloud-gaming/protos/protos.d.ts index 84e8a7f6041..b61ac2bef7c 100644 --- a/packages/google-cloud-gaming/protos/protos.d.ts +++ b/packages/google-cloud-gaming/protos/protos.d.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import * as Long from "long"; +import Long = require("long"); import {protobuf as $protobuf} from "google-gax"; /** Namespace google. */ export namespace google { @@ -162,6 +162,13 @@ export namespace google { * @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. */ @@ -264,6 +271,13 @@ export namespace google { * @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 { @@ -365,6 +379,13 @@ export namespace google { * @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. */ @@ -455,6 +476,13 @@ export namespace google { * @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. */ @@ -563,6 +591,13 @@ export namespace google { * @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. */ @@ -659,6 +694,13 @@ export namespace google { * @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. */ @@ -761,6 +803,13 @@ export namespace google { * @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 { @@ -859,6 +908,13 @@ export namespace google { * @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 { @@ -957,6 +1013,13 @@ export namespace google { * @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. */ @@ -1053,6 +1116,13 @@ export namespace google { * @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; } } } @@ -1145,6 +1215,13 @@ export namespace google { * @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. */ @@ -1241,6 +1318,13 @@ export namespace google { * @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 { @@ -1351,6 +1435,13 @@ export namespace google { * @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 { @@ -1461,6 +1552,13 @@ export namespace google { * @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; } } @@ -1564,6 +1662,13 @@ export namespace google { * @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; } } @@ -1692,6 +1797,13 @@ export namespace google { * @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. */ @@ -1794,6 +1906,13 @@ export namespace google { * @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. */ @@ -1890,6 +2009,13 @@ export namespace google { * @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. */ @@ -1992,6 +2118,13 @@ export namespace google { * @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. */ @@ -2106,6 +2239,13 @@ export namespace google { * @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. */ @@ -2208,6 +2348,13 @@ export namespace google { * @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. */ @@ -2298,6 +2445,13 @@ export namespace google { * @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. */ @@ -2394,6 +2548,13 @@ export namespace google { * @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. */ @@ -2490,6 +2651,13 @@ export namespace google { * @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. */ @@ -2586,6 +2754,13 @@ export namespace google { * @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. */ @@ -2688,6 +2863,13 @@ export namespace google { * @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. */ @@ -2784,6 +2966,13 @@ export namespace google { * @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. */ @@ -2883,6 +3072,13 @@ export namespace google { * @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. */ @@ -2973,6 +3169,13 @@ export namespace google { * @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. */ @@ -3105,6 +3308,13 @@ export namespace google { * @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. */ @@ -3225,6 +3435,13 @@ export namespace google { * @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 { @@ -3378,56 +3595,56 @@ export namespace google { namespace GameServerClustersService { /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService#listGameServerClusters}. + * 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}. + * 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}. + * 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}. + * 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}. + * 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}. + * 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}. + * 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}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|previewUpdateGameServerCluster}. * @param error Error, if any * @param [response] PreviewUpdateGameServerClusterResponse */ @@ -3546,6 +3763,13 @@ export namespace google { * @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. */ @@ -3648,6 +3872,13 @@ export namespace google { * @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. */ @@ -3738,6 +3969,13 @@ export namespace google { * @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. */ @@ -3840,6 +4078,13 @@ export namespace google { * @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. */ @@ -3930,6 +4175,13 @@ export namespace google { * @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. */ @@ -4038,6 +4290,13 @@ export namespace google { * @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. */ @@ -4134,6 +4393,13 @@ export namespace google { * @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. */ @@ -4260,6 +4526,13 @@ export namespace google { * @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 */ @@ -4342,28 +4615,28 @@ export namespace google { namespace GameServerConfigsService { /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerConfigsService#listGameServerConfigs}. + * 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}. + * 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}. + * 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}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerConfigsService|deleteGameServerConfig}. * @param error Error, if any * @param [response] Operation */ @@ -4482,6 +4755,13 @@ export namespace google { * @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. */ @@ -4584,6 +4864,13 @@ export namespace google { * @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. */ @@ -4674,6 +4961,13 @@ export namespace google { * @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. */ @@ -4764,6 +5058,13 @@ export namespace google { * @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. */ @@ -4866,6 +5167,13 @@ export namespace google { * @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. */ @@ -4956,6 +5264,13 @@ export namespace google { * @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. */ @@ -5052,6 +5367,13 @@ export namespace google { * @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. */ @@ -5148,6 +5470,13 @@ export namespace google { * @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. */ @@ -5238,6 +5567,13 @@ export namespace google { * @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. */ @@ -5334,6 +5670,13 @@ export namespace google { * @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 { @@ -5432,6 +5775,13 @@ export namespace google { * @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; } } @@ -5553,6 +5903,13 @@ export namespace google { * @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. */ @@ -5655,6 +6012,13 @@ export namespace google { * @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. */ @@ -5775,6 +6139,13 @@ export namespace google { * @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. */ @@ -5877,6 +6248,13 @@ export namespace google { * @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. */ @@ -5979,6 +6357,13 @@ export namespace google { * @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 */ @@ -6131,63 +6516,63 @@ export namespace google { namespace GameServerDeploymentsService { /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService#listGameServerDeployments}. + * 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}. + * 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}. + * 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}. + * 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}. + * 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}. + * 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}. + * 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}. + * 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}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|fetchDeploymentState}. * @param error Error, if any * @param [response] FetchDeploymentStateResponse */ @@ -6306,6 +6691,13 @@ export namespace google { * @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. */ @@ -6408,6 +6800,13 @@ export namespace google { * @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. */ @@ -6498,6 +6897,13 @@ export namespace google { * @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. */ @@ -6600,6 +7006,13 @@ export namespace google { * @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. */ @@ -6690,6 +7103,13 @@ export namespace google { * @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. */ @@ -6786,6 +7206,13 @@ export namespace google { * @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. */ @@ -6888,6 +7315,13 @@ export namespace google { * @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. */ @@ -6984,6 +7418,13 @@ export namespace google { * @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. */ @@ -7110,6 +7551,13 @@ export namespace google { * @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 */ @@ -7220,42 +7668,42 @@ export namespace google { namespace RealmsService { /** - * Callback as used by {@link google.cloud.gaming.v1.RealmsService#listRealms}. + * 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}. + * 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}. + * 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}. + * 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}. + * 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}. + * Callback as used by {@link google.cloud.gaming.v1.RealmsService|previewRealmUpdate}. * @param error Error, if any * @param [response] PreviewRealmUpdateResponse */ @@ -7402,6 +7850,13 @@ export namespace google { * @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. */ @@ -7504,6 +7959,13 @@ export namespace google { * @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 { @@ -7605,6 +8067,13 @@ export namespace google { * @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. */ @@ -7695,6 +8164,13 @@ export namespace google { * @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. */ @@ -7803,6 +8279,13 @@ export namespace google { * @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. */ @@ -7899,6 +8382,13 @@ export namespace google { * @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. */ @@ -8001,6 +8491,13 @@ export namespace google { * @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 { @@ -8099,6 +8596,13 @@ export namespace google { * @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 { @@ -8197,6 +8701,13 @@ export namespace google { * @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. */ @@ -8293,6 +8804,13 @@ export namespace google { * @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; } } } @@ -8385,6 +8903,13 @@ export namespace google { * @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. */ @@ -8481,6 +9006,13 @@ export namespace google { * @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 { @@ -8591,6 +9123,13 @@ export namespace google { * @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 { @@ -8701,6 +9240,13 @@ export namespace google { * @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; } } @@ -8804,6 +9350,13 @@ export namespace google { * @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; } } @@ -8919,6 +9472,13 @@ export namespace google { * @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. */ @@ -9021,6 +9581,13 @@ export namespace google { * @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. */ @@ -9111,6 +9678,13 @@ export namespace google { * @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. */ @@ -9213,6 +9787,13 @@ export namespace google { * @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. */ @@ -9321,6 +9902,13 @@ export namespace google { * @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. */ @@ -9417,6 +10005,13 @@ export namespace google { * @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. */ @@ -9507,6 +10102,13 @@ export namespace google { * @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. */ @@ -9603,6 +10205,13 @@ export namespace google { * @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. */ @@ -9699,6 +10308,13 @@ export namespace google { * @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. */ @@ -9795,6 +10411,13 @@ export namespace google { * @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. */ @@ -9897,6 +10520,13 @@ export namespace google { * @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. */ @@ -9993,6 +10623,13 @@ export namespace google { * @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. */ @@ -10092,6 +10729,13 @@ export namespace google { * @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. */ @@ -10182,6 +10826,13 @@ export namespace google { * @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. */ @@ -10308,6 +10959,13 @@ export namespace google { * @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 */ @@ -10446,56 +11104,56 @@ export namespace google { namespace GameServerClustersService { /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService#listGameServerClusters}. + * 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}. + * 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}. + * 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}. + * 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}. + * 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}. + * 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}. + * 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}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|previewUpdateGameServerCluster}. * @param error Error, if any * @param [response] PreviewUpdateGameServerClusterResponse */ @@ -10614,6 +11272,13 @@ export namespace google { * @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. */ @@ -10716,6 +11381,13 @@ export namespace google { * @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. */ @@ -10806,6 +11478,13 @@ export namespace google { * @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. */ @@ -10908,6 +11587,13 @@ export namespace google { * @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. */ @@ -10998,6 +11684,13 @@ export namespace google { * @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. */ @@ -11106,6 +11799,13 @@ export namespace google { * @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. */ @@ -11202,6 +11902,13 @@ export namespace google { * @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. */ @@ -11328,6 +12035,13 @@ export namespace google { * @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 */ @@ -11410,28 +12124,28 @@ export namespace google { namespace GameServerConfigsService { /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerConfigsService#listGameServerConfigs}. + * 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}. + * 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}. + * 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}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerConfigsService|deleteGameServerConfig}. * @param error Error, if any * @param [response] Operation */ @@ -11550,6 +12264,13 @@ export namespace google { * @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. */ @@ -11652,6 +12373,13 @@ export namespace google { * @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. */ @@ -11742,6 +12470,13 @@ export namespace google { * @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. */ @@ -11832,6 +12567,13 @@ export namespace google { * @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. */ @@ -11934,6 +12676,13 @@ export namespace google { * @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. */ @@ -12024,6 +12773,13 @@ export namespace google { * @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. */ @@ -12120,6 +12876,13 @@ export namespace google { * @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. */ @@ -12216,6 +12979,13 @@ export namespace google { * @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. */ @@ -12306,6 +13076,13 @@ export namespace google { * @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. */ @@ -12402,6 +13179,13 @@ export namespace google { * @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 { @@ -12500,6 +13284,13 @@ export namespace google { * @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; } } @@ -12621,6 +13412,13 @@ export namespace google { * @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. */ @@ -12723,6 +13521,13 @@ export namespace google { * @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. */ @@ -12843,6 +13648,13 @@ export namespace google { * @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. */ @@ -12945,6 +13757,13 @@ export namespace google { * @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. */ @@ -13047,6 +13866,13 @@ export namespace google { * @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 */ @@ -13199,63 +14025,63 @@ export namespace google { namespace GameServerDeploymentsService { /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService#listGameServerDeployments}. + * 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}. + * 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}. + * 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}. + * 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}. + * 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}. + * 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}. + * 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}. + * 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}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|fetchDeploymentState}. * @param error Error, if any * @param [response] FetchDeploymentStateResponse */ @@ -13374,6 +14200,13 @@ export namespace google { * @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. */ @@ -13476,6 +14309,13 @@ export namespace google { * @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. */ @@ -13566,6 +14406,13 @@ export namespace google { * @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. */ @@ -13668,6 +14515,13 @@ export namespace google { * @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. */ @@ -13758,6 +14612,13 @@ export namespace google { * @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. */ @@ -13854,6 +14715,13 @@ export namespace google { * @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. */ @@ -13956,6 +14824,13 @@ export namespace google { * @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. */ @@ -14052,6 +14927,13 @@ export namespace google { * @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. */ @@ -14178,6 +15060,13 @@ export namespace google { * @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 */ @@ -14288,42 +15177,42 @@ export namespace google { namespace RealmsService { /** - * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService#listRealms}. + * 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}. + * 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}. + * 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}. + * 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}. + * 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}. + * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService|previewRealmUpdate}. * @param error Error, if any * @param [response] PreviewRealmUpdateResponse */ @@ -14472,6 +15361,13 @@ export namespace google { * @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 { @@ -14584,6 +15480,13 @@ export namespace google { * @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. */ @@ -14680,6 +15583,13 @@ export namespace google { * @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. */ @@ -14827,6 +15737,13 @@ export namespace google { * @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. */ @@ -14923,6 +15840,13 @@ export namespace google { * @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; } } @@ -15017,6 +15941,13 @@ export namespace google { * @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. */ @@ -15057,6 +15988,9 @@ export namespace google { /** FileDescriptorProto syntax */ syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); } /** Represents a FileDescriptorProto. */ @@ -15104,6 +16038,9 @@ export namespace google { /** FileDescriptorProto syntax. */ public syntax: string; + /** FileDescriptorProto edition. */ + public edition: string; + /** * Creates a new FileDescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -15173,6 +16110,13 @@ export namespace google { * @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. */ @@ -15317,6 +16261,13 @@ export namespace google { * @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 { @@ -15421,6 +16372,13 @@ export namespace google { * @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. */ @@ -15517,6 +16475,13 @@ export namespace google { * @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; } } @@ -15608,6 +16573,13 @@ export namespace google { * @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. */ @@ -15758,6 +16730,13 @@ export namespace google { * @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 { @@ -15886,6 +16865,13 @@ export namespace google { * @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. */ @@ -16000,6 +16986,13 @@ export namespace google { * @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 { @@ -16098,6 +17091,13 @@ export namespace google { * @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; } } @@ -16201,6 +17201,13 @@ export namespace google { * @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. */ @@ -16303,6 +17310,13 @@ export namespace google { * @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. */ @@ -16423,6 +17437,13 @@ export namespace google { * @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. */ @@ -16636,6 +17657,13 @@ export namespace google { * @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 { @@ -16763,6 +17791,13 @@ export namespace google { * @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. */ @@ -16780,6 +17815,9 @@ export namespace google { /** FieldOptions lazy */ lazy?: (boolean|null); + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + /** FieldOptions deprecated */ deprecated?: (boolean|null); @@ -16817,6 +17855,9 @@ export namespace google { /** FieldOptions lazy. */ public lazy: boolean; + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + /** FieldOptions deprecated. */ public deprecated: boolean; @@ -16895,6 +17936,13 @@ export namespace google { * @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 { @@ -17002,6 +18050,13 @@ export namespace google { * @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. */ @@ -17104,6 +18159,13 @@ export namespace google { * @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. */ @@ -17200,6 +18262,13 @@ export namespace google { * @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. */ @@ -17302,6 +18371,13 @@ export namespace google { * @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. */ @@ -17413,6 +18489,13 @@ export namespace google { * @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 { @@ -17549,6 +18632,13 @@ export namespace google { * @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 { @@ -17647,6 +18737,13 @@ export namespace google { * @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; } } @@ -17738,6 +18835,13 @@ export namespace google { * @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 { @@ -17854,6 +18958,13 @@ export namespace google { * @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; } } @@ -17945,6 +19056,13 @@ export namespace google { * @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 { @@ -17963,6 +19081,9 @@ export namespace google { /** Annotation end */ end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); } /** Represents an Annotation. */ @@ -17986,6 +19107,9 @@ export namespace google { /** 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 @@ -18055,6 +19179,23 @@ export namespace google { * @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 + } } } @@ -18152,6 +19293,13 @@ export namespace google { * @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. */ @@ -18248,6 +19396,13 @@ export namespace google { * @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. */ @@ -18338,6 +19493,13 @@ export namespace google { * @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. */ @@ -18434,6 +19596,13 @@ export namespace google { * @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. */ @@ -18518,6 +19687,13 @@ export namespace google { * @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; } } @@ -18618,35 +19794,35 @@ export namespace google { namespace Operations { /** - * Callback as used by {@link google.longrunning.Operations#listOperations}. + * 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}. + * 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}. + * 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}. + * 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}. + * Callback as used by {@link google.longrunning.Operations|waitOperation}. * @param error Error, if any * @param [response] Operation */ @@ -18768,6 +19944,13 @@ export namespace google { * @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. */ @@ -18858,6 +20041,13 @@ export namespace google { * @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. */ @@ -18966,6 +20156,13 @@ export namespace google { * @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. */ @@ -19062,6 +20259,13 @@ export namespace google { * @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. */ @@ -19152,6 +20356,13 @@ export namespace google { * @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. */ @@ -19242,6 +20453,13 @@ export namespace google { * @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. */ @@ -19338,6 +20556,13 @@ export namespace google { * @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. */ @@ -19434,6 +20659,13 @@ export namespace google { * @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; } } @@ -19540,6 +20772,13 @@ export namespace google { * @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 index e3a3f223d6c..147c27f32bd 100644 --- a/packages/google-cloud-gaming/protos/protos.js +++ b/packages/google-cloud-gaming/protos/protos.js @@ -252,54 +252,63 @@ 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; + 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; } - message.operationStatus[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -497,6 +506,21 @@ 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; })(); @@ -614,15 +638,18 @@ 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; + 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; @@ -752,6 +779,21 @@ 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 @@ -867,28 +909,29 @@ 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; + 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; } - message.labels[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -992,6 +1035,21 @@ 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; })(); @@ -1089,11 +1147,12 @@ 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; + case 1: { + if (!(message.realms && message.realms.length)) + message.realms = []; + message.realms.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -1195,6 +1254,21 @@ 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; })(); @@ -1323,18 +1397,22 @@ 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; + 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; @@ -1464,6 +1542,21 @@ 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; })(); @@ -1570,12 +1663,14 @@ 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; + case 1: { + message.gameServerConfigName = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -1674,6 +1769,21 @@ 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; })(); @@ -1793,17 +1903,20 @@ 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; + 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; @@ -1928,6 +2041,21 @@ 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() { /** @@ -2031,12 +2159,14 @@ 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; + 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; @@ -2145,6 +2275,21 @@ 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() { /** @@ -2248,12 +2393,14 @@ 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; + 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; @@ -2357,6 +2504,21 @@ 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; })(); @@ -2463,12 +2625,14 @@ 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; + 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; @@ -2572,6 +2736,21 @@ 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; })(); @@ -2675,11 +2854,12 @@ 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; + 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; @@ -2786,6 +2966,21 @@ 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; })(); @@ -2892,12 +3087,14 @@ 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; + 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; @@ -3006,6 +3203,21 @@ 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() { /** @@ -3131,18 +3343,22 @@ 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; + 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; @@ -3267,6 +3483,21 @@ 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() { /** @@ -3392,18 +3623,22 @@ 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; + 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; @@ -3574,6 +3809,21 @@ 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; })(); @@ -3694,15 +3944,18 @@ 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; + 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; @@ -3814,6 +4067,21 @@ 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; })(); @@ -3983,24 +4251,30 @@ 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; + 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; @@ -4149,6 +4423,21 @@ 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; })(); @@ -4270,19 +4559,22 @@ 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; + 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; @@ -4419,6 +4711,21 @@ 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; })(); @@ -4525,12 +4832,14 @@ 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; + case 1: { + message.name = reader.string(); + break; + } + case 6: { + message.view = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -4647,6 +4956,21 @@ 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; })(); @@ -4764,15 +5088,18 @@ 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 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; @@ -4884,6 +5211,21 @@ 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; })(); @@ -5023,21 +5365,26 @@ 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; + 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; @@ -5188,6 +5535,21 @@ 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; })(); @@ -5305,15 +5667,18 @@ 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; + 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; @@ -5430,6 +5795,21 @@ 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; })(); @@ -5525,9 +5905,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -5617,6 +5998,21 @@ 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; })(); @@ -5723,12 +6119,14 @@ 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; + 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; @@ -5832,6 +6230,21 @@ 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; })(); @@ -5938,12 +6351,14 @@ 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 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; @@ -6047,6 +6462,21 @@ 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; })(); @@ -6153,12 +6583,14 @@ 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 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; @@ -6267,6 +6699,21 @@ 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; })(); @@ -6384,15 +6831,18 @@ 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; + 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; @@ -6514,6 +6964,21 @@ 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; })(); @@ -6620,12 +7085,14 @@ 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 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; @@ -6729,6 +7196,21 @@ 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; })(); @@ -6849,12 +7331,14 @@ 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; + 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; @@ -6963,6 +7447,21 @@ 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; })(); @@ -7058,9 +7557,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.cluster = reader.string(); - break; + case 1: { + message.cluster = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -7150,6 +7650,21 @@ 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; })(); @@ -7324,49 +7839,57 @@ 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; + 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; } - 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; @@ -7548,6 +8071,21 @@ 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; })(); @@ -7698,24 +8236,30 @@ 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; + 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; @@ -7889,6 +8433,21 @@ 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 @@ -7951,7 +8510,7 @@ }; /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService#listGameServerClusters}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|listGameServerClusters}. * @memberof google.cloud.gaming.v1.GameServerClustersService * @typedef ListGameServerClustersCallback * @type {function} @@ -7984,7 +8543,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService#getGameServerCluster}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|getGameServerCluster}. * @memberof google.cloud.gaming.v1.GameServerClustersService * @typedef GetGameServerClusterCallback * @type {function} @@ -8017,7 +8576,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService#createGameServerCluster}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|createGameServerCluster}. * @memberof google.cloud.gaming.v1.GameServerClustersService * @typedef CreateGameServerClusterCallback * @type {function} @@ -8050,7 +8609,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService#previewCreateGameServerCluster}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|previewCreateGameServerCluster}. * @memberof google.cloud.gaming.v1.GameServerClustersService * @typedef PreviewCreateGameServerClusterCallback * @type {function} @@ -8083,7 +8642,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService#deleteGameServerCluster}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|deleteGameServerCluster}. * @memberof google.cloud.gaming.v1.GameServerClustersService * @typedef DeleteGameServerClusterCallback * @type {function} @@ -8116,7 +8675,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService#previewDeleteGameServerCluster}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|previewDeleteGameServerCluster}. * @memberof google.cloud.gaming.v1.GameServerClustersService * @typedef PreviewDeleteGameServerClusterCallback * @type {function} @@ -8149,7 +8708,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService#updateGameServerCluster}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|updateGameServerCluster}. * @memberof google.cloud.gaming.v1.GameServerClustersService * @typedef UpdateGameServerClusterCallback * @type {function} @@ -8182,7 +8741,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService#previewUpdateGameServerCluster}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerClustersService|previewUpdateGameServerCluster}. * @memberof google.cloud.gaming.v1.GameServerClustersService * @typedef PreviewUpdateGameServerClusterCallback * @type {function} @@ -8353,21 +8912,26 @@ 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 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; @@ -8490,6 +9054,21 @@ 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; })(); @@ -8611,19 +9190,22 @@ 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; + 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; @@ -8760,6 +9342,21 @@ 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; })(); @@ -8855,9 +9452,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -8947,6 +9545,21 @@ 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; })(); @@ -9064,15 +9677,18 @@ 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; + 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; @@ -9184,6 +9800,21 @@ 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; })(); @@ -9279,9 +9910,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -9371,6 +10003,21 @@ 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; })(); @@ -9503,22 +10150,26 @@ 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; + 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; @@ -9669,6 +10320,21 @@ 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; })(); @@ -9775,12 +10441,14 @@ 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; + case 1: { + message.fleetSpec = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -9879,6 +10547,21 @@ 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; })(); @@ -10046,50 +10729,57 @@ 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; + 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; } - 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; @@ -10289,6 +10979,21 @@ 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; })(); @@ -10325,7 +11030,7 @@ }; /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerConfigsService#listGameServerConfigs}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerConfigsService|listGameServerConfigs}. * @memberof google.cloud.gaming.v1.GameServerConfigsService * @typedef ListGameServerConfigsCallback * @type {function} @@ -10358,7 +11063,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerConfigsService#getGameServerConfig}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerConfigsService|getGameServerConfig}. * @memberof google.cloud.gaming.v1.GameServerConfigsService * @typedef GetGameServerConfigCallback * @type {function} @@ -10391,7 +11096,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerConfigsService#createGameServerConfig}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerConfigsService|createGameServerConfig}. * @memberof google.cloud.gaming.v1.GameServerConfigsService * @typedef CreateGameServerConfigCallback * @type {function} @@ -10424,7 +11129,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerConfigsService#deleteGameServerConfig}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerConfigsService|deleteGameServerConfig}. * @memberof google.cloud.gaming.v1.GameServerConfigsService * @typedef DeleteGameServerConfigCallback * @type {function} @@ -10595,21 +11300,26 @@ 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 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; @@ -10732,6 +11442,21 @@ 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; })(); @@ -10853,19 +11578,22 @@ 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; + 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; @@ -11002,6 +11730,21 @@ 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; })(); @@ -11097,9 +11840,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -11189,6 +11933,21 @@ 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; })(); @@ -11284,9 +12043,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -11376,6 +12136,21 @@ 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; })(); @@ -11493,15 +12268,18 @@ 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; + 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; @@ -11613,6 +12391,21 @@ 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; })(); @@ -11708,9 +12501,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -11800,6 +12594,21 @@ 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; })(); @@ -11906,12 +12715,14 @@ 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; + 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; @@ -12020,6 +12831,21 @@ 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; })(); @@ -12126,12 +12952,14 @@ 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 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; @@ -12240,6 +13068,21 @@ 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; })(); @@ -12335,9 +13178,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -12427,6 +13271,21 @@ 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; })(); @@ -12537,16 +13396,18 @@ 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; + 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; @@ -12674,6 +13535,21 @@ 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() { /** @@ -12779,14 +13655,16 @@ 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; + 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; @@ -12902,6 +13780,21 @@ 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; })(); @@ -13057,43 +13950,49 @@ 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; + 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; } - 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; @@ -13249,6 +14148,21 @@ 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; })(); @@ -13380,12 +14294,14 @@ 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; + 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; @@ -13497,6 +14413,21 @@ 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; })(); @@ -13649,26 +14580,32 @@ 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; + 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; @@ -13827,6 +14764,21 @@ 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; })(); @@ -13944,15 +14896,18 @@ 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; + 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; @@ -14074,6 +15029,21 @@ 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; })(); @@ -14193,17 +15163,20 @@ 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; + 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; @@ -14328,6 +15301,21 @@ 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; })(); @@ -14364,7 +15352,7 @@ }; /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService#listGameServerDeployments}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|listGameServerDeployments}. * @memberof google.cloud.gaming.v1.GameServerDeploymentsService * @typedef ListGameServerDeploymentsCallback * @type {function} @@ -14397,7 +15385,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService#getGameServerDeployment}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|getGameServerDeployment}. * @memberof google.cloud.gaming.v1.GameServerDeploymentsService * @typedef GetGameServerDeploymentCallback * @type {function} @@ -14430,7 +15418,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService#createGameServerDeployment}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|createGameServerDeployment}. * @memberof google.cloud.gaming.v1.GameServerDeploymentsService * @typedef CreateGameServerDeploymentCallback * @type {function} @@ -14463,7 +15451,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService#deleteGameServerDeployment}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|deleteGameServerDeployment}. * @memberof google.cloud.gaming.v1.GameServerDeploymentsService * @typedef DeleteGameServerDeploymentCallback * @type {function} @@ -14496,7 +15484,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService#updateGameServerDeployment}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|updateGameServerDeployment}. * @memberof google.cloud.gaming.v1.GameServerDeploymentsService * @typedef UpdateGameServerDeploymentCallback * @type {function} @@ -14529,7 +15517,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService#getGameServerDeploymentRollout}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|getGameServerDeploymentRollout}. * @memberof google.cloud.gaming.v1.GameServerDeploymentsService * @typedef GetGameServerDeploymentRolloutCallback * @type {function} @@ -14562,7 +15550,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService#updateGameServerDeploymentRollout}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|updateGameServerDeploymentRollout}. * @memberof google.cloud.gaming.v1.GameServerDeploymentsService * @typedef UpdateGameServerDeploymentRolloutCallback * @type {function} @@ -14595,7 +15583,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService#previewGameServerDeploymentRollout}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|previewGameServerDeploymentRollout}. * @memberof google.cloud.gaming.v1.GameServerDeploymentsService * @typedef PreviewGameServerDeploymentRolloutCallback * @type {function} @@ -14628,7 +15616,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService#fetchDeploymentState}. + * Callback as used by {@link google.cloud.gaming.v1.GameServerDeploymentsService|fetchDeploymentState}. * @memberof google.cloud.gaming.v1.GameServerDeploymentsService * @typedef FetchDeploymentStateCallback * @type {function} @@ -14799,21 +15787,26 @@ 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 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; @@ -14936,6 +15929,21 @@ 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; })(); @@ -15057,19 +16065,22 @@ 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; + 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; @@ -15206,6 +16217,21 @@ 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; })(); @@ -15301,9 +16327,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -15393,6 +16420,21 @@ 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; })(); @@ -15510,15 +16552,18 @@ 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; + 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; @@ -15630,6 +16675,21 @@ 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; })(); @@ -15725,9 +16785,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -15817,6 +16878,21 @@ 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; })(); @@ -15923,12 +16999,14 @@ 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 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; @@ -16037,6 +17115,21 @@ 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; })(); @@ -16154,15 +17247,18 @@ 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; + 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; @@ -16284,6 +17380,21 @@ 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; })(); @@ -16390,12 +17501,14 @@ 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 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; @@ -16499,6 +17612,21 @@ 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; })(); @@ -16662,46 +17790,53 @@ 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; + 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; } - 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; @@ -16865,6 +18000,21 @@ 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; })(); @@ -16901,7 +18051,7 @@ }; /** - * Callback as used by {@link google.cloud.gaming.v1.RealmsService#listRealms}. + * Callback as used by {@link google.cloud.gaming.v1.RealmsService|listRealms}. * @memberof google.cloud.gaming.v1.RealmsService * @typedef ListRealmsCallback * @type {function} @@ -16934,7 +18084,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.RealmsService#getRealm}. + * Callback as used by {@link google.cloud.gaming.v1.RealmsService|getRealm}. * @memberof google.cloud.gaming.v1.RealmsService * @typedef GetRealmCallback * @type {function} @@ -16967,7 +18117,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.RealmsService#createRealm}. + * Callback as used by {@link google.cloud.gaming.v1.RealmsService|createRealm}. * @memberof google.cloud.gaming.v1.RealmsService * @typedef CreateRealmCallback * @type {function} @@ -17000,7 +18150,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.RealmsService#deleteRealm}. + * Callback as used by {@link google.cloud.gaming.v1.RealmsService|deleteRealm}. * @memberof google.cloud.gaming.v1.RealmsService * @typedef DeleteRealmCallback * @type {function} @@ -17033,7 +18183,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.RealmsService#updateRealm}. + * Callback as used by {@link google.cloud.gaming.v1.RealmsService|updateRealm}. * @memberof google.cloud.gaming.v1.RealmsService * @typedef UpdateRealmCallback * @type {function} @@ -17066,7 +18216,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1.RealmsService#previewRealmUpdate}. + * Callback as used by {@link google.cloud.gaming.v1.RealmsService|previewRealmUpdate}. * @memberof google.cloud.gaming.v1.RealmsService * @typedef PreviewRealmUpdateCallback * @type {function} @@ -17299,54 +18449,63 @@ 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; + 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; } - message.operationStatus[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -17544,6 +18703,21 @@ 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; })(); @@ -17661,15 +18835,18 @@ 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; + 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; @@ -17799,6 +18976,21 @@ 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 @@ -17914,28 +19106,29 @@ 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; + 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; } - message.labels[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -18039,6 +19232,21 @@ 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; })(); @@ -18136,11 +19344,12 @@ 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; + case 1: { + if (!(message.realms && message.realms.length)) + message.realms = []; + message.realms.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -18242,6 +19451,21 @@ 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; })(); @@ -18370,18 +19594,22 @@ 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; + 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; @@ -18511,6 +19739,21 @@ 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; })(); @@ -18617,12 +19860,14 @@ 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; + case 1: { + message.gameServerConfigName = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -18721,6 +19966,21 @@ 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; })(); @@ -18840,17 +20100,20 @@ 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; + 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; @@ -18975,6 +20238,21 @@ 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() { /** @@ -19078,12 +20356,14 @@ 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; + 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; @@ -19192,6 +20472,21 @@ 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() { /** @@ -19295,12 +20590,14 @@ 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; + 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; @@ -19404,6 +20701,21 @@ 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; })(); @@ -19510,12 +20822,14 @@ 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; + 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; @@ -19619,6 +20933,21 @@ 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; })(); @@ -19722,11 +21051,12 @@ 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; + 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; @@ -19833,6 +21163,21 @@ 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; })(); @@ -19939,12 +21284,14 @@ 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; + 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; @@ -20053,6 +21400,21 @@ 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() { /** @@ -20178,18 +21540,22 @@ 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; + 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; @@ -20314,6 +21680,21 @@ 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() { /** @@ -20439,18 +21820,22 @@ 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; + 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; @@ -20621,6 +22006,21 @@ 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; })(); @@ -20741,15 +22141,18 @@ 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; + 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; @@ -20861,6 +22264,21 @@ 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; })(); @@ -21003,21 +22421,26 @@ 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 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; @@ -21140,6 +22563,21 @@ 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; })(); @@ -21261,19 +22699,22 @@ 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; + 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; @@ -21410,6 +22851,21 @@ 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; })(); @@ -21505,9 +22961,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -21597,6 +23054,21 @@ 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; })(); @@ -21714,15 +23186,18 @@ 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 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; @@ -21834,6 +23309,21 @@ 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; })(); @@ -21962,18 +23452,22 @@ 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; + 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; @@ -22098,6 +23592,21 @@ 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; })(); @@ -22204,12 +23713,14 @@ 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; + 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; @@ -22313,6 +23824,21 @@ 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; })(); @@ -22408,9 +23934,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -22500,6 +24027,21 @@ 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; })(); @@ -22606,12 +24148,14 @@ 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; + 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; @@ -22715,6 +24259,21 @@ 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; })(); @@ -22821,12 +24380,14 @@ 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; + 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; @@ -22930,6 +24491,21 @@ 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; })(); @@ -23036,12 +24612,14 @@ 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 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; @@ -23150,6 +24728,21 @@ 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; })(); @@ -23267,15 +24860,18 @@ 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; + 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; @@ -23397,6 +24993,21 @@ 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; })(); @@ -23503,12 +25114,14 @@ 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; + 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; @@ -23612,6 +25225,21 @@ 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; })(); @@ -23732,12 +25360,14 @@ 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; + 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; @@ -23846,6 +25476,21 @@ 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; })(); @@ -23941,9 +25586,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.cluster = reader.string(); - break; + case 1: { + message.cluster = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -24033,6 +25679,21 @@ 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; })(); @@ -24196,46 +25857,53 @@ 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; + 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; } - 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; @@ -24404,6 +26072,21 @@ 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; })(); @@ -24440,7 +26123,7 @@ }; /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService#listGameServerClusters}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|listGameServerClusters}. * @memberof google.cloud.gaming.v1beta.GameServerClustersService * @typedef ListGameServerClustersCallback * @type {function} @@ -24473,7 +26156,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService#getGameServerCluster}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|getGameServerCluster}. * @memberof google.cloud.gaming.v1beta.GameServerClustersService * @typedef GetGameServerClusterCallback * @type {function} @@ -24506,7 +26189,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService#createGameServerCluster}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|createGameServerCluster}. * @memberof google.cloud.gaming.v1beta.GameServerClustersService * @typedef CreateGameServerClusterCallback * @type {function} @@ -24539,7 +26222,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService#previewCreateGameServerCluster}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|previewCreateGameServerCluster}. * @memberof google.cloud.gaming.v1beta.GameServerClustersService * @typedef PreviewCreateGameServerClusterCallback * @type {function} @@ -24572,7 +26255,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService#deleteGameServerCluster}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|deleteGameServerCluster}. * @memberof google.cloud.gaming.v1beta.GameServerClustersService * @typedef DeleteGameServerClusterCallback * @type {function} @@ -24605,7 +26288,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService#previewDeleteGameServerCluster}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|previewDeleteGameServerCluster}. * @memberof google.cloud.gaming.v1beta.GameServerClustersService * @typedef PreviewDeleteGameServerClusterCallback * @type {function} @@ -24638,7 +26321,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService#updateGameServerCluster}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|updateGameServerCluster}. * @memberof google.cloud.gaming.v1beta.GameServerClustersService * @typedef UpdateGameServerClusterCallback * @type {function} @@ -24671,7 +26354,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService#previewUpdateGameServerCluster}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerClustersService|previewUpdateGameServerCluster}. * @memberof google.cloud.gaming.v1beta.GameServerClustersService * @typedef PreviewUpdateGameServerClusterCallback * @type {function} @@ -24842,21 +26525,26 @@ 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 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; @@ -24979,6 +26667,21 @@ 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; })(); @@ -25100,19 +26803,22 @@ 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; + 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; @@ -25249,6 +26955,21 @@ 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; })(); @@ -25344,9 +27065,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -25436,6 +27158,21 @@ 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; })(); @@ -25553,15 +27290,18 @@ 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; + 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; @@ -25673,6 +27413,21 @@ 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; })(); @@ -25768,9 +27523,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -25860,6 +27616,21 @@ 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; })(); @@ -25992,22 +27763,26 @@ 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; + 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; @@ -26158,6 +27933,21 @@ 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; })(); @@ -26264,12 +28054,14 @@ 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; + case 1: { + message.fleetSpec = reader.string(); + break; + } + case 2: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -26368,6 +28160,21 @@ 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; })(); @@ -26535,50 +28342,57 @@ 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; + 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; } - 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; @@ -26778,6 +28592,21 @@ 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; })(); @@ -26814,7 +28643,7 @@ }; /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerConfigsService#listGameServerConfigs}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerConfigsService|listGameServerConfigs}. * @memberof google.cloud.gaming.v1beta.GameServerConfigsService * @typedef ListGameServerConfigsCallback * @type {function} @@ -26847,7 +28676,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerConfigsService#getGameServerConfig}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerConfigsService|getGameServerConfig}. * @memberof google.cloud.gaming.v1beta.GameServerConfigsService * @typedef GetGameServerConfigCallback * @type {function} @@ -26880,7 +28709,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerConfigsService#createGameServerConfig}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerConfigsService|createGameServerConfig}. * @memberof google.cloud.gaming.v1beta.GameServerConfigsService * @typedef CreateGameServerConfigCallback * @type {function} @@ -26913,7 +28742,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerConfigsService#deleteGameServerConfig}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerConfigsService|deleteGameServerConfig}. * @memberof google.cloud.gaming.v1beta.GameServerConfigsService * @typedef DeleteGameServerConfigCallback * @type {function} @@ -27084,21 +28913,26 @@ 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 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; @@ -27221,6 +29055,21 @@ 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; })(); @@ -27342,19 +29191,22 @@ 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; + 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; @@ -27491,6 +29343,21 @@ 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; })(); @@ -27586,9 +29453,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -27678,6 +29546,21 @@ 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; })(); @@ -27773,9 +29656,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -27865,6 +29749,21 @@ 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; })(); @@ -27982,15 +29881,18 @@ 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; + 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; @@ -28102,6 +30004,21 @@ 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; })(); @@ -28197,9 +30114,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -28289,6 +30207,21 @@ 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; })(); @@ -28395,12 +30328,14 @@ 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; + 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; @@ -28509,6 +30444,21 @@ 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; })(); @@ -28615,12 +30565,14 @@ 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 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; @@ -28729,6 +30681,21 @@ 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; })(); @@ -28824,9 +30791,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -28916,6 +30884,21 @@ 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; })(); @@ -29026,16 +31009,18 @@ 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; + 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; @@ -29163,6 +31148,21 @@ 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() { /** @@ -29268,14 +31268,16 @@ 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; + 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; @@ -29391,6 +31393,21 @@ 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; })(); @@ -29546,43 +31563,49 @@ 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; + 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; } - 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; @@ -29738,6 +31761,21 @@ 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; })(); @@ -29869,12 +31907,14 @@ 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; + 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; @@ -29986,6 +32026,21 @@ 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; })(); @@ -30138,26 +32193,32 @@ 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; + 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; @@ -30316,6 +32377,21 @@ 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; })(); @@ -30433,15 +32509,18 @@ 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; + 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; @@ -30563,6 +32642,21 @@ 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; })(); @@ -30682,17 +32776,20 @@ 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; + 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; @@ -30817,6 +32914,21 @@ 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; })(); @@ -30853,7 +32965,7 @@ }; /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService#listGameServerDeployments}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|listGameServerDeployments}. * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService * @typedef ListGameServerDeploymentsCallback * @type {function} @@ -30886,7 +32998,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService#getGameServerDeployment}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|getGameServerDeployment}. * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService * @typedef GetGameServerDeploymentCallback * @type {function} @@ -30919,7 +33031,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService#createGameServerDeployment}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|createGameServerDeployment}. * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService * @typedef CreateGameServerDeploymentCallback * @type {function} @@ -30952,7 +33064,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService#deleteGameServerDeployment}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|deleteGameServerDeployment}. * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService * @typedef DeleteGameServerDeploymentCallback * @type {function} @@ -30985,7 +33097,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService#updateGameServerDeployment}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|updateGameServerDeployment}. * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService * @typedef UpdateGameServerDeploymentCallback * @type {function} @@ -31018,7 +33130,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService#getGameServerDeploymentRollout}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|getGameServerDeploymentRollout}. * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService * @typedef GetGameServerDeploymentRolloutCallback * @type {function} @@ -31051,7 +33163,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService#updateGameServerDeploymentRollout}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|updateGameServerDeploymentRollout}. * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService * @typedef UpdateGameServerDeploymentRolloutCallback * @type {function} @@ -31084,7 +33196,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService#previewGameServerDeploymentRollout}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|previewGameServerDeploymentRollout}. * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService * @typedef PreviewGameServerDeploymentRolloutCallback * @type {function} @@ -31117,7 +33229,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService#fetchDeploymentState}. + * Callback as used by {@link google.cloud.gaming.v1beta.GameServerDeploymentsService|fetchDeploymentState}. * @memberof google.cloud.gaming.v1beta.GameServerDeploymentsService * @typedef FetchDeploymentStateCallback * @type {function} @@ -31288,21 +33400,26 @@ 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 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; @@ -31425,6 +33542,21 @@ 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; })(); @@ -31546,19 +33678,22 @@ 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; + 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; @@ -31695,6 +33830,21 @@ 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; })(); @@ -31790,9 +33940,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -31882,6 +34033,21 @@ 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; })(); @@ -31999,15 +34165,18 @@ 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; + 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; @@ -32119,6 +34288,21 @@ 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; })(); @@ -32214,9 +34398,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -32306,6 +34491,21 @@ 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; })(); @@ -32412,12 +34612,14 @@ 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 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; @@ -32526,6 +34728,21 @@ 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; })(); @@ -32643,15 +34860,18 @@ 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; + 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; @@ -32773,6 +34993,21 @@ 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; })(); @@ -32879,12 +35114,14 @@ 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; + 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; @@ -32988,6 +35225,21 @@ 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; })(); @@ -33151,46 +35403,53 @@ 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; + 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; } - 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; @@ -33354,6 +35613,21 @@ 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; })(); @@ -33390,7 +35664,7 @@ }; /** - * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService#listRealms}. + * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService|listRealms}. * @memberof google.cloud.gaming.v1beta.RealmsService * @typedef ListRealmsCallback * @type {function} @@ -33423,7 +35697,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService#getRealm}. + * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService|getRealm}. * @memberof google.cloud.gaming.v1beta.RealmsService * @typedef GetRealmCallback * @type {function} @@ -33456,7 +35730,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService#createRealm}. + * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService|createRealm}. * @memberof google.cloud.gaming.v1beta.RealmsService * @typedef CreateRealmCallback * @type {function} @@ -33489,7 +35763,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService#deleteRealm}. + * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService|deleteRealm}. * @memberof google.cloud.gaming.v1beta.RealmsService * @typedef DeleteRealmCallback * @type {function} @@ -33522,7 +35796,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService#updateRealm}. + * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService|updateRealm}. * @memberof google.cloud.gaming.v1beta.RealmsService * @typedef UpdateRealmCallback * @type {function} @@ -33555,7 +35829,7 @@ */ /** - * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService#previewRealmUpdate}. + * Callback as used by {@link google.cloud.gaming.v1beta.RealmsService|previewRealmUpdate}. * @memberof google.cloud.gaming.v1beta.RealmsService * @typedef PreviewRealmUpdateCallback * @type {function} @@ -33799,36 +36073,43 @@ 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) + 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()); - } else - message.style.push(reader.int32()); - break; + break; + } default: reader.skipType(tag & 7); break; @@ -34026,6 +36307,21 @@ 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 @@ -34162,12 +36458,14 @@ 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; + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -34266,6 +36564,21 @@ 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; })(); @@ -34374,14 +36687,16 @@ 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; + 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; @@ -34497,6 +36812,21 @@ 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; })(); @@ -34707,38 +37037,48 @@ 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; + 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; @@ -34960,6 +37300,21 @@ 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; })(); @@ -35066,12 +37421,14 @@ 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; + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -35170,6 +37527,21 @@ 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; })(); @@ -35279,11 +37651,12 @@ 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; + 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; @@ -35390,6 +37763,21 @@ 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; })(); @@ -35411,6 +37799,7 @@ * @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 */ /** @@ -35531,6 +37920,14 @@ */ 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 @@ -35586,6 +37983,8 @@ 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; }; @@ -35620,66 +38019,82 @@ 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) + 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()); - } 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) + 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()); - } 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; + 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; @@ -35791,6 +38206,9 @@ 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; }; @@ -35883,6 +38301,8 @@ } if (object.syntax != null) message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); return message; }; @@ -35914,6 +38334,7 @@ object.options = null; object.sourceCodeInfo = null; object.syntax = ""; + object.edition = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -35960,6 +38381,8 @@ } if (message.syntax != null && message.hasOwnProperty("syntax")) object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = message.edition; return object; }; @@ -35974,6 +38397,21 @@ 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; })(); @@ -36184,52 +38622,62 @@ 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; + 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; @@ -36530,6 +38978,21 @@ 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() { /** @@ -36644,15 +39107,18 @@ 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; + 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; @@ -36764,6 +39230,21 @@ 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; })(); @@ -36870,12 +39351,14 @@ 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 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -36974,6 +39457,21 @@ 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; })(); @@ -37074,11 +39572,12 @@ 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; + 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; @@ -37185,6 +39684,21 @@ 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; })(); @@ -37390,39 +39904,50 @@ 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; + 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; @@ -37709,6 +40234,21 @@ 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 @@ -37877,12 +40417,14 @@ 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; + 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; @@ -37986,6 +40528,21 @@ 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; })(); @@ -38131,27 +40688,32 @@ 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; + 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; @@ -38327,6 +40889,21 @@ 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() { /** @@ -38430,12 +41007,14 @@ 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 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -38534,6 +41113,21 @@ 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; })(); @@ -38654,15 +41248,18 @@ 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; + 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; @@ -38774,6 +41371,21 @@ 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; })(); @@ -38893,17 +41505,20 @@ 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; + 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; @@ -39033,6 +41648,21 @@ 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; })(); @@ -39183,24 +41813,30 @@ 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; + 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; @@ -39336,6 +41972,21 @@ 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; })(); @@ -39666,76 +42317,98 @@ 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; + 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; @@ -40048,6 +42721,21 @@ 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 @@ -40216,26 +42904,32 @@ 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; + 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; @@ -40389,6 +43083,21 @@ 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; })(); @@ -40402,6 +43111,7 @@ * @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 @@ -40458,6 +43168,14 @@ */ FieldOptions.prototype.lazy = false; + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + /** * FieldOptions deprecated. * @member {boolean} deprecated @@ -40534,6 +43252,8 @@ 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(); @@ -40579,42 +43299,55 @@ 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 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) + 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()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - case 1055: - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -40674,6 +43407,9 @@ 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"; @@ -40759,6 +43495,8 @@ } 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) @@ -40846,6 +43584,7 @@ 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")) @@ -40860,6 +43599,8 @@ object.jstype = options.enums === String ? $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) @@ -40886,6 +43627,21 @@ 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 @@ -41015,11 +43771,12 @@ 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; + 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; @@ -41126,6 +43883,21 @@ 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; })(); @@ -41245,17 +44017,20 @@ 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; + 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; @@ -41380,6 +44155,21 @@ 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; })(); @@ -41488,14 +44278,16 @@ 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; + 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; @@ -41611,6 +44403,21 @@ 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; })(); @@ -41741,20 +44548,24 @@ 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; + 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; @@ -41887,6 +44698,21 @@ 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; })(); @@ -42041,28 +44867,34 @@ 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; + 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; @@ -42252,6 +45084,21 @@ 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 @@ -42431,29 +45278,36 @@ 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; + 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; @@ -42566,7 +45420,7 @@ 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) + else if (object.stringValue.length >= 0) message.stringValue = object.stringValue; if (object.aggregateValue != null) message.aggregateValue = String(object.aggregateValue); @@ -42647,6 +45501,21 @@ 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() { /** @@ -42748,12 +45617,14 @@ 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; + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -42854,6 +45725,21 @@ 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; })(); @@ -42954,11 +45840,12 @@ 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; + 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; @@ -43065,6 +45952,21 @@ 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() { /** @@ -43213,37 +46115,42 @@ 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) + 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()); - } 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) + 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()); - } 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; + 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; @@ -43404,6 +46311,21 @@ 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; })(); @@ -43504,11 +46426,12 @@ 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; + 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; @@ -43615,6 +46538,21 @@ 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() { /** @@ -43625,6 +46563,7 @@ * @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 */ /** @@ -43675,6 +46614,14 @@ */ 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 @@ -43711,6 +46658,8 @@ 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; }; @@ -43745,25 +46694,33 @@ 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) + 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()); - } 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; + 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; @@ -43815,6 +46772,15 @@ 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; }; @@ -43843,6 +46809,20 @@ message.begin = object.begin | 0; if (object.end != null) message.end = object.end | 0; + switch (object.semantic) { + 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; }; @@ -43865,6 +46845,7 @@ object.sourceFile = ""; object.begin = 0; object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; } if (message.path && message.path.length) { object.path = []; @@ -43877,6 +46858,8 @@ 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] : message.semantic; return object; }; @@ -43891,6 +46874,37 @@ 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; })(); @@ -44000,12 +47014,14 @@ 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; + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -44118,6 +47134,21 @@ 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; })(); @@ -44224,12 +47255,14 @@ 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; + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -44342,6 +47375,21 @@ 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; })(); @@ -44439,11 +47487,12 @@ 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; + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -44545,6 +47594,21 @@ 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; })(); @@ -44651,12 +47715,14 @@ 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; + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -44718,7 +47784,7 @@ 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) + else if (object.value.length >= 0) message.value = object.value; return message; }; @@ -44764,6 +47830,21 @@ 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; })(); @@ -44924,6 +48005,21 @@ 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; })(); @@ -44972,7 +48068,7 @@ }; /** - * Callback as used by {@link google.longrunning.Operations#listOperations}. + * Callback as used by {@link google.longrunning.Operations|listOperations}. * @memberof google.longrunning.Operations * @typedef ListOperationsCallback * @type {function} @@ -45005,7 +48101,7 @@ */ /** - * Callback as used by {@link google.longrunning.Operations#getOperation}. + * Callback as used by {@link google.longrunning.Operations|getOperation}. * @memberof google.longrunning.Operations * @typedef GetOperationCallback * @type {function} @@ -45038,7 +48134,7 @@ */ /** - * Callback as used by {@link google.longrunning.Operations#deleteOperation}. + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. * @memberof google.longrunning.Operations * @typedef DeleteOperationCallback * @type {function} @@ -45071,7 +48167,7 @@ */ /** - * Callback as used by {@link google.longrunning.Operations#cancelOperation}. + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. * @memberof google.longrunning.Operations * @typedef CancelOperationCallback * @type {function} @@ -45104,7 +48200,7 @@ */ /** - * Callback as used by {@link google.longrunning.Operations#waitOperation}. + * Callback as used by {@link google.longrunning.Operations|waitOperation}. * @memberof google.longrunning.Operations * @typedef WaitOperationCallback * @type {function} @@ -45289,21 +48385,26 @@ 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; + 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; @@ -45454,6 +48555,21 @@ 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; })(); @@ -45549,9 +48665,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -45641,6 +48758,21 @@ 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; })(); @@ -45769,18 +48901,22 @@ 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; + 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; @@ -45895,6 +49031,21 @@ 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; })(); @@ -46003,14 +49154,16 @@ 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; + 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; @@ -46126,6 +49279,21 @@ 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; })(); @@ -46221,9 +49389,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -46313,6 +49482,21 @@ 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; })(); @@ -46408,9 +49592,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -46500,6 +49685,21 @@ 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; })(); @@ -46606,12 +49806,14 @@ 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; + 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; @@ -46715,6 +49917,21 @@ 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; })(); @@ -46821,12 +50038,14 @@ 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; + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -46925,6 +50144,21 @@ 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; })(); @@ -47056,17 +50290,20 @@ 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; + 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; @@ -47191,6 +50428,21 @@ 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; })(); diff --git a/packages/google-cloud-gaming/protos/protos.json b/packages/google-cloud-gaming/protos/protos.json index 1f0bc0af631..2fae5e07879 100644 --- a/packages/google-cloud-gaming/protos/protos.json +++ b/packages/google-cloud-gaming/protos/protos.json @@ -4336,6 +4336,10 @@ "syntax": { "type": "string", "id": 12 + }, + "edition": { + "type": "string", + "id": 13 } } }, @@ -4864,6 +4868,13 @@ "default": false } }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, "deprecated": { "type": "bool", "id": 3, @@ -5156,6 +5167,19 @@ "end": { "type": "int32", "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } } } } From a6361ced29311376619cb2ee5c88820dd5892622 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 27 Aug 2022 05:02:20 +0000 Subject: [PATCH 164/180] fix: do not import the whole google-gax from proto JS (#1553) (#309) fix: use google-gax v3.3.0 Source-Link: https://github.com/googleapis/synthtool/commit/c73d112a11a1f1a93efa67c50495c19aa3a88910 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:b15a6f06cc06dcffa11e1bebdf1a74b6775a134aac24a0f86f51ddf728eb373e --- packages/google-cloud-gaming/package.json | 2 +- packages/google-cloud-gaming/protos/protos.d.ts | 2 +- packages/google-cloud-gaming/protos/protos.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 993a24c6f8d..2e73757cc1d 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -27,7 +27,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^3.0.1" + "google-gax": "^3.3.0" }, "devDependencies": { "@types/mocha": "^9.0.0", diff --git a/packages/google-cloud-gaming/protos/protos.d.ts b/packages/google-cloud-gaming/protos/protos.d.ts index b61ac2bef7c..1f7ea36b8c9 100644 --- a/packages/google-cloud-gaming/protos/protos.d.ts +++ b/packages/google-cloud-gaming/protos/protos.d.ts @@ -13,7 +13,7 @@ // limitations under the License. import Long = require("long"); -import {protobuf as $protobuf} from "google-gax"; +import type {protobuf as $protobuf} from "google-gax"; /** Namespace google. */ export namespace google { diff --git a/packages/google-cloud-gaming/protos/protos.js b/packages/google-cloud-gaming/protos/protos.js index 147c27f32bd..5c7512d2135 100644 --- a/packages/google-cloud-gaming/protos/protos.js +++ b/packages/google-cloud-gaming/protos/protos.js @@ -19,7 +19,7 @@ define(["protobufjs/minimal"], factory); /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("google-gax").protobufMinimal); + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); })(this, function($protobuf) { "use strict"; From 40676667d135c45ba02483e86b7767378bfaa3d7 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 1 Sep 2022 20:40:12 +0000 Subject: [PATCH 165/180] fix: allow passing gax instance to client constructor (#310) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 470911839 Source-Link: https://github.com/googleapis/googleapis/commit/352756699ebc5b2144c252867c265ea44448712e Source-Link: https://github.com/googleapis/googleapis-gen/commit/f16a1d224f00a630ea43d6a9a1a31f566f45cdea Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjE2YTFkMjI0ZjAwYTYzMGVhNDNkNmE5YTFhMzFmNTY2ZjQ1Y2RlYSJ9 feat: accept google-gax instance as a parameter Please see the documentation of the client constructor for details. PiperOrigin-RevId: 470332808 Source-Link: https://github.com/googleapis/googleapis/commit/d4a23675457cd8f0b44080e0594ec72de1291b89 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e97a1ac204ead4fe7341f91e72db7c6ac6016341 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTk3YTFhYzIwNGVhZDRmZTczNDFmOTFlNzJkYjdjNmFjNjAxNjM0MSJ9 --- .../v1/game_server_clusters_service_client.ts | 74 +++++++++------- .../v1/game_server_configs_service_client.ts | 57 ++++++++----- .../game_server_deployments_service_client.ts | 85 +++++++++++-------- .../src/v1/realms_service_client.ts | 70 +++++++++------ .../game_server_clusters_service_client.ts | 74 +++++++++------- .../game_server_configs_service_client.ts | 57 ++++++++----- .../game_server_deployments_service_client.ts | 85 +++++++++++-------- .../src/v1beta/realms_service_client.ts | 70 +++++++++------ 8 files changed, 350 insertions(+), 222 deletions(-) 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 index 598cbd8b149..5ea57e30cfb 100644 --- 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 @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -28,7 +28,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -38,7 +37,6 @@ import jsonProtos = require('../../protos/protos.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'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -100,8 +98,18 @@ export class GameServerClustersServiceClient { * 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) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this .constructor as typeof GameServerClustersServiceClient; @@ -122,8 +130,13 @@ export class GameServerClustersServiceClient { 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 ? gax.fallback : 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); @@ -313,7 +326,7 @@ export class GameServerClustersServiceClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -537,7 +550,7 @@ export class GameServerClustersServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -645,7 +658,7 @@ export class GameServerClustersServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -749,7 +762,7 @@ export class GameServerClustersServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -857,7 +870,7 @@ export class GameServerClustersServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'game_server_cluster.name': request.gameServerCluster!.name || '', }); this.initialize(); @@ -970,7 +983,7 @@ export class GameServerClustersServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1000,11 +1013,12 @@ export class GameServerClustersServiceClient { protos.google.cloud.gaming.v1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.createGameServerCluster, this._gaxModule.createDefaultBackoffSettings() @@ -1112,7 +1126,7 @@ export class GameServerClustersServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1142,11 +1156,12 @@ export class GameServerClustersServiceClient { protos.google.cloud.gaming.v1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.deleteGameServerCluster, this._gaxModule.createDefaultBackoffSettings() @@ -1258,7 +1273,7 @@ export class GameServerClustersServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'game_server_cluster.name': request.gameServerCluster!.name || '', }); this.initialize(); @@ -1288,11 +1303,12 @@ export class GameServerClustersServiceClient { protos.google.cloud.gaming.v1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.updateGameServerCluster, this._gaxModule.createDefaultBackoffSettings() @@ -1411,7 +1427,7 @@ export class GameServerClustersServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1470,7 +1486,7 @@ export class GameServerClustersServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listGameServerClusters']; @@ -1534,7 +1550,7 @@ export class GameServerClustersServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listGameServerClusters']; 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 index eac3be4778a..583235cd063 100644 --- 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 @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -28,7 +28,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -38,7 +37,6 @@ import jsonProtos = require('../../protos/protos.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'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -99,8 +97,18 @@ export class GameServerConfigsServiceClient { * 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) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this .constructor as typeof GameServerConfigsServiceClient; @@ -121,8 +129,13 @@ export class GameServerConfigsServiceClient { 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 ? gax.fallback : 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); @@ -297,7 +310,7 @@ export class GameServerConfigsServiceClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -509,7 +522,7 @@ export class GameServerConfigsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -620,7 +633,7 @@ export class GameServerConfigsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -650,11 +663,12 @@ export class GameServerConfigsServiceClient { protos.google.cloud.gaming.v1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.createGameServerConfig, this._gaxModule.createDefaultBackoffSettings() @@ -763,7 +777,7 @@ export class GameServerConfigsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -793,11 +807,12 @@ export class GameServerConfigsServiceClient { protos.google.cloud.gaming.v1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.deleteGameServerConfig, this._gaxModule.createDefaultBackoffSettings() @@ -910,7 +925,7 @@ export class GameServerConfigsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -958,7 +973,7 @@ export class GameServerConfigsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listGameServerConfigs']; @@ -1015,7 +1030,7 @@ export class GameServerConfigsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listGameServerConfigs']; 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 index bcdf3183f4a..fb4fdcceb29 100644 --- 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 @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -28,7 +28,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -38,7 +37,6 @@ import jsonProtos = require('../../protos/protos.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'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -100,8 +98,18 @@ export class GameServerDeploymentsServiceClient { * 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) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this .constructor as typeof GameServerDeploymentsServiceClient; @@ -122,8 +130,13 @@ export class GameServerDeploymentsServiceClient { 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 ? gax.fallback : 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); @@ -329,7 +342,7 @@ export class GameServerDeploymentsServiceClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -547,7 +560,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -649,7 +662,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -759,7 +772,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'rollout.name': request.rollout!.name || '', }); this.initialize(); @@ -857,7 +870,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -966,7 +979,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -996,11 +1009,12 @@ export class GameServerDeploymentsServiceClient { protos.google.cloud.gaming.v1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.createGameServerDeployment, this._gaxModule.createDefaultBackoffSettings() @@ -1108,7 +1122,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1138,11 +1152,12 @@ export class GameServerDeploymentsServiceClient { protos.google.cloud.gaming.v1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.deleteGameServerDeployment, this._gaxModule.createDefaultBackoffSettings() @@ -1254,7 +1269,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'game_server_deployment.name': request.gameServerDeployment!.name || '', }); this.initialize(); @@ -1284,11 +1299,12 @@ export class GameServerDeploymentsServiceClient { protos.google.cloud.gaming.v1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.updateGameServerDeployment, this._gaxModule.createDefaultBackoffSettings() @@ -1405,7 +1421,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'rollout.name': request.rollout!.name || '', }); this.initialize(); @@ -1435,11 +1451,12 @@ export class GameServerDeploymentsServiceClient { protos.google.cloud.gaming.v1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.updateGameServerDeploymentRollout, this._gaxModule.createDefaultBackoffSettings() @@ -1552,7 +1569,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1605,7 +1622,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listGameServerDeployments']; @@ -1663,7 +1680,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listGameServerDeployments']; diff --git a/packages/google-cloud-gaming/src/v1/realms_service_client.ts b/packages/google-cloud-gaming/src/v1/realms_service_client.ts index a263aab3ab2..0cba42550e8 100644 --- a/packages/google-cloud-gaming/src/v1/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1/realms_service_client.ts @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -28,7 +28,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -38,7 +37,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './realms_service_client_config.json'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -100,8 +98,18 @@ export class RealmsServiceClient { * 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) { + 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 = @@ -121,8 +129,13 @@ export class RealmsServiceClient { 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 ? gax.fallback : 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); @@ -300,7 +313,7 @@ export class RealmsServiceClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -506,7 +519,7 @@ export class RealmsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -604,7 +617,7 @@ export class RealmsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'realm.name': request.realm!.name || '', }); this.initialize(); @@ -713,7 +726,7 @@ export class RealmsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -739,11 +752,12 @@ export class RealmsServiceClient { protos.google.cloud.gaming.v1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.createRealm, this._gaxModule.createDefaultBackoffSettings() @@ -851,7 +865,7 @@ export class RealmsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -877,11 +891,12 @@ export class RealmsServiceClient { protos.google.cloud.gaming.v1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.deleteRealm, this._gaxModule.createDefaultBackoffSettings() @@ -993,7 +1008,7 @@ export class RealmsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'realm.name': request.realm!.name || '', }); this.initialize(); @@ -1019,11 +1034,12 @@ export class RealmsServiceClient { protos.google.cloud.gaming.v1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.updateRealm, this._gaxModule.createDefaultBackoffSettings() @@ -1128,7 +1144,7 @@ export class RealmsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1177,7 +1193,7 @@ export class RealmsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listRealms']; @@ -1235,7 +1251,7 @@ export class RealmsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listRealms']; 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 index 51f51a727b3..963c76f6f3a 100644 --- 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 @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -28,7 +28,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -38,7 +37,6 @@ import jsonProtos = require('../../protos/protos.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'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -100,8 +98,18 @@ export class GameServerClustersServiceClient { * 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) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this .constructor as typeof GameServerClustersServiceClient; @@ -122,8 +130,13 @@ export class GameServerClustersServiceClient { 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 ? gax.fallback : 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); @@ -291,7 +304,7 @@ export class GameServerClustersServiceClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -515,7 +528,7 @@ export class GameServerClustersServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -620,7 +633,7 @@ export class GameServerClustersServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -724,7 +737,7 @@ export class GameServerClustersServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -835,7 +848,7 @@ export class GameServerClustersServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'game_server_cluster.name': request.gameServerCluster!.name || '', }); this.initialize(); @@ -948,7 +961,7 @@ export class GameServerClustersServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -978,11 +991,12 @@ export class GameServerClustersServiceClient { protos.google.cloud.gaming.v1beta.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.createGameServerCluster, this._gaxModule.createDefaultBackoffSettings() @@ -1090,7 +1104,7 @@ export class GameServerClustersServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1120,11 +1134,12 @@ export class GameServerClustersServiceClient { protos.google.cloud.gaming.v1beta.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.deleteGameServerCluster, this._gaxModule.createDefaultBackoffSettings() @@ -1239,7 +1254,7 @@ export class GameServerClustersServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'game_server_cluster.name': request.gameServerCluster!.name || '', }); this.initialize(); @@ -1269,11 +1284,12 @@ export class GameServerClustersServiceClient { protos.google.cloud.gaming.v1beta.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.updateGameServerCluster, this._gaxModule.createDefaultBackoffSettings() @@ -1386,7 +1402,7 @@ export class GameServerClustersServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1439,7 +1455,7 @@ export class GameServerClustersServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listGameServerClusters']; @@ -1497,7 +1513,7 @@ export class GameServerClustersServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listGameServerClusters']; 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 index 2b4ee42a85b..58347403f5c 100644 --- 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 @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -28,7 +28,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -38,7 +37,6 @@ import jsonProtos = require('../../protos/protos.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'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -99,8 +97,18 @@ export class GameServerConfigsServiceClient { * 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) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this .constructor as typeof GameServerConfigsServiceClient; @@ -121,8 +129,13 @@ export class GameServerConfigsServiceClient { 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 ? gax.fallback : 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); @@ -275,7 +288,7 @@ export class GameServerConfigsServiceClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -489,7 +502,7 @@ export class GameServerConfigsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -601,7 +614,7 @@ export class GameServerConfigsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -631,11 +644,12 @@ export class GameServerConfigsServiceClient { protos.google.cloud.gaming.v1beta.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.createGameServerConfig, this._gaxModule.createDefaultBackoffSettings() @@ -745,7 +759,7 @@ export class GameServerConfigsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -775,11 +789,12 @@ export class GameServerConfigsServiceClient { protos.google.cloud.gaming.v1beta.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.deleteGameServerConfig, this._gaxModule.createDefaultBackoffSettings() @@ -894,7 +909,7 @@ export class GameServerConfigsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -944,7 +959,7 @@ export class GameServerConfigsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listGameServerConfigs']; @@ -1003,7 +1018,7 @@ export class GameServerConfigsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listGameServerConfigs']; 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 index 665ff5a39a1..d1760143195 100644 --- 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 @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -28,7 +28,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -38,7 +37,6 @@ import jsonProtos = require('../../protos/protos.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'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -100,8 +98,18 @@ export class GameServerDeploymentsServiceClient { * 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) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this .constructor as typeof GameServerDeploymentsServiceClient; @@ -122,8 +130,13 @@ export class GameServerDeploymentsServiceClient { 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 ? gax.fallback : 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); @@ -307,7 +320,7 @@ export class GameServerDeploymentsServiceClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -533,7 +546,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -637,7 +650,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -750,7 +763,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'rollout.name': request.rollout!.name || '', }); this.initialize(); @@ -855,7 +868,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -964,7 +977,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -994,11 +1007,12 @@ export class GameServerDeploymentsServiceClient { protos.google.cloud.gaming.v1beta.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.createGameServerDeployment, this._gaxModule.createDefaultBackoffSettings() @@ -1107,7 +1121,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1137,11 +1151,12 @@ export class GameServerDeploymentsServiceClient { protos.google.cloud.gaming.v1beta.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.deleteGameServerDeployment, this._gaxModule.createDefaultBackoffSettings() @@ -1256,7 +1271,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'game_server_deployment.name': request.gameServerDeployment!.name || '', }); this.initialize(); @@ -1286,11 +1301,12 @@ export class GameServerDeploymentsServiceClient { protos.google.cloud.gaming.v1beta.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.updateGameServerDeployment, this._gaxModule.createDefaultBackoffSettings() @@ -1410,7 +1426,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'rollout.name': request.rollout!.name || '', }); this.initialize(); @@ -1440,11 +1456,12 @@ export class GameServerDeploymentsServiceClient { protos.google.cloud.gaming.v1beta.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.updateGameServerDeploymentRollout, this._gaxModule.createDefaultBackoffSettings() @@ -1557,7 +1574,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1610,7 +1627,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listGameServerDeployments']; @@ -1668,7 +1685,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listGameServerDeployments']; diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index 2f8cc63ba28..c6b8677f615 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -28,7 +28,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -38,7 +37,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './realms_service_client_config.json'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -100,8 +98,18 @@ export class RealmsServiceClient { * 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) { + 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 = @@ -121,8 +129,13 @@ export class RealmsServiceClient { 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 ? gax.fallback : 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); @@ -278,7 +291,7 @@ export class RealmsServiceClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -484,7 +497,7 @@ export class RealmsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -585,7 +598,7 @@ export class RealmsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'realm.name': request.realm!.name || '', }); this.initialize(); @@ -694,7 +707,7 @@ export class RealmsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -720,11 +733,12 @@ export class RealmsServiceClient { protos.google.cloud.gaming.v1beta.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.createRealm, this._gaxModule.createDefaultBackoffSettings() @@ -832,7 +846,7 @@ export class RealmsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -858,11 +872,12 @@ export class RealmsServiceClient { protos.google.cloud.gaming.v1beta.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.deleteRealm, this._gaxModule.createDefaultBackoffSettings() @@ -977,7 +992,7 @@ export class RealmsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'realm.name': request.realm!.name || '', }); this.initialize(); @@ -1003,11 +1018,12 @@ export class RealmsServiceClient { protos.google.cloud.gaming.v1beta.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.updateRealm, this._gaxModule.createDefaultBackoffSettings() @@ -1114,7 +1130,7 @@ export class RealmsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1163,7 +1179,7 @@ export class RealmsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listRealms']; @@ -1221,7 +1237,7 @@ export class RealmsServiceClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listRealms']; From ae10866eb5d8212f41eacb6cbc085d3f60085e0c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 7 Sep 2022 17:55:06 -0400 Subject: [PATCH 166/180] chore(main): release 3.1.1 (#307) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 3.1.1 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-gaming/CHANGELOG.md | 11 +++++++++++ packages/google-cloud-gaming/package.json | 2 +- .../v1/snippet_metadata.google.cloud.gaming.v1.json | 2 +- .../snippet_metadata.google.cloud.gaming.v1beta.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index 4f160269634..d8e2606e895 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 2e73757cc1d..5fbb4d65a57 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "3.1.0", + "version": "3.1.1", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", 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 index 7ea1b6a86ed..7addbe0592d 100644 --- 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 @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gaming", - "version": "3.1.0", + "version": "3.1.1", "language": "TYPESCRIPT", "apis": [ { 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 index 1fba6b48d5a..1855a58d180 100644 --- 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 @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gaming", - "version": "3.1.0", + "version": "3.1.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index 1a9843e3a47..43808d1bbe1 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^3.1.0" + "@google-cloud/game-servers": "^3.1.1" }, "devDependencies": { "c8": "^7.2.1", From 1fa9125c4a28f1537a8156ec6f1dba3825d63813 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 9 Sep 2022 01:26:20 +0200 Subject: [PATCH 167/180] chore(deps): update dependency uuid to v9 (#312) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [uuid](https://togithub.com/uuidjs/uuid) | [`^8.0.0` -> `^9.0.0`](https://renovatebot.com/diffs/npm/uuid/8.3.2/9.0.0) | [![age](https://badges.renovateapi.com/packages/npm/uuid/9.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/uuid/9.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/uuid/9.0.0/compatibility-slim/8.3.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/uuid/9.0.0/confidence-slim/8.3.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
uuidjs/uuid ### [`v9.0.0`](https://togithub.com/uuidjs/uuid/blob/HEAD/CHANGELOG.md#​900-httpsgithubcomuuidjsuuidcomparev832v900-2022-09-05) [Compare Source](https://togithub.com/uuidjs/uuid/compare/v8.3.2...v9.0.0) ##### ⚠ BREAKING CHANGES - Drop Node.js 10.x support. This library always aims at supporting one EOLed LTS release which by this time now is 12.x which has reached EOL 30 Apr 2022. - Remove the minified UMD build from the package. Minified code is hard to audit and since this is a widely used library it seems more appropriate nowadays to optimize for auditability than to ship a legacy module format that, at best, serves educational purposes nowadays. For production browser use cases, users should be using a bundler. For educational purposes, today's online sandboxes like replit.com offer convenient ways to load npm modules, so the use case for UMD through repos like UNPKG or jsDelivr has largely vanished. - Drop IE 11 and Safari 10 support. Drop support for browsers that don't correctly implement const/let and default arguments, and no longer transpile the browser build to ES2015. This also removes the fallback on msCrypto instead of the crypto API. Browser tests are run in the first supported version of each supported browser and in the latest (as of this commit) version available on Browserstack. ##### Features - optimize uuid.v1 by 1.3x uuid.v4 by 4.3x (430%) ([#​597](https://togithub.com/uuidjs/uuid/issues/597)) ([3a033f6](https://togithub.com/uuidjs/uuid/commit/3a033f6bab6bb3780ece6d645b902548043280bc)) - remove UMD build ([#​645](https://togithub.com/uuidjs/uuid/issues/645)) ([e948a0f](https://togithub.com/uuidjs/uuid/commit/e948a0f22bf22f4619b27bd913885e478e20fe6f)), closes [#​620](https://togithub.com/uuidjs/uuid/issues/620) - use native crypto.randomUUID when available ([#​600](https://togithub.com/uuidjs/uuid/issues/600)) ([c9e076c](https://togithub.com/uuidjs/uuid/commit/c9e076c852edad7e9a06baaa1d148cf4eda6c6c4)) ##### Bug Fixes - add Jest/jsdom compatibility ([#​642](https://togithub.com/uuidjs/uuid/issues/642)) ([16f9c46](https://togithub.com/uuidjs/uuid/commit/16f9c469edf46f0786164cdf4dc980743984a6fd)) - change default export to named function ([#​545](https://togithub.com/uuidjs/uuid/issues/545)) ([c57bc5a](https://togithub.com/uuidjs/uuid/commit/c57bc5a9a0653273aa639cda9177ce52efabe42a)) - handle error when parameter is not set in v3 and v5 ([#​622](https://togithub.com/uuidjs/uuid/issues/622)) ([fcd7388](https://togithub.com/uuidjs/uuid/commit/fcd73881692d9fabb63872576ba28e30ff852091)) - run npm audit fix ([#​644](https://togithub.com/uuidjs/uuid/issues/644)) ([04686f5](https://togithub.com/uuidjs/uuid/commit/04686f54c5fed2cfffc1b619f4970c4bb8532353)) - upgrading from uuid3 broken link ([#​568](https://togithub.com/uuidjs/uuid/issues/568)) ([1c849da](https://togithub.com/uuidjs/uuid/commit/1c849da6e164259e72e18636726345b13a7eddd6)) ##### build - drop Node.js 8.x from babel transpile target ([#​603](https://togithub.com/uuidjs/uuid/issues/603)) ([aa11485](https://togithub.com/uuidjs/uuid/commit/aa114858260402107ec8a1e1a825dea0a259bcb5)) - drop support for legacy browsers (IE11, Safari 10) ([#​604](https://togithub.com/uuidjs/uuid/issues/604)) ([0f433e5](https://togithub.com/uuidjs/uuid/commit/0f433e5ec444edacd53016de67db021102f36148)) - drop node 10.x to upgrade dev dependencies ([#​653](https://togithub.com/uuidjs/uuid/issues/653)) ([28a5712](https://togithub.com/uuidjs/uuid/commit/28a571283f8abda6b9d85e689f95b7d3ee9e282e)), closes [#​643](https://togithub.com/uuidjs/uuid/issues/643) ##### [8.3.2](https://togithub.com/uuidjs/uuid/compare/v8.3.1...v8.3.2) (2020-12-08) ##### Bug Fixes - lazy load getRandomValues ([#​537](https://togithub.com/uuidjs/uuid/issues/537)) ([16c8f6d](https://togithub.com/uuidjs/uuid/commit/16c8f6df2f6b09b4d6235602d6a591188320a82e)), closes [#​536](https://togithub.com/uuidjs/uuid/issues/536) ##### [8.3.1](https://togithub.com/uuidjs/uuid/compare/v8.3.0...v8.3.1) (2020-10-04) ##### Bug Fixes - support expo>=39.0.0 ([#​515](https://togithub.com/uuidjs/uuid/issues/515)) ([c65a0f3](https://togithub.com/uuidjs/uuid/commit/c65a0f3fa73b901959d638d1e3591dfacdbed867)), closes [#​375](https://togithub.com/uuidjs/uuid/issues/375)
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index 43808d1bbe1..05753712824 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -19,6 +19,6 @@ "c8": "^7.2.1", "chai": "^4.2.0", "mocha": "^8.0.0", - "uuid": "^8.0.0" + "uuid": "^9.0.0" } } From 15e32f9f49f08b220f3b84c1b110df6e580da06f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 14 Sep 2022 22:30:36 +0000 Subject: [PATCH 168/180] fix: preserve default values in x-goog-request-params header (#313) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 474338479 Source-Link: https://github.com/googleapis/googleapis/commit/d5d35e0353b59719e8917103b1bc7df2782bf6ba Source-Link: https://github.com/googleapis/googleapis-gen/commit/efcd3f93962a103f68f003e2a1eecde6fa216a27 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWZjZDNmOTM5NjJhMTAzZjY4ZjAwM2UyYTFlZWNkZTZmYTIxNmEyNyJ9 --- .../v1/game_server_clusters_service_client.ts | 20 +- .../v1/game_server_configs_service_client.ts | 12 +- .../game_server_deployments_service_client.ts | 22 +- .../src/v1/realms_service_client.ts | 16 +- .../game_server_clusters_service_client.ts | 20 +- .../game_server_configs_service_client.ts | 12 +- .../game_server_deployments_service_client.ts | 22 +- .../src/v1beta/realms_service_client.ts | 16 +- .../gapic_game_server_clusters_service_v1.ts | 875 +++++++-------- ...pic_game_server_clusters_service_v1beta.ts | 875 +++++++-------- .../gapic_game_server_configs_service_v1.ts | 477 +++++---- ...apic_game_server_configs_service_v1beta.ts | 477 +++++---- ...apic_game_server_deployments_service_v1.ts | 995 +++++++++--------- ..._game_server_deployments_service_v1beta.ts | 995 +++++++++--------- .../test/gapic_realms_service_v1.ts | 672 ++++++------ .../test/gapic_realms_service_v1beta.ts | 672 ++++++------ 16 files changed, 3250 insertions(+), 2928 deletions(-) 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 index 5ea57e30cfb..cafff0368fa 100644 --- 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 @@ -551,7 +551,7 @@ export class GameServerClustersServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getGameServerCluster(request, options, callback); @@ -659,7 +659,7 @@ export class GameServerClustersServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.previewCreateGameServerCluster( @@ -763,7 +763,7 @@ export class GameServerClustersServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.previewDeleteGameServerCluster( @@ -871,7 +871,7 @@ export class GameServerClustersServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'game_server_cluster.name': request.gameServerCluster!.name || '', + 'game_server_cluster.name': request.gameServerCluster!.name ?? '', }); this.initialize(); return this.innerApiCalls.previewUpdateGameServerCluster( @@ -984,7 +984,7 @@ export class GameServerClustersServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createGameServerCluster( @@ -1127,7 +1127,7 @@ export class GameServerClustersServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteGameServerCluster( @@ -1274,7 +1274,7 @@ export class GameServerClustersServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'game_server_cluster.name': request.gameServerCluster!.name || '', + 'game_server_cluster.name': request.gameServerCluster!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateGameServerCluster( @@ -1428,7 +1428,7 @@ export class GameServerClustersServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listGameServerClusters( @@ -1487,7 +1487,7 @@ export class GameServerClustersServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listGameServerClusters']; const callSettings = defaultCallSettings.merge(options); @@ -1551,7 +1551,7 @@ export class GameServerClustersServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listGameServerClusters']; const callSettings = defaultCallSettings.merge(options); 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 index 583235cd063..e2e1993fd11 100644 --- 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 @@ -523,7 +523,7 @@ export class GameServerConfigsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getGameServerConfig(request, options, callback); @@ -634,7 +634,7 @@ export class GameServerConfigsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createGameServerConfig( @@ -778,7 +778,7 @@ export class GameServerConfigsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteGameServerConfig( @@ -926,7 +926,7 @@ export class GameServerConfigsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listGameServerConfigs(request, options, callback); @@ -974,7 +974,7 @@ export class GameServerConfigsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listGameServerConfigs']; const callSettings = defaultCallSettings.merge(options); @@ -1031,7 +1031,7 @@ export class GameServerConfigsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listGameServerConfigs']; const callSettings = defaultCallSettings.merge(options); 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 index fb4fdcceb29..2771132e87b 100644 --- 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 @@ -561,7 +561,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getGameServerDeployment( @@ -663,7 +663,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getGameServerDeploymentRollout( @@ -773,7 +773,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'rollout.name': request.rollout!.name || '', + 'rollout.name': request.rollout!.name ?? '', }); this.initialize(); return this.innerApiCalls.previewGameServerDeploymentRollout( @@ -871,7 +871,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.fetchDeploymentState(request, options, callback); @@ -980,7 +980,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createGameServerDeployment( @@ -1123,7 +1123,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteGameServerDeployment( @@ -1270,7 +1270,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'game_server_deployment.name': request.gameServerDeployment!.name || '', + 'game_server_deployment.name': request.gameServerDeployment!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateGameServerDeployment( @@ -1422,7 +1422,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'rollout.name': request.rollout!.name || '', + 'rollout.name': request.rollout!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateGameServerDeploymentRollout( @@ -1570,7 +1570,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listGameServerDeployments( @@ -1623,7 +1623,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listGameServerDeployments']; const callSettings = defaultCallSettings.merge(options); @@ -1681,7 +1681,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listGameServerDeployments']; const callSettings = defaultCallSettings.merge(options); diff --git a/packages/google-cloud-gaming/src/v1/realms_service_client.ts b/packages/google-cloud-gaming/src/v1/realms_service_client.ts index 0cba42550e8..7919c982d81 100644 --- a/packages/google-cloud-gaming/src/v1/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1/realms_service_client.ts @@ -520,7 +520,7 @@ export class RealmsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getRealm(request, options, callback); @@ -618,7 +618,7 @@ export class RealmsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'realm.name': request.realm!.name || '', + 'realm.name': request.realm!.name ?? '', }); this.initialize(); return this.innerApiCalls.previewRealmUpdate(request, options, callback); @@ -727,7 +727,7 @@ export class RealmsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createRealm(request, options, callback); @@ -866,7 +866,7 @@ export class RealmsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteRealm(request, options, callback); @@ -1009,7 +1009,7 @@ export class RealmsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'realm.name': request.realm!.name || '', + 'realm.name': request.realm!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateRealm(request, options, callback); @@ -1145,7 +1145,7 @@ export class RealmsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listRealms(request, options, callback); @@ -1194,7 +1194,7 @@ export class RealmsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listRealms']; const callSettings = defaultCallSettings.merge(options); @@ -1252,7 +1252,7 @@ export class RealmsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listRealms']; const callSettings = defaultCallSettings.merge(options); 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 index 963c76f6f3a..c34886ce6bf 100644 --- 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 @@ -529,7 +529,7 @@ export class GameServerClustersServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getGameServerCluster(request, options, callback); @@ -634,7 +634,7 @@ export class GameServerClustersServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.previewCreateGameServerCluster( @@ -738,7 +738,7 @@ export class GameServerClustersServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.previewDeleteGameServerCluster( @@ -849,7 +849,7 @@ export class GameServerClustersServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'game_server_cluster.name': request.gameServerCluster!.name || '', + 'game_server_cluster.name': request.gameServerCluster!.name ?? '', }); this.initialize(); return this.innerApiCalls.previewUpdateGameServerCluster( @@ -962,7 +962,7 @@ export class GameServerClustersServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createGameServerCluster( @@ -1105,7 +1105,7 @@ export class GameServerClustersServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteGameServerCluster( @@ -1255,7 +1255,7 @@ export class GameServerClustersServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'game_server_cluster.name': request.gameServerCluster!.name || '', + 'game_server_cluster.name': request.gameServerCluster!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateGameServerCluster( @@ -1403,7 +1403,7 @@ export class GameServerClustersServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listGameServerClusters( @@ -1456,7 +1456,7 @@ export class GameServerClustersServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listGameServerClusters']; const callSettings = defaultCallSettings.merge(options); @@ -1514,7 +1514,7 @@ export class GameServerClustersServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listGameServerClusters']; const callSettings = defaultCallSettings.merge(options); 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 index 58347403f5c..9d732969c0f 100644 --- 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 @@ -503,7 +503,7 @@ export class GameServerConfigsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getGameServerConfig(request, options, callback); @@ -615,7 +615,7 @@ export class GameServerConfigsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createGameServerConfig( @@ -760,7 +760,7 @@ export class GameServerConfigsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteGameServerConfig( @@ -910,7 +910,7 @@ export class GameServerConfigsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listGameServerConfigs(request, options, callback); @@ -960,7 +960,7 @@ export class GameServerConfigsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listGameServerConfigs']; const callSettings = defaultCallSettings.merge(options); @@ -1019,7 +1019,7 @@ export class GameServerConfigsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listGameServerConfigs']; const callSettings = defaultCallSettings.merge(options); 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 index d1760143195..522a0babf82 100644 --- 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 @@ -547,7 +547,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getGameServerDeployment( @@ -651,7 +651,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getGameServerDeploymentRollout( @@ -764,7 +764,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'rollout.name': request.rollout!.name || '', + 'rollout.name': request.rollout!.name ?? '', }); this.initialize(); return this.innerApiCalls.previewGameServerDeploymentRollout( @@ -869,7 +869,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.fetchDeploymentState(request, options, callback); @@ -978,7 +978,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createGameServerDeployment( @@ -1122,7 +1122,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteGameServerDeployment( @@ -1272,7 +1272,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'game_server_deployment.name': request.gameServerDeployment!.name || '', + 'game_server_deployment.name': request.gameServerDeployment!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateGameServerDeployment( @@ -1427,7 +1427,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'rollout.name': request.rollout!.name || '', + 'rollout.name': request.rollout!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateGameServerDeploymentRollout( @@ -1575,7 +1575,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listGameServerDeployments( @@ -1628,7 +1628,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listGameServerDeployments']; const callSettings = defaultCallSettings.merge(options); @@ -1686,7 +1686,7 @@ export class GameServerDeploymentsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listGameServerDeployments']; const callSettings = defaultCallSettings.merge(options); diff --git a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts index c6b8677f615..d85db5bce1a 100644 --- a/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts +++ b/packages/google-cloud-gaming/src/v1beta/realms_service_client.ts @@ -498,7 +498,7 @@ export class RealmsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getRealm(request, options, callback); @@ -599,7 +599,7 @@ export class RealmsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'realm.name': request.realm!.name || '', + 'realm.name': request.realm!.name ?? '', }); this.initialize(); return this.innerApiCalls.previewRealmUpdate(request, options, callback); @@ -708,7 +708,7 @@ export class RealmsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createRealm(request, options, callback); @@ -847,7 +847,7 @@ export class RealmsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteRealm(request, options, callback); @@ -993,7 +993,7 @@ export class RealmsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'realm.name': request.realm!.name || '', + 'realm.name': request.realm!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateRealm(request, options, callback); @@ -1131,7 +1131,7 @@ export class RealmsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listRealms(request, options, callback); @@ -1180,7 +1180,7 @@ export class RealmsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listRealms']; const callSettings = defaultCallSettings.merge(options); @@ -1238,7 +1238,7 @@ export class RealmsServiceClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listRealms']; const callSettings = defaultCallSettings.merge(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 index ed708820d19..2a8f66a190f 100644 --- 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 @@ -27,6 +27,21 @@ 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 @@ -265,15 +280,11 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerClusterRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetGameServerClusterRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerCluster() ); @@ -281,11 +292,14 @@ describe('v1.GameServerClustersServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getGameServerCluster(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -298,15 +312,11 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerClusterRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetGameServerClusterRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerCluster() ); @@ -329,11 +339,14 @@ describe('v1.GameServerClustersServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -346,26 +359,25 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerClusterRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('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); - assert( - (client.innerApiCalls.getGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -378,7 +390,10 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerClusterRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetGameServerClusterRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getGameServerCluster(request), expectedError); @@ -396,15 +411,12 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'PreviewCreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse() ); @@ -412,11 +424,14 @@ describe('v1.GameServerClustersServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.previewCreateGameServerCluster(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.previewCreateGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -429,15 +444,12 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'PreviewCreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewCreateGameServerClusterResponse() ); @@ -460,11 +472,14 @@ describe('v1.GameServerClustersServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.previewCreateGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -477,15 +492,12 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'PreviewCreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.previewCreateGameServerCluster = stubSimpleCall( undefined, @@ -495,11 +507,14 @@ describe('v1.GameServerClustersServiceClient', () => { client.previewCreateGameServerCluster(request), expectedError ); - assert( - (client.innerApiCalls.previewCreateGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -512,7 +527,11 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'PreviewCreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -533,15 +552,12 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'PreviewDeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse() ); @@ -549,11 +565,14 @@ describe('v1.GameServerClustersServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.previewDeleteGameServerCluster(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.previewDeleteGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -566,15 +585,12 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'PreviewDeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewDeleteGameServerClusterResponse() ); @@ -597,11 +613,14 @@ describe('v1.GameServerClustersServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.previewDeleteGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -614,15 +633,12 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'PreviewDeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.previewDeleteGameServerCluster = stubSimpleCall( undefined, @@ -632,11 +648,14 @@ describe('v1.GameServerClustersServiceClient', () => { client.previewDeleteGameServerCluster(request), expectedError ); - assert( - (client.innerApiCalls.previewDeleteGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -649,7 +668,11 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'PreviewDeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -670,16 +693,13 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest() ); - request.gameServerCluster = {}; - request.gameServerCluster.name = ''; - const expectedHeaderRequestParams = 'game_server_cluster.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'PreviewUpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse() ); @@ -687,11 +707,14 @@ describe('v1.GameServerClustersServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.previewUpdateGameServerCluster(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.previewUpdateGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -704,16 +727,13 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest() ); - request.gameServerCluster = {}; - request.gameServerCluster.name = ''; - const expectedHeaderRequestParams = 'game_server_cluster.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'PreviewUpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewUpdateGameServerClusterResponse() ); @@ -736,11 +756,14 @@ describe('v1.GameServerClustersServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.previewUpdateGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -753,16 +776,13 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest() ); - request.gameServerCluster = {}; - request.gameServerCluster.name = ''; - const expectedHeaderRequestParams = 'game_server_cluster.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'PreviewUpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.previewUpdateGameServerCluster = stubSimpleCall( undefined, @@ -772,11 +792,14 @@ describe('v1.GameServerClustersServiceClient', () => { client.previewUpdateGameServerCluster(request), expectedError ); - assert( - (client.innerApiCalls.previewUpdateGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -789,8 +812,12 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest() ); - request.gameServerCluster = {}; - request.gameServerCluster.name = ''; + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'PreviewUpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -811,15 +838,12 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.CreateGameServerClusterRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -828,11 +852,14 @@ describe('v1.GameServerClustersServiceClient', () => { const [operation] = await client.createGameServerCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -845,15 +872,12 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.CreateGameServerClusterRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -883,11 +907,14 @@ describe('v1.GameServerClustersServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -900,15 +927,12 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.CreateGameServerClusterRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createGameServerCluster = stubLongRunningCall( undefined, @@ -918,11 +942,14 @@ describe('v1.GameServerClustersServiceClient', () => { client.createGameServerCluster(request), expectedError ); - assert( - (client.innerApiCalls.createGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -935,15 +962,12 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.CreateGameServerClusterRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createGameServerCluster = stubLongRunningCall( undefined, @@ -952,11 +976,14 @@ describe('v1.GameServerClustersServiceClient', () => { ); const [operation] = await client.createGameServerCluster(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1015,15 +1042,12 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.DeleteGameServerClusterRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1032,11 +1056,14 @@ describe('v1.GameServerClustersServiceClient', () => { const [operation] = await client.deleteGameServerCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1049,15 +1076,12 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.DeleteGameServerClusterRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1087,11 +1111,14 @@ describe('v1.GameServerClustersServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -1104,15 +1131,12 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.DeleteGameServerClusterRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteGameServerCluster = stubLongRunningCall( undefined, @@ -1122,11 +1146,14 @@ describe('v1.GameServerClustersServiceClient', () => { client.deleteGameServerCluster(request), expectedError ); - assert( - (client.innerApiCalls.deleteGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1139,15 +1166,12 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.DeleteGameServerClusterRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteGameServerCluster = stubLongRunningCall( undefined, @@ -1156,11 +1180,14 @@ describe('v1.GameServerClustersServiceClient', () => { ); const [operation] = await client.deleteGameServerCluster(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1219,16 +1246,13 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.UpdateGameServerClusterRequest() ); - request.gameServerCluster = {}; - request.gameServerCluster.name = ''; - const expectedHeaderRequestParams = 'game_server_cluster.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1237,11 +1261,14 @@ describe('v1.GameServerClustersServiceClient', () => { const [operation] = await client.updateGameServerCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1254,16 +1281,13 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.UpdateGameServerClusterRequest() ); - request.gameServerCluster = {}; - request.gameServerCluster.name = ''; - const expectedHeaderRequestParams = 'game_server_cluster.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1293,11 +1317,14 @@ describe('v1.GameServerClustersServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -1310,16 +1337,13 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.UpdateGameServerClusterRequest() ); - request.gameServerCluster = {}; - request.gameServerCluster.name = ''; - const expectedHeaderRequestParams = 'game_server_cluster.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateGameServerCluster = stubLongRunningCall( undefined, @@ -1329,11 +1353,14 @@ describe('v1.GameServerClustersServiceClient', () => { client.updateGameServerCluster(request), expectedError ); - assert( - (client.innerApiCalls.updateGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1346,16 +1373,13 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.UpdateGameServerClusterRequest() ); - request.gameServerCluster = {}; - request.gameServerCluster.name = ''; - const expectedHeaderRequestParams = 'game_server_cluster.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateGameServerCluster = stubLongRunningCall( undefined, @@ -1364,11 +1388,14 @@ describe('v1.GameServerClustersServiceClient', () => { ); const [operation] = await client.updateGameServerCluster(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1427,15 +1454,12 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListGameServerClustersRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerCluster() @@ -1451,11 +1475,14 @@ describe('v1.GameServerClustersServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listGameServerClusters(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGameServerClusters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1468,15 +1495,12 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListGameServerClustersRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerCluster() @@ -1507,11 +1531,14 @@ describe('v1.GameServerClustersServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGameServerClusters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -1524,15 +1551,12 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListGameServerClustersRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listGameServerClusters = stubSimpleCall( undefined, @@ -1542,11 +1566,14 @@ describe('v1.GameServerClustersServiceClient', () => { client.listGameServerClusters(request), expectedError ); - assert( - (client.innerApiCalls.listGameServerClusters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1559,8 +1586,12 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListGameServerClustersRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerCluster() @@ -1600,12 +1631,15 @@ describe('v1.GameServerClustersServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listGameServerClusters, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerClusters .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1619,8 +1653,12 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListGameServerClustersRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listGameServerClusters.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1649,12 +1687,15 @@ describe('v1.GameServerClustersServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listGameServerClusters, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerClusters .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1668,8 +1709,12 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListGameServerClustersRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerCluster() @@ -1696,12 +1741,15 @@ describe('v1.GameServerClustersServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerClusters .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1715,8 +1763,12 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListGameServerClustersRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listGameServerClusters.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1735,12 +1787,15 @@ describe('v1.GameServerClustersServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerClusters .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); 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 index 4ff1aa37ae4..e91b12c225f 100644 --- 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 @@ -27,6 +27,21 @@ 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 @@ -280,15 +295,11 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerClusterRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetGameServerClusterRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerCluster() ); @@ -296,11 +307,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getGameServerCluster(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -315,15 +329,11 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerClusterRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetGameServerClusterRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerCluster() ); @@ -346,11 +356,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -365,26 +378,25 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerClusterRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('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); - assert( - (client.innerApiCalls.getGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -399,7 +411,10 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerClusterRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetGameServerClusterRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getGameServerCluster(request), expectedError); @@ -419,15 +434,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'PreviewCreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse() ); @@ -435,11 +447,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.previewCreateGameServerCluster(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.previewCreateGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -454,15 +469,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'PreviewCreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterResponse() ); @@ -485,11 +497,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.previewCreateGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -504,15 +519,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'PreviewCreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.previewCreateGameServerCluster = stubSimpleCall( undefined, @@ -522,11 +534,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { client.previewCreateGameServerCluster(request), expectedError ); - assert( - (client.innerApiCalls.previewCreateGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -541,7 +556,11 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue( + 'PreviewCreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -564,15 +583,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'PreviewDeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse() ); @@ -580,11 +596,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.previewDeleteGameServerCluster(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.previewDeleteGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -599,15 +618,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'PreviewDeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterResponse() ); @@ -630,11 +646,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.previewDeleteGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -649,15 +668,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'PreviewDeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.previewDeleteGameServerCluster = stubSimpleCall( undefined, @@ -667,11 +683,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { client.previewDeleteGameServerCluster(request), expectedError ); - assert( - (client.innerApiCalls.previewDeleteGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -686,7 +705,11 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'PreviewDeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -709,16 +732,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest() ); - request.gameServerCluster = {}; - request.gameServerCluster.name = ''; - const expectedHeaderRequestParams = 'game_server_cluster.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'PreviewUpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse() ); @@ -726,11 +746,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.previewUpdateGameServerCluster(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.previewUpdateGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -745,16 +768,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest() ); - request.gameServerCluster = {}; - request.gameServerCluster.name = ''; - const expectedHeaderRequestParams = 'game_server_cluster.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'PreviewUpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterResponse() ); @@ -777,11 +797,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.previewUpdateGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -796,16 +819,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest() ); - request.gameServerCluster = {}; - request.gameServerCluster.name = ''; - const expectedHeaderRequestParams = 'game_server_cluster.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'PreviewUpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.previewUpdateGameServerCluster = stubSimpleCall( undefined, @@ -815,11 +835,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { client.previewUpdateGameServerCluster(request), expectedError ); - assert( - (client.innerApiCalls.previewUpdateGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -834,8 +857,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest() ); - request.gameServerCluster = {}; - request.gameServerCluster.name = ''; + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'PreviewUpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -858,15 +885,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.CreateGameServerClusterRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -875,11 +899,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { const [operation] = await client.createGameServerCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -894,15 +921,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.CreateGameServerClusterRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -932,11 +956,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -951,15 +978,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.CreateGameServerClusterRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createGameServerCluster = stubLongRunningCall( undefined, @@ -969,11 +993,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { client.createGameServerCluster(request), expectedError ); - assert( - (client.innerApiCalls.createGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -988,15 +1015,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.CreateGameServerClusterRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createGameServerCluster = stubLongRunningCall( undefined, @@ -1005,11 +1029,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { ); const [operation] = await client.createGameServerCluster(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1074,15 +1101,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1091,11 +1115,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { const [operation] = await client.deleteGameServerCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1110,15 +1137,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1148,11 +1172,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -1167,15 +1194,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteGameServerCluster = stubLongRunningCall( undefined, @@ -1185,11 +1209,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { client.deleteGameServerCluster(request), expectedError ); - assert( - (client.innerApiCalls.deleteGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1204,15 +1231,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteGameServerCluster = stubLongRunningCall( undefined, @@ -1221,11 +1245,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { ); const [operation] = await client.deleteGameServerCluster(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1290,16 +1317,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.UpdateGameServerClusterRequest() ); - request.gameServerCluster = {}; - request.gameServerCluster.name = ''; - const expectedHeaderRequestParams = 'game_server_cluster.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1308,11 +1332,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { const [operation] = await client.updateGameServerCluster(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1327,16 +1354,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.UpdateGameServerClusterRequest() ); - request.gameServerCluster = {}; - request.gameServerCluster.name = ''; - const expectedHeaderRequestParams = 'game_server_cluster.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1366,11 +1390,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -1385,16 +1412,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.UpdateGameServerClusterRequest() ); - request.gameServerCluster = {}; - request.gameServerCluster.name = ''; - const expectedHeaderRequestParams = 'game_server_cluster.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateGameServerCluster = stubLongRunningCall( undefined, @@ -1404,11 +1428,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { client.updateGameServerCluster(request), expectedError ); - assert( - (client.innerApiCalls.updateGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1423,16 +1450,13 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.UpdateGameServerClusterRequest() ); - request.gameServerCluster = {}; - request.gameServerCluster.name = ''; - const expectedHeaderRequestParams = 'game_server_cluster.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.gameServerCluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerClusterRequest', + ['gameServerCluster', 'name'] + ); + request.gameServerCluster.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_cluster.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateGameServerCluster = stubLongRunningCall( undefined, @@ -1441,11 +1465,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { ); const [operation] = await client.updateGameServerCluster(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateGameServerCluster as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1510,15 +1537,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListGameServerClustersRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerCluster() @@ -1534,11 +1558,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listGameServerClusters(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGameServerClusters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1553,15 +1580,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListGameServerClustersRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerCluster() @@ -1594,11 +1618,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGameServerClusters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -1613,15 +1640,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListGameServerClustersRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listGameServerClusters = stubSimpleCall( undefined, @@ -1631,11 +1655,14 @@ describe('v1beta.GameServerClustersServiceClient', () => { client.listGameServerClusters(request), expectedError ); - assert( - (client.innerApiCalls.listGameServerClusters as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1650,8 +1677,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListGameServerClustersRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerCluster() @@ -1692,12 +1723,15 @@ describe('v1beta.GameServerClustersServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listGameServerClusters, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerClusters .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1713,8 +1747,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListGameServerClustersRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listGameServerClusters.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1744,12 +1782,15 @@ describe('v1beta.GameServerClustersServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listGameServerClusters, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerClusters .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1765,8 +1806,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListGameServerClustersRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerCluster() @@ -1794,12 +1839,15 @@ describe('v1beta.GameServerClustersServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerClusters .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1815,8 +1863,12 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListGameServerClustersRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listGameServerClusters.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1835,12 +1887,15 @@ describe('v1beta.GameServerClustersServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerClusters .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); 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 index 895a36c06b4..3437986ca65 100644 --- 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 @@ -27,6 +27,21 @@ 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 @@ -265,15 +280,11 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetGameServerConfigRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerConfig() ); @@ -281,11 +292,14 @@ describe('v1.GameServerConfigsServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getGameServerConfig(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGameServerConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -298,15 +312,11 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetGameServerConfigRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerConfig() ); @@ -329,11 +339,14 @@ describe('v1.GameServerConfigsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGameServerConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -346,26 +359,25 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('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); - assert( - (client.innerApiCalls.getGameServerConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -378,7 +390,10 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerConfigRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetGameServerConfigRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getGameServerConfig(request), expectedError); @@ -396,15 +411,12 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.CreateGameServerConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -413,11 +425,14 @@ describe('v1.GameServerConfigsServiceClient', () => { const [operation] = await client.createGameServerConfig(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createGameServerConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -430,15 +445,12 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.CreateGameServerConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -468,11 +480,14 @@ describe('v1.GameServerConfigsServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createGameServerConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -485,15 +500,12 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.CreateGameServerConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createGameServerConfig = stubLongRunningCall( undefined, @@ -503,11 +515,14 @@ describe('v1.GameServerConfigsServiceClient', () => { client.createGameServerConfig(request), expectedError ); - assert( - (client.innerApiCalls.createGameServerConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -520,15 +535,12 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.CreateGameServerConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createGameServerConfig = stubLongRunningCall( undefined, @@ -537,11 +549,14 @@ describe('v1.GameServerConfigsServiceClient', () => { ); const [operation] = await client.createGameServerConfig(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createGameServerConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -599,15 +614,12 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.DeleteGameServerConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -616,11 +628,14 @@ describe('v1.GameServerConfigsServiceClient', () => { const [operation] = await client.deleteGameServerConfig(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteGameServerConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -633,15 +648,12 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.DeleteGameServerConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -671,11 +683,14 @@ describe('v1.GameServerConfigsServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteGameServerConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -688,15 +703,12 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.DeleteGameServerConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteGameServerConfig = stubLongRunningCall( undefined, @@ -706,11 +718,14 @@ describe('v1.GameServerConfigsServiceClient', () => { client.deleteGameServerConfig(request), expectedError ); - assert( - (client.innerApiCalls.deleteGameServerConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -723,15 +738,12 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.DeleteGameServerConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteGameServerConfig = stubLongRunningCall( undefined, @@ -740,11 +752,14 @@ describe('v1.GameServerConfigsServiceClient', () => { ); const [operation] = await client.deleteGameServerConfig(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteGameServerConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -802,15 +817,12 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListGameServerConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerConfig() @@ -826,11 +838,14 @@ describe('v1.GameServerConfigsServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listGameServerConfigs(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGameServerConfigs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -843,15 +858,12 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListGameServerConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerConfig() @@ -882,11 +894,14 @@ describe('v1.GameServerConfigsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGameServerConfigs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -899,15 +914,12 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListGameServerConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listGameServerConfigs = stubSimpleCall( undefined, @@ -917,11 +929,14 @@ describe('v1.GameServerConfigsServiceClient', () => { client.listGameServerConfigs(request), expectedError ); - assert( - (client.innerApiCalls.listGameServerConfigs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -934,8 +949,12 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListGameServerConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerConfig() @@ -975,12 +994,15 @@ describe('v1.GameServerConfigsServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listGameServerConfigs, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerConfigs .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -994,8 +1016,12 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListGameServerConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listGameServerConfigs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1024,12 +1050,15 @@ describe('v1.GameServerConfigsServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listGameServerConfigs, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerConfigs .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1043,8 +1072,12 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListGameServerConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerConfig() @@ -1071,12 +1104,15 @@ describe('v1.GameServerConfigsServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerConfigs .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1090,8 +1126,12 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListGameServerConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listGameServerConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1109,12 +1149,15 @@ describe('v1.GameServerConfigsServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerConfigs .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); 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 index bfc92c6658f..63b9136c40f 100644 --- 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 @@ -27,6 +27,21 @@ 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 @@ -280,15 +295,11 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetGameServerConfigRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerConfig() ); @@ -296,11 +307,14 @@ describe('v1beta.GameServerConfigsServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getGameServerConfig(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGameServerConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -315,15 +329,11 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetGameServerConfigRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerConfig() ); @@ -346,11 +356,14 @@ describe('v1beta.GameServerConfigsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGameServerConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -365,26 +378,25 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('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); - assert( - (client.innerApiCalls.getGameServerConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -399,7 +411,10 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerConfigRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetGameServerConfigRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getGameServerConfig(request), expectedError); @@ -419,15 +434,12 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.CreateGameServerConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -436,11 +448,14 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const [operation] = await client.createGameServerConfig(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createGameServerConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -455,15 +470,12 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.CreateGameServerConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -493,11 +505,14 @@ describe('v1beta.GameServerConfigsServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createGameServerConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -512,15 +527,12 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.CreateGameServerConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createGameServerConfig = stubLongRunningCall( undefined, @@ -530,11 +542,14 @@ describe('v1beta.GameServerConfigsServiceClient', () => { client.createGameServerConfig(request), expectedError ); - assert( - (client.innerApiCalls.createGameServerConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -549,15 +564,12 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.CreateGameServerConfigRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerConfigRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createGameServerConfig = stubLongRunningCall( undefined, @@ -566,11 +578,14 @@ describe('v1beta.GameServerConfigsServiceClient', () => { ); const [operation] = await client.createGameServerConfig(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createGameServerConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -634,15 +649,12 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -651,11 +663,14 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const [operation] = await client.deleteGameServerConfig(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteGameServerConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -670,15 +685,12 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -708,11 +720,14 @@ describe('v1beta.GameServerConfigsServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteGameServerConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -727,15 +742,12 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteGameServerConfig = stubLongRunningCall( undefined, @@ -745,11 +757,14 @@ describe('v1beta.GameServerConfigsServiceClient', () => { client.deleteGameServerConfig(request), expectedError ); - assert( - (client.innerApiCalls.deleteGameServerConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -764,15 +779,12 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerConfigRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteGameServerConfig = stubLongRunningCall( undefined, @@ -781,11 +793,14 @@ describe('v1beta.GameServerConfigsServiceClient', () => { ); const [operation] = await client.deleteGameServerConfig(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteGameServerConfig as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -849,15 +864,12 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListGameServerConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerConfig() @@ -873,11 +885,14 @@ describe('v1beta.GameServerConfigsServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listGameServerConfigs(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGameServerConfigs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -892,15 +907,12 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListGameServerConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerConfig() @@ -933,11 +945,14 @@ describe('v1beta.GameServerConfigsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGameServerConfigs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -952,15 +967,12 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListGameServerConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listGameServerConfigs = stubSimpleCall( undefined, @@ -970,11 +982,14 @@ describe('v1beta.GameServerConfigsServiceClient', () => { client.listGameServerConfigs(request), expectedError ); - assert( - (client.innerApiCalls.listGameServerConfigs as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -989,8 +1004,12 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListGameServerConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerConfig() @@ -1031,12 +1050,15 @@ describe('v1beta.GameServerConfigsServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listGameServerConfigs, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerConfigs .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1052,8 +1074,12 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListGameServerConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listGameServerConfigs.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1083,12 +1109,15 @@ describe('v1beta.GameServerConfigsServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listGameServerConfigs, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerConfigs .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1104,8 +1133,12 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListGameServerConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerConfig() @@ -1133,12 +1166,15 @@ describe('v1beta.GameServerConfigsServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerConfigs .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1154,8 +1190,12 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListGameServerConfigsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerConfigsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listGameServerConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1174,12 +1214,15 @@ describe('v1beta.GameServerConfigsServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerConfigs .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); 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 index 40a820de5c4..9da27654567 100644 --- 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 @@ -27,6 +27,21 @@ 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 @@ -280,15 +295,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerDeploymentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerDeployment() ); @@ -296,11 +308,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getGameServerDeployment(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -315,15 +330,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerDeploymentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerDeployment() ); @@ -346,11 +358,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -365,15 +380,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerDeploymentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getGameServerDeployment = stubSimpleCall( undefined, @@ -383,11 +395,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { client.getGameServerDeployment(request), expectedError ); - assert( - (client.innerApiCalls.getGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -402,7 +417,11 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerDeploymentRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -425,15 +444,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetGameServerDeploymentRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerDeploymentRollout() ); @@ -441,11 +457,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getGameServerDeploymentRollout(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGameServerDeploymentRollout as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -460,15 +479,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetGameServerDeploymentRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerDeploymentRollout() ); @@ -491,11 +507,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGameServerDeploymentRollout as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -510,15 +529,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetGameServerDeploymentRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getGameServerDeploymentRollout = stubSimpleCall( undefined, @@ -528,11 +544,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { client.getGameServerDeploymentRollout(request), expectedError ); - assert( - (client.innerApiCalls.getGameServerDeploymentRollout as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -547,7 +566,11 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetGameServerDeploymentRolloutRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -570,16 +593,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest() ); - request.rollout = {}; - request.rollout.name = ''; - const expectedHeaderRequestParams = 'rollout.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'PreviewGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse() ); @@ -589,11 +609,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { request ); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -608,16 +631,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest() ); - request.rollout = {}; - request.rollout.name = ''; - const expectedHeaderRequestParams = 'rollout.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'PreviewGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutResponse() ); @@ -640,11 +660,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -659,16 +682,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest() ); - request.rollout = {}; - request.rollout.name = ''; - const expectedHeaderRequestParams = 'rollout.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'PreviewGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.previewGameServerDeploymentRollout = stubSimpleCall( undefined, @@ -678,11 +698,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { client.previewGameServerDeploymentRollout(request), expectedError ); - assert( - (client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -697,8 +720,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest() ); - request.rollout = {}; - request.rollout.name = ''; + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'PreviewGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -721,15 +748,11 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.FetchDeploymentStateRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('FetchDeploymentStateRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.FetchDeploymentStateResponse() ); @@ -737,11 +760,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.fetchDeploymentState(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.fetchDeploymentState as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -756,15 +782,11 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.FetchDeploymentStateRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('FetchDeploymentStateRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.FetchDeploymentStateResponse() ); @@ -787,11 +809,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.fetchDeploymentState as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -806,26 +831,25 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.FetchDeploymentStateRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('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); - assert( - (client.innerApiCalls.fetchDeploymentState as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -840,7 +864,10 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.FetchDeploymentStateRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('FetchDeploymentStateRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.fetchDeploymentState(request), expectedError); @@ -860,15 +887,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.CreateGameServerDeploymentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -877,11 +901,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const [operation] = await client.createGameServerDeployment(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -896,15 +923,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.CreateGameServerDeploymentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -934,11 +958,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -953,15 +980,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.CreateGameServerDeploymentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createGameServerDeployment = stubLongRunningCall( undefined, @@ -971,11 +995,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { client.createGameServerDeployment(request), expectedError ); - assert( - (client.innerApiCalls.createGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -990,15 +1017,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.CreateGameServerDeploymentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createGameServerDeployment = stubLongRunningCall( undefined, @@ -1007,11 +1031,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ); const [operation] = await client.createGameServerDeployment(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1076,15 +1103,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1093,11 +1117,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const [operation] = await client.deleteGameServerDeployment(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1112,15 +1139,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1150,11 +1174,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -1169,15 +1196,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteGameServerDeployment = stubLongRunningCall( undefined, @@ -1187,11 +1211,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { client.deleteGameServerDeployment(request), expectedError ); - assert( - (client.innerApiCalls.deleteGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1206,15 +1233,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteGameServerDeployment = stubLongRunningCall( undefined, @@ -1223,11 +1247,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ); const [operation] = await client.deleteGameServerDeployment(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1292,16 +1319,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.UpdateGameServerDeploymentRequest() ); - request.gameServerDeployment = {}; - request.gameServerDeployment.name = ''; - const expectedHeaderRequestParams = 'game_server_deployment.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.gameServerDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerDeploymentRequest', + ['gameServerDeployment', 'name'] + ); + request.gameServerDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_deployment.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1310,11 +1334,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const [operation] = await client.updateGameServerDeployment(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1329,16 +1356,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.UpdateGameServerDeploymentRequest() ); - request.gameServerDeployment = {}; - request.gameServerDeployment.name = ''; - const expectedHeaderRequestParams = 'game_server_deployment.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.gameServerDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerDeploymentRequest', + ['gameServerDeployment', 'name'] + ); + request.gameServerDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_deployment.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1368,11 +1392,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -1387,16 +1414,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.UpdateGameServerDeploymentRequest() ); - request.gameServerDeployment = {}; - request.gameServerDeployment.name = ''; - const expectedHeaderRequestParams = 'game_server_deployment.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.gameServerDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerDeploymentRequest', + ['gameServerDeployment', 'name'] + ); + request.gameServerDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_deployment.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateGameServerDeployment = stubLongRunningCall( undefined, @@ -1406,11 +1430,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { client.updateGameServerDeployment(request), expectedError ); - assert( - (client.innerApiCalls.updateGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1425,16 +1452,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.UpdateGameServerDeploymentRequest() ); - request.gameServerDeployment = {}; - request.gameServerDeployment.name = ''; - const expectedHeaderRequestParams = 'game_server_deployment.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.gameServerDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerDeploymentRequest', + ['gameServerDeployment', 'name'] + ); + request.gameServerDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_deployment.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateGameServerDeployment = stubLongRunningCall( undefined, @@ -1443,11 +1467,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ); const [operation] = await client.updateGameServerDeployment(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1512,16 +1539,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest() ); - request.rollout = {}; - request.rollout.name = ''; - const expectedHeaderRequestParams = 'rollout.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1532,11 +1556,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1551,16 +1578,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest() ); - request.rollout = {}; - request.rollout.name = ''; - const expectedHeaderRequestParams = 'rollout.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1590,11 +1614,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -1609,16 +1636,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest() ); - request.rollout = {}; - request.rollout.name = ''; - const expectedHeaderRequestParams = 'rollout.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateGameServerDeploymentRollout = stubLongRunningCall(undefined, expectedError); @@ -1626,11 +1650,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { client.updateGameServerDeploymentRollout(request), expectedError ); - assert( - (client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1645,16 +1672,13 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest() ); - request.rollout = {}; - request.rollout.name = ''; - const expectedHeaderRequestParams = 'rollout.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateGameServerDeploymentRollout = stubLongRunningCall(undefined, undefined, expectedError); @@ -1662,11 +1686,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { request ); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1731,15 +1758,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListGameServerDeploymentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerDeployment() @@ -1755,11 +1779,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listGameServerDeployments(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGameServerDeployments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1774,15 +1801,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListGameServerDeploymentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerDeployment() @@ -1815,11 +1839,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGameServerDeployments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -1834,15 +1861,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListGameServerDeploymentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listGameServerDeployments = stubSimpleCall( undefined, @@ -1852,11 +1876,14 @@ describe('v1.GameServerDeploymentsServiceClient', () => { client.listGameServerDeployments(request), expectedError ); - assert( - (client.innerApiCalls.listGameServerDeployments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1871,8 +1898,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListGameServerDeploymentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerDeployment() @@ -1913,12 +1944,15 @@ describe('v1.GameServerDeploymentsServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listGameServerDeployments, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerDeployments .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1934,8 +1968,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListGameServerDeploymentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listGameServerDeployments.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1965,12 +2003,15 @@ describe('v1.GameServerDeploymentsServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listGameServerDeployments, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerDeployments .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1986,8 +2027,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListGameServerDeploymentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1.GameServerDeployment() @@ -2015,12 +2060,15 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerDeployments .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2036,8 +2084,12 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListGameServerDeploymentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listGameServerDeployments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2056,12 +2108,15 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerDeployments .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); 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 index 822cfcd3868..47a849952d3 100644 --- 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 @@ -27,6 +27,21 @@ 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 @@ -280,15 +295,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerDeployment() ); @@ -296,11 +308,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getGameServerDeployment(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -315,15 +330,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerDeployment() ); @@ -346,11 +358,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -365,15 +380,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getGameServerDeployment = stubSimpleCall( undefined, @@ -383,11 +395,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { client.getGameServerDeployment(request), expectedError ); - assert( - (client.innerApiCalls.getGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -402,7 +417,11 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -425,15 +444,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetGameServerDeploymentRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerDeploymentRollout() ); @@ -441,11 +457,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.getGameServerDeploymentRollout(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGameServerDeploymentRollout as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -460,15 +479,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetGameServerDeploymentRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerDeploymentRollout() ); @@ -491,11 +507,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getGameServerDeploymentRollout as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -510,15 +529,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'GetGameServerDeploymentRolloutRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getGameServerDeploymentRollout = stubSimpleCall( undefined, @@ -528,11 +544,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { client.getGameServerDeploymentRollout(request), expectedError ); - assert( - (client.innerApiCalls.getGameServerDeploymentRollout as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -547,7 +566,11 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue( + 'GetGameServerDeploymentRolloutRequest', + ['name'] + ); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -570,16 +593,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest() ); - request.rollout = {}; - request.rollout.name = ''; - const expectedHeaderRequestParams = 'rollout.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'PreviewGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse() ); @@ -589,11 +609,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { request ); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -608,16 +631,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest() ); - request.rollout = {}; - request.rollout.name = ''; - const expectedHeaderRequestParams = 'rollout.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'PreviewGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutResponse() ); @@ -640,11 +660,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -659,16 +682,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest() ); - request.rollout = {}; - request.rollout.name = ''; - const expectedHeaderRequestParams = 'rollout.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'PreviewGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.previewGameServerDeploymentRollout = stubSimpleCall( undefined, @@ -678,11 +698,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { client.previewGameServerDeploymentRollout(request), expectedError ); - assert( - (client.innerApiCalls.previewGameServerDeploymentRollout as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -697,8 +720,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest() ); - request.rollout = {}; - request.rollout.name = ''; + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'PreviewGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects( @@ -721,15 +748,11 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.FetchDeploymentStateRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('FetchDeploymentStateRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.FetchDeploymentStateResponse() ); @@ -737,11 +760,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.fetchDeploymentState(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.fetchDeploymentState as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -756,15 +782,11 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.FetchDeploymentStateRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('FetchDeploymentStateRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.FetchDeploymentStateResponse() ); @@ -787,11 +809,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.fetchDeploymentState as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -806,26 +831,25 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.FetchDeploymentStateRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('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); - assert( - (client.innerApiCalls.fetchDeploymentState as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -840,7 +864,10 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.FetchDeploymentStateRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('FetchDeploymentStateRequest', [ + 'name', + ]); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.fetchDeploymentState(request), expectedError); @@ -860,15 +887,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -877,11 +901,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const [operation] = await client.createGameServerDeployment(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -896,15 +923,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -934,11 +958,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -953,15 +980,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createGameServerDeployment = stubLongRunningCall( undefined, @@ -971,11 +995,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { client.createGameServerDeployment(request), expectedError ); - assert( - (client.innerApiCalls.createGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -990,15 +1017,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'CreateGameServerDeploymentRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createGameServerDeployment = stubLongRunningCall( undefined, @@ -1007,11 +1031,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); const [operation] = await client.createGameServerDeployment(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1076,15 +1103,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1093,11 +1117,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const [operation] = await client.deleteGameServerDeployment(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1112,15 +1139,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1150,11 +1174,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -1169,15 +1196,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteGameServerDeployment = stubLongRunningCall( undefined, @@ -1187,11 +1211,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { client.deleteGameServerDeployment(request), expectedError ); - assert( - (client.innerApiCalls.deleteGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1206,15 +1233,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'DeleteGameServerDeploymentRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteGameServerDeployment = stubLongRunningCall( undefined, @@ -1223,11 +1247,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); const [operation] = await client.deleteGameServerDeployment(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1292,16 +1319,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest() ); - request.gameServerDeployment = {}; - request.gameServerDeployment.name = ''; - const expectedHeaderRequestParams = 'game_server_deployment.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.gameServerDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerDeploymentRequest', + ['gameServerDeployment', 'name'] + ); + request.gameServerDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_deployment.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1310,11 +1334,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const [operation] = await client.updateGameServerDeployment(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1329,16 +1356,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest() ); - request.gameServerDeployment = {}; - request.gameServerDeployment.name = ''; - const expectedHeaderRequestParams = 'game_server_deployment.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.gameServerDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerDeploymentRequest', + ['gameServerDeployment', 'name'] + ); + request.gameServerDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_deployment.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1368,11 +1392,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -1387,16 +1414,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest() ); - request.gameServerDeployment = {}; - request.gameServerDeployment.name = ''; - const expectedHeaderRequestParams = 'game_server_deployment.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.gameServerDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerDeploymentRequest', + ['gameServerDeployment', 'name'] + ); + request.gameServerDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_deployment.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateGameServerDeployment = stubLongRunningCall( undefined, @@ -1406,11 +1430,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { client.updateGameServerDeployment(request), expectedError ); - assert( - (client.innerApiCalls.updateGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1425,16 +1452,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest() ); - request.gameServerDeployment = {}; - request.gameServerDeployment.name = ''; - const expectedHeaderRequestParams = 'game_server_deployment.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.gameServerDeployment ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerDeploymentRequest', + ['gameServerDeployment', 'name'] + ); + request.gameServerDeployment.name = defaultValue1; + const expectedHeaderRequestParams = `game_server_deployment.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateGameServerDeployment = stubLongRunningCall( undefined, @@ -1443,11 +1467,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); const [operation] = await client.updateGameServerDeployment(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateGameServerDeployment as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1512,16 +1539,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest() ); - request.rollout = {}; - request.rollout.name = ''; - const expectedHeaderRequestParams = 'rollout.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1532,11 +1556,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1551,16 +1578,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest() ); - request.rollout = {}; - request.rollout.name = ''; - const expectedHeaderRequestParams = 'rollout.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1590,11 +1614,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -1609,16 +1636,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest() ); - request.rollout = {}; - request.rollout.name = ''; - const expectedHeaderRequestParams = 'rollout.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateGameServerDeploymentRollout = stubLongRunningCall(undefined, expectedError); @@ -1626,11 +1650,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { client.updateGameServerDeploymentRollout(request), expectedError ); - assert( - (client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1645,16 +1672,13 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest() ); - request.rollout = {}; - request.rollout.name = ''; - const expectedHeaderRequestParams = 'rollout.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.rollout ??= {}; + const defaultValue1 = getTypeDefaultValue( + 'UpdateGameServerDeploymentRolloutRequest', + ['rollout', 'name'] + ); + request.rollout.name = defaultValue1; + const expectedHeaderRequestParams = `rollout.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateGameServerDeploymentRollout = stubLongRunningCall(undefined, undefined, expectedError); @@ -1662,11 +1686,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { request ); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateGameServerDeploymentRollout as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1731,15 +1758,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerDeployment() @@ -1755,11 +1779,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listGameServerDeployments(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGameServerDeployments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1774,15 +1801,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerDeployment() @@ -1815,11 +1839,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listGameServerDeployments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -1834,15 +1861,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listGameServerDeployments = stubSimpleCall( undefined, @@ -1852,11 +1876,14 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { client.listGameServerDeployments(request), expectedError ); - assert( - (client.innerApiCalls.listGameServerDeployments as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1871,8 +1898,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerDeployment() @@ -1915,12 +1946,15 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listGameServerDeployments, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerDeployments .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1936,8 +1970,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listGameServerDeployments.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1969,12 +2007,15 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listGameServerDeployments, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerDeployments .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1990,8 +2031,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.gaming.v1beta.GameServerDeployment() @@ -2019,12 +2064,15 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerDeployments .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2040,8 +2088,12 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListGameServerDeploymentsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listGameServerDeployments.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2060,12 +2112,15 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listGameServerDeployments .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts b/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts index 6f772331a8e..cb55aeb6585 100644 --- a/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts @@ -27,6 +27,21 @@ 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 @@ -254,26 +269,23 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetRealmRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('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); - assert( - (client.innerApiCalls.getRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -285,15 +297,9 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetRealmRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetRealmRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.Realm() ); @@ -316,11 +322,14 @@ describe('v1.RealmsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -332,23 +341,20 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetRealmRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('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); - assert( - (client.innerApiCalls.getRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -360,7 +366,8 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetRealmRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetRealmRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getRealm(request), expectedError); @@ -377,16 +384,13 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewRealmUpdateRequest() ); - request.realm = {}; - request.realm.name = ''; - const expectedHeaderRequestParams = 'realm.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue('PreviewRealmUpdateRequest', [ + 'realm', + 'name', + ]); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewRealmUpdateResponse() ); @@ -394,11 +398,14 @@ describe('v1.RealmsServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.previewRealmUpdate(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.previewRealmUpdate as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -410,16 +417,13 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewRealmUpdateRequest() ); - request.realm = {}; - request.realm.name = ''; - const expectedHeaderRequestParams = 'realm.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue('PreviewRealmUpdateRequest', [ + 'realm', + 'name', + ]); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewRealmUpdateResponse() ); @@ -442,11 +446,14 @@ describe('v1.RealmsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.previewRealmUpdate as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -458,27 +465,27 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewRealmUpdateRequest() ); - request.realm = {}; - request.realm.name = ''; - const expectedHeaderRequestParams = 'realm.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue('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); - assert( - (client.innerApiCalls.previewRealmUpdate as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -490,8 +497,12 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.PreviewRealmUpdateRequest() ); - request.realm = {}; - request.realm.name = ''; + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue('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); @@ -508,15 +519,11 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.CreateRealmRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateRealmRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -524,11 +531,14 @@ describe('v1.RealmsServiceClient', () => { const [operation] = await client.createRealm(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -540,15 +550,11 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.CreateRealmRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateRealmRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -578,11 +584,14 @@ describe('v1.RealmsServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -594,26 +603,25 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.CreateRealmRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('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); - assert( - (client.innerApiCalls.createRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -625,15 +633,11 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.CreateRealmRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateRealmRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createRealm = stubLongRunningCall( undefined, @@ -642,11 +646,14 @@ describe('v1.RealmsServiceClient', () => { ); const [operation] = await client.createRealm(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -698,15 +705,9 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.DeleteRealmRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteRealmRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -714,11 +715,14 @@ describe('v1.RealmsServiceClient', () => { const [operation] = await client.deleteRealm(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -730,15 +734,9 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.DeleteRealmRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteRealmRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -768,11 +766,14 @@ describe('v1.RealmsServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -784,26 +785,23 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.DeleteRealmRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('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); - assert( - (client.innerApiCalls.deleteRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -815,15 +813,9 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.DeleteRealmRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteRealmRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteRealm = stubLongRunningCall( undefined, @@ -832,11 +824,14 @@ describe('v1.RealmsServiceClient', () => { ); const [operation] = await client.deleteRealm(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -888,16 +883,13 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.UpdateRealmRequest() ); - request.realm = {}; - request.realm.name = ''; - const expectedHeaderRequestParams = 'realm.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateRealmRequest', [ + 'realm', + 'name', + ]); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -905,11 +897,14 @@ describe('v1.RealmsServiceClient', () => { const [operation] = await client.updateRealm(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -921,16 +916,13 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.UpdateRealmRequest() ); - request.realm = {}; - request.realm.name = ''; - const expectedHeaderRequestParams = 'realm.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateRealmRequest', [ + 'realm', + 'name', + ]); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -960,11 +952,14 @@ describe('v1.RealmsServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -976,27 +971,27 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.UpdateRealmRequest() ); - request.realm = {}; - request.realm.name = ''; - const expectedHeaderRequestParams = 'realm.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue('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); - assert( - (client.innerApiCalls.updateRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1008,16 +1003,13 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.UpdateRealmRequest() ); - request.realm = {}; - request.realm.name = ''; - const expectedHeaderRequestParams = 'realm.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateRealmRequest', [ + 'realm', + 'name', + ]); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateRealm = stubLongRunningCall( undefined, @@ -1026,11 +1018,14 @@ describe('v1.RealmsServiceClient', () => { ); const [operation] = await client.updateRealm(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1082,15 +1077,11 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListRealmsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('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()), @@ -1099,11 +1090,14 @@ describe('v1.RealmsServiceClient', () => { client.innerApiCalls.listRealms = stubSimpleCall(expectedResponse); const [response] = await client.listRealms(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listRealms as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1115,15 +1109,11 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListRealmsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('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()), @@ -1148,11 +1138,14 @@ describe('v1.RealmsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listRealms as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -1164,26 +1157,25 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListRealmsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('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); - assert( - (client.innerApiCalls.listRealms as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1195,8 +1187,11 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListRealmsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('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()), @@ -1224,11 +1219,12 @@ describe('v1.RealmsServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listRealms, request) ); - assert.strictEqual( - (client.descriptors.page.listRealms.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listRealms.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1241,8 +1237,11 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListRealmsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListRealmsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listRealms.createStream = stubPageStreamingCall( undefined, @@ -1267,11 +1266,12 @@ describe('v1.RealmsServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listRealms, request) ); - assert.strictEqual( - (client.descriptors.page.listRealms.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listRealms.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1284,8 +1284,11 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListRealmsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('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()), @@ -1305,11 +1308,12 @@ describe('v1.RealmsServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listRealms.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listRealms.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1322,8 +1326,11 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListRealmsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListRealmsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listRealms.asyncIterate = stubAsyncIterationCall( undefined, @@ -1342,11 +1349,12 @@ describe('v1.RealmsServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listRealms.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listRealms.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts index 7a180c26264..107ce9c2bb2 100644 --- a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts @@ -27,6 +27,21 @@ 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 @@ -254,26 +269,23 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetRealmRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('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); - assert( - (client.innerApiCalls.getRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -285,15 +297,9 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetRealmRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetRealmRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.Realm() ); @@ -316,11 +322,14 @@ describe('v1beta.RealmsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -332,23 +341,20 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetRealmRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('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); - assert( - (client.innerApiCalls.getRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -360,7 +366,8 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetRealmRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetRealmRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getRealm(request), expectedError); @@ -377,16 +384,13 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest() ); - request.realm = {}; - request.realm.name = ''; - const expectedHeaderRequestParams = 'realm.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue('PreviewRealmUpdateRequest', [ + 'realm', + 'name', + ]); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewRealmUpdateResponse() ); @@ -394,11 +398,14 @@ describe('v1beta.RealmsServiceClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.previewRealmUpdate(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.previewRealmUpdate as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -410,16 +417,13 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest() ); - request.realm = {}; - request.realm.name = ''; - const expectedHeaderRequestParams = 'realm.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue('PreviewRealmUpdateRequest', [ + 'realm', + 'name', + ]); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewRealmUpdateResponse() ); @@ -442,11 +446,14 @@ describe('v1beta.RealmsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.previewRealmUpdate as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -458,27 +465,27 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest() ); - request.realm = {}; - request.realm.name = ''; - const expectedHeaderRequestParams = 'realm.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue('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); - assert( - (client.innerApiCalls.previewRealmUpdate as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -490,8 +497,12 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest() ); - request.realm = {}; - request.realm.name = ''; + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue('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); @@ -508,15 +519,11 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.CreateRealmRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateRealmRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -524,11 +531,14 @@ describe('v1beta.RealmsServiceClient', () => { const [operation] = await client.createRealm(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -540,15 +550,11 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.CreateRealmRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateRealmRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -578,11 +584,14 @@ describe('v1beta.RealmsServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -594,26 +603,25 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.CreateRealmRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('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); - assert( - (client.innerApiCalls.createRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -625,15 +633,11 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.CreateRealmRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateRealmRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createRealm = stubLongRunningCall( undefined, @@ -642,11 +646,14 @@ describe('v1beta.RealmsServiceClient', () => { ); const [operation] = await client.createRealm(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -698,15 +705,9 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.DeleteRealmRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteRealmRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -714,11 +715,14 @@ describe('v1beta.RealmsServiceClient', () => { const [operation] = await client.deleteRealm(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -730,15 +734,9 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.DeleteRealmRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteRealmRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -768,11 +766,14 @@ describe('v1beta.RealmsServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -784,26 +785,23 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.DeleteRealmRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('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); - assert( - (client.innerApiCalls.deleteRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -815,15 +813,9 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.DeleteRealmRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteRealmRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteRealm = stubLongRunningCall( undefined, @@ -832,11 +824,14 @@ describe('v1beta.RealmsServiceClient', () => { ); const [operation] = await client.deleteRealm(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -888,16 +883,13 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.UpdateRealmRequest() ); - request.realm = {}; - request.realm.name = ''; - const expectedHeaderRequestParams = 'realm.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateRealmRequest', [ + 'realm', + 'name', + ]); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -905,11 +897,14 @@ describe('v1beta.RealmsServiceClient', () => { const [operation] = await client.updateRealm(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -921,16 +916,13 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.UpdateRealmRequest() ); - request.realm = {}; - request.realm.name = ''; - const expectedHeaderRequestParams = 'realm.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateRealmRequest', [ + 'realm', + 'name', + ]); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -960,11 +952,14 @@ describe('v1beta.RealmsServiceClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -976,27 +971,27 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.UpdateRealmRequest() ); - request.realm = {}; - request.realm.name = ''; - const expectedHeaderRequestParams = 'realm.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue('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); - assert( - (client.innerApiCalls.updateRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1008,16 +1003,13 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.UpdateRealmRequest() ); - request.realm = {}; - request.realm.name = ''; - const expectedHeaderRequestParams = 'realm.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.realm ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateRealmRequest', [ + 'realm', + 'name', + ]); + request.realm.name = defaultValue1; + const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateRealm = stubLongRunningCall( undefined, @@ -1026,11 +1018,14 @@ describe('v1beta.RealmsServiceClient', () => { ); const [operation] = await client.updateRealm(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateRealm as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1082,15 +1077,11 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListRealmsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('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()), @@ -1099,11 +1090,14 @@ describe('v1beta.RealmsServiceClient', () => { client.innerApiCalls.listRealms = stubSimpleCall(expectedResponse); const [response] = await client.listRealms(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listRealms as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1115,15 +1109,11 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListRealmsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('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()), @@ -1148,11 +1138,14 @@ describe('v1beta.RealmsServiceClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listRealms as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + 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 () => { @@ -1164,26 +1157,25 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListRealmsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('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); - assert( - (client.innerApiCalls.listRealms as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + 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 () => { @@ -1195,8 +1187,11 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListRealmsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('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()), @@ -1227,11 +1222,12 @@ describe('v1beta.RealmsServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listRealms, request) ); - assert.strictEqual( - (client.descriptors.page.listRealms.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listRealms.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1244,8 +1240,11 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListRealmsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListRealmsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listRealms.createStream = stubPageStreamingCall( undefined, @@ -1273,11 +1272,12 @@ describe('v1beta.RealmsServiceClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listRealms, request) ); - assert.strictEqual( - (client.descriptors.page.listRealms.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listRealms.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1290,8 +1290,11 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListRealmsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('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()), @@ -1311,11 +1314,12 @@ describe('v1beta.RealmsServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listRealms.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listRealms.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1328,8 +1332,11 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListRealmsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListRealmsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listRealms.asyncIterate = stubAsyncIterationCall( undefined, @@ -1348,11 +1355,12 @@ describe('v1beta.RealmsServiceClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listRealms.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listRealms.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); From 637ee264c11c27b7cf41ec054c9ec01e365aef35 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 22 Sep 2022 13:21:45 -0700 Subject: [PATCH 169/180] test: use fully qualified request type name in tests (#343) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test: use fully qualified request type name in tests PiperOrigin-RevId: 475685359 Source-Link: https://github.com/googleapis/googleapis/commit/7a129736313ceb1f277c3b7f7e16d2e04cc901dd Source-Link: https://github.com/googleapis/googleapis-gen/commit/370c729e2ba062a167449c27882ba5f379c5c34d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzcwYzcyOWUyYmEwNjJhMTY3NDQ5YzI3ODgyYmE1ZjM3OWM1YzM0ZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../gapic_game_server_clusters_service_v1.ts | 90 ++++----- ...pic_game_server_clusters_service_v1beta.ts | 90 ++++----- .../gapic_game_server_configs_service_v1.ts | 58 +++--- ...apic_game_server_configs_service_v1beta.ts | 58 +++--- ...apic_game_server_deployments_service_v1.ts | 98 +++++----- ..._game_server_deployments_service_v1beta.ts | 98 +++++----- .../test/gapic_realms_service_v1.ts | 181 +++++++++++------- .../test/gapic_realms_service_v1beta.ts | 181 +++++++++++------- 8 files changed, 474 insertions(+), 380 deletions(-) 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 index 2a8f66a190f..954a3867635 100644 --- 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 @@ -280,9 +280,10 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('GetGameServerClusterRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerClusterRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -312,9 +313,10 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('GetGameServerClusterRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerClusterRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -359,9 +361,10 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('GetGameServerClusterRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerClusterRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -390,9 +393,10 @@ describe('v1.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('GetGameServerClusterRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerClusterRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -412,7 +416,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'PreviewCreateGameServerClusterRequest', + '.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -445,7 +449,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'PreviewCreateGameServerClusterRequest', + '.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -493,7 +497,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'PreviewCreateGameServerClusterRequest', + '.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -528,7 +532,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'PreviewCreateGameServerClusterRequest', + '.google.cloud.gaming.v1.PreviewCreateGameServerClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -553,7 +557,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'PreviewDeleteGameServerClusterRequest', + '.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest', ['name'] ); request.name = defaultValue1; @@ -586,7 +590,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'PreviewDeleteGameServerClusterRequest', + '.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest', ['name'] ); request.name = defaultValue1; @@ -634,7 +638,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'PreviewDeleteGameServerClusterRequest', + '.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest', ['name'] ); request.name = defaultValue1; @@ -669,7 +673,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'PreviewDeleteGameServerClusterRequest', + '.google.cloud.gaming.v1.PreviewDeleteGameServerClusterRequest', ['name'] ); request.name = defaultValue1; @@ -695,7 +699,7 @@ describe('v1.GameServerClustersServiceClient', () => { ); request.gameServerCluster ??= {}; const defaultValue1 = getTypeDefaultValue( - 'PreviewUpdateGameServerClusterRequest', + '.google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest', ['gameServerCluster', 'name'] ); request.gameServerCluster.name = defaultValue1; @@ -729,7 +733,7 @@ describe('v1.GameServerClustersServiceClient', () => { ); request.gameServerCluster ??= {}; const defaultValue1 = getTypeDefaultValue( - 'PreviewUpdateGameServerClusterRequest', + '.google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest', ['gameServerCluster', 'name'] ); request.gameServerCluster.name = defaultValue1; @@ -778,7 +782,7 @@ describe('v1.GameServerClustersServiceClient', () => { ); request.gameServerCluster ??= {}; const defaultValue1 = getTypeDefaultValue( - 'PreviewUpdateGameServerClusterRequest', + '.google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest', ['gameServerCluster', 'name'] ); request.gameServerCluster.name = defaultValue1; @@ -814,7 +818,7 @@ describe('v1.GameServerClustersServiceClient', () => { ); request.gameServerCluster ??= {}; const defaultValue1 = getTypeDefaultValue( - 'PreviewUpdateGameServerClusterRequest', + '.google.cloud.gaming.v1.PreviewUpdateGameServerClusterRequest', ['gameServerCluster', 'name'] ); request.gameServerCluster.name = defaultValue1; @@ -839,7 +843,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.CreateGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerClusterRequest', + '.google.cloud.gaming.v1.CreateGameServerClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -873,7 +877,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.CreateGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerClusterRequest', + '.google.cloud.gaming.v1.CreateGameServerClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -928,7 +932,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.CreateGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerClusterRequest', + '.google.cloud.gaming.v1.CreateGameServerClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -963,7 +967,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.CreateGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerClusterRequest', + '.google.cloud.gaming.v1.CreateGameServerClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -1043,7 +1047,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.DeleteGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerClusterRequest', + '.google.cloud.gaming.v1.DeleteGameServerClusterRequest', ['name'] ); request.name = defaultValue1; @@ -1077,7 +1081,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.DeleteGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerClusterRequest', + '.google.cloud.gaming.v1.DeleteGameServerClusterRequest', ['name'] ); request.name = defaultValue1; @@ -1132,7 +1136,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.DeleteGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerClusterRequest', + '.google.cloud.gaming.v1.DeleteGameServerClusterRequest', ['name'] ); request.name = defaultValue1; @@ -1167,7 +1171,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.DeleteGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerClusterRequest', + '.google.cloud.gaming.v1.DeleteGameServerClusterRequest', ['name'] ); request.name = defaultValue1; @@ -1248,7 +1252,7 @@ describe('v1.GameServerClustersServiceClient', () => { ); request.gameServerCluster ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerClusterRequest', + '.google.cloud.gaming.v1.UpdateGameServerClusterRequest', ['gameServerCluster', 'name'] ); request.gameServerCluster.name = defaultValue1; @@ -1283,7 +1287,7 @@ describe('v1.GameServerClustersServiceClient', () => { ); request.gameServerCluster ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerClusterRequest', + '.google.cloud.gaming.v1.UpdateGameServerClusterRequest', ['gameServerCluster', 'name'] ); request.gameServerCluster.name = defaultValue1; @@ -1339,7 +1343,7 @@ describe('v1.GameServerClustersServiceClient', () => { ); request.gameServerCluster ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerClusterRequest', + '.google.cloud.gaming.v1.UpdateGameServerClusterRequest', ['gameServerCluster', 'name'] ); request.gameServerCluster.name = defaultValue1; @@ -1375,7 +1379,7 @@ describe('v1.GameServerClustersServiceClient', () => { ); request.gameServerCluster ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerClusterRequest', + '.google.cloud.gaming.v1.UpdateGameServerClusterRequest', ['gameServerCluster', 'name'] ); request.gameServerCluster.name = defaultValue1; @@ -1455,7 +1459,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.ListGameServerClustersRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerClustersRequest', + '.google.cloud.gaming.v1.ListGameServerClustersRequest', ['parent'] ); request.parent = defaultValue1; @@ -1496,7 +1500,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.ListGameServerClustersRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerClustersRequest', + '.google.cloud.gaming.v1.ListGameServerClustersRequest', ['parent'] ); request.parent = defaultValue1; @@ -1552,7 +1556,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.ListGameServerClustersRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerClustersRequest', + '.google.cloud.gaming.v1.ListGameServerClustersRequest', ['parent'] ); request.parent = defaultValue1; @@ -1587,7 +1591,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.ListGameServerClustersRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerClustersRequest', + '.google.cloud.gaming.v1.ListGameServerClustersRequest', ['parent'] ); request.parent = defaultValue1; @@ -1654,7 +1658,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.ListGameServerClustersRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerClustersRequest', + '.google.cloud.gaming.v1.ListGameServerClustersRequest', ['parent'] ); request.parent = defaultValue1; @@ -1710,7 +1714,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.ListGameServerClustersRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerClustersRequest', + '.google.cloud.gaming.v1.ListGameServerClustersRequest', ['parent'] ); request.parent = defaultValue1; @@ -1764,7 +1768,7 @@ describe('v1.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1.ListGameServerClustersRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerClustersRequest', + '.google.cloud.gaming.v1.ListGameServerClustersRequest', ['parent'] ); request.parent = defaultValue1; 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 index e91b12c225f..c7ba664efec 100644 --- 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 @@ -295,9 +295,10 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('GetGameServerClusterRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerClusterRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -329,9 +330,10 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('GetGameServerClusterRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerClusterRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -378,9 +380,10 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('GetGameServerClusterRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerClusterRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -411,9 +414,10 @@ describe('v1beta.GameServerClustersServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerClusterRequest() ); - const defaultValue1 = getTypeDefaultValue('GetGameServerClusterRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerClusterRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -435,7 +439,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'PreviewCreateGameServerClusterRequest', + '.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -470,7 +474,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'PreviewCreateGameServerClusterRequest', + '.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -520,7 +524,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'PreviewCreateGameServerClusterRequest', + '.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -557,7 +561,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'PreviewCreateGameServerClusterRequest', + '.google.cloud.gaming.v1beta.PreviewCreateGameServerClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -584,7 +588,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'PreviewDeleteGameServerClusterRequest', + '.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest', ['name'] ); request.name = defaultValue1; @@ -619,7 +623,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'PreviewDeleteGameServerClusterRequest', + '.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest', ['name'] ); request.name = defaultValue1; @@ -669,7 +673,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'PreviewDeleteGameServerClusterRequest', + '.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest', ['name'] ); request.name = defaultValue1; @@ -706,7 +710,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'PreviewDeleteGameServerClusterRequest', + '.google.cloud.gaming.v1beta.PreviewDeleteGameServerClusterRequest', ['name'] ); request.name = defaultValue1; @@ -734,7 +738,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { ); request.gameServerCluster ??= {}; const defaultValue1 = getTypeDefaultValue( - 'PreviewUpdateGameServerClusterRequest', + '.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest', ['gameServerCluster', 'name'] ); request.gameServerCluster.name = defaultValue1; @@ -770,7 +774,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { ); request.gameServerCluster ??= {}; const defaultValue1 = getTypeDefaultValue( - 'PreviewUpdateGameServerClusterRequest', + '.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest', ['gameServerCluster', 'name'] ); request.gameServerCluster.name = defaultValue1; @@ -821,7 +825,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { ); request.gameServerCluster ??= {}; const defaultValue1 = getTypeDefaultValue( - 'PreviewUpdateGameServerClusterRequest', + '.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest', ['gameServerCluster', 'name'] ); request.gameServerCluster.name = defaultValue1; @@ -859,7 +863,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { ); request.gameServerCluster ??= {}; const defaultValue1 = getTypeDefaultValue( - 'PreviewUpdateGameServerClusterRequest', + '.google.cloud.gaming.v1beta.PreviewUpdateGameServerClusterRequest', ['gameServerCluster', 'name'] ); request.gameServerCluster.name = defaultValue1; @@ -886,7 +890,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.CreateGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerClusterRequest', + '.google.cloud.gaming.v1beta.CreateGameServerClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -922,7 +926,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.CreateGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerClusterRequest', + '.google.cloud.gaming.v1beta.CreateGameServerClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -979,7 +983,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.CreateGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerClusterRequest', + '.google.cloud.gaming.v1beta.CreateGameServerClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -1016,7 +1020,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.CreateGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerClusterRequest', + '.google.cloud.gaming.v1beta.CreateGameServerClusterRequest', ['parent'] ); request.parent = defaultValue1; @@ -1102,7 +1106,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerClusterRequest', + '.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest', ['name'] ); request.name = defaultValue1; @@ -1138,7 +1142,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerClusterRequest', + '.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest', ['name'] ); request.name = defaultValue1; @@ -1195,7 +1199,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerClusterRequest', + '.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest', ['name'] ); request.name = defaultValue1; @@ -1232,7 +1236,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerClusterRequest', + '.google.cloud.gaming.v1beta.DeleteGameServerClusterRequest', ['name'] ); request.name = defaultValue1; @@ -1319,7 +1323,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { ); request.gameServerCluster ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerClusterRequest', + '.google.cloud.gaming.v1beta.UpdateGameServerClusterRequest', ['gameServerCluster', 'name'] ); request.gameServerCluster.name = defaultValue1; @@ -1356,7 +1360,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { ); request.gameServerCluster ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerClusterRequest', + '.google.cloud.gaming.v1beta.UpdateGameServerClusterRequest', ['gameServerCluster', 'name'] ); request.gameServerCluster.name = defaultValue1; @@ -1414,7 +1418,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { ); request.gameServerCluster ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerClusterRequest', + '.google.cloud.gaming.v1beta.UpdateGameServerClusterRequest', ['gameServerCluster', 'name'] ); request.gameServerCluster.name = defaultValue1; @@ -1452,7 +1456,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { ); request.gameServerCluster ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerClusterRequest', + '.google.cloud.gaming.v1beta.UpdateGameServerClusterRequest', ['gameServerCluster', 'name'] ); request.gameServerCluster.name = defaultValue1; @@ -1538,7 +1542,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.ListGameServerClustersRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerClustersRequest', + '.google.cloud.gaming.v1beta.ListGameServerClustersRequest', ['parent'] ); request.parent = defaultValue1; @@ -1581,7 +1585,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.ListGameServerClustersRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerClustersRequest', + '.google.cloud.gaming.v1beta.ListGameServerClustersRequest', ['parent'] ); request.parent = defaultValue1; @@ -1641,7 +1645,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.ListGameServerClustersRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerClustersRequest', + '.google.cloud.gaming.v1beta.ListGameServerClustersRequest', ['parent'] ); request.parent = defaultValue1; @@ -1678,7 +1682,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.ListGameServerClustersRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerClustersRequest', + '.google.cloud.gaming.v1beta.ListGameServerClustersRequest', ['parent'] ); request.parent = defaultValue1; @@ -1748,7 +1752,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.ListGameServerClustersRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerClustersRequest', + '.google.cloud.gaming.v1beta.ListGameServerClustersRequest', ['parent'] ); request.parent = defaultValue1; @@ -1807,7 +1811,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.ListGameServerClustersRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerClustersRequest', + '.google.cloud.gaming.v1beta.ListGameServerClustersRequest', ['parent'] ); request.parent = defaultValue1; @@ -1864,7 +1868,7 @@ describe('v1beta.GameServerClustersServiceClient', () => { new protos.google.cloud.gaming.v1beta.ListGameServerClustersRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerClustersRequest', + '.google.cloud.gaming.v1beta.ListGameServerClustersRequest', ['parent'] ); request.parent = defaultValue1; 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 index 3437986ca65..0919f345313 100644 --- 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 @@ -280,9 +280,10 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerConfigRequest() ); - const defaultValue1 = getTypeDefaultValue('GetGameServerConfigRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerConfigRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -312,9 +313,10 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerConfigRequest() ); - const defaultValue1 = getTypeDefaultValue('GetGameServerConfigRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerConfigRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -359,9 +361,10 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerConfigRequest() ); - const defaultValue1 = getTypeDefaultValue('GetGameServerConfigRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerConfigRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -390,9 +393,10 @@ describe('v1.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetGameServerConfigRequest() ); - const defaultValue1 = getTypeDefaultValue('GetGameServerConfigRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetGameServerConfigRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -412,7 +416,7 @@ describe('v1.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1.CreateGameServerConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerConfigRequest', + '.google.cloud.gaming.v1.CreateGameServerConfigRequest', ['parent'] ); request.parent = defaultValue1; @@ -446,7 +450,7 @@ describe('v1.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1.CreateGameServerConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerConfigRequest', + '.google.cloud.gaming.v1.CreateGameServerConfigRequest', ['parent'] ); request.parent = defaultValue1; @@ -501,7 +505,7 @@ describe('v1.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1.CreateGameServerConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerConfigRequest', + '.google.cloud.gaming.v1.CreateGameServerConfigRequest', ['parent'] ); request.parent = defaultValue1; @@ -536,7 +540,7 @@ describe('v1.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1.CreateGameServerConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerConfigRequest', + '.google.cloud.gaming.v1.CreateGameServerConfigRequest', ['parent'] ); request.parent = defaultValue1; @@ -615,7 +619,7 @@ describe('v1.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1.DeleteGameServerConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerConfigRequest', + '.google.cloud.gaming.v1.DeleteGameServerConfigRequest', ['name'] ); request.name = defaultValue1; @@ -649,7 +653,7 @@ describe('v1.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1.DeleteGameServerConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerConfigRequest', + '.google.cloud.gaming.v1.DeleteGameServerConfigRequest', ['name'] ); request.name = defaultValue1; @@ -704,7 +708,7 @@ describe('v1.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1.DeleteGameServerConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerConfigRequest', + '.google.cloud.gaming.v1.DeleteGameServerConfigRequest', ['name'] ); request.name = defaultValue1; @@ -739,7 +743,7 @@ describe('v1.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1.DeleteGameServerConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerConfigRequest', + '.google.cloud.gaming.v1.DeleteGameServerConfigRequest', ['name'] ); request.name = defaultValue1; @@ -818,7 +822,7 @@ describe('v1.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1.ListGameServerConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerConfigsRequest', + '.google.cloud.gaming.v1.ListGameServerConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -859,7 +863,7 @@ describe('v1.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1.ListGameServerConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerConfigsRequest', + '.google.cloud.gaming.v1.ListGameServerConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -915,7 +919,7 @@ describe('v1.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1.ListGameServerConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerConfigsRequest', + '.google.cloud.gaming.v1.ListGameServerConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -950,7 +954,7 @@ describe('v1.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1.ListGameServerConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerConfigsRequest', + '.google.cloud.gaming.v1.ListGameServerConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1017,7 +1021,7 @@ describe('v1.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1.ListGameServerConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerConfigsRequest', + '.google.cloud.gaming.v1.ListGameServerConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1073,7 +1077,7 @@ describe('v1.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1.ListGameServerConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerConfigsRequest', + '.google.cloud.gaming.v1.ListGameServerConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1127,7 +1131,7 @@ describe('v1.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1.ListGameServerConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerConfigsRequest', + '.google.cloud.gaming.v1.ListGameServerConfigsRequest', ['parent'] ); request.parent = defaultValue1; 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 index 63b9136c40f..548bd600681 100644 --- 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 @@ -295,9 +295,10 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerConfigRequest() ); - const defaultValue1 = getTypeDefaultValue('GetGameServerConfigRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerConfigRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -329,9 +330,10 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerConfigRequest() ); - const defaultValue1 = getTypeDefaultValue('GetGameServerConfigRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerConfigRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -378,9 +380,10 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerConfigRequest() ); - const defaultValue1 = getTypeDefaultValue('GetGameServerConfigRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerConfigRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -411,9 +414,10 @@ describe('v1beta.GameServerConfigsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetGameServerConfigRequest() ); - const defaultValue1 = getTypeDefaultValue('GetGameServerConfigRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetGameServerConfigRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -435,7 +439,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1beta.CreateGameServerConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerConfigRequest', + '.google.cloud.gaming.v1beta.CreateGameServerConfigRequest', ['parent'] ); request.parent = defaultValue1; @@ -471,7 +475,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1beta.CreateGameServerConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerConfigRequest', + '.google.cloud.gaming.v1beta.CreateGameServerConfigRequest', ['parent'] ); request.parent = defaultValue1; @@ -528,7 +532,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1beta.CreateGameServerConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerConfigRequest', + '.google.cloud.gaming.v1beta.CreateGameServerConfigRequest', ['parent'] ); request.parent = defaultValue1; @@ -565,7 +569,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1beta.CreateGameServerConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerConfigRequest', + '.google.cloud.gaming.v1beta.CreateGameServerConfigRequest', ['parent'] ); request.parent = defaultValue1; @@ -650,7 +654,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerConfigRequest', + '.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest', ['name'] ); request.name = defaultValue1; @@ -686,7 +690,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerConfigRequest', + '.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest', ['name'] ); request.name = defaultValue1; @@ -743,7 +747,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerConfigRequest', + '.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest', ['name'] ); request.name = defaultValue1; @@ -780,7 +784,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerConfigRequest', + '.google.cloud.gaming.v1beta.DeleteGameServerConfigRequest', ['name'] ); request.name = defaultValue1; @@ -865,7 +869,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1beta.ListGameServerConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerConfigsRequest', + '.google.cloud.gaming.v1beta.ListGameServerConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -908,7 +912,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1beta.ListGameServerConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerConfigsRequest', + '.google.cloud.gaming.v1beta.ListGameServerConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -968,7 +972,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1beta.ListGameServerConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerConfigsRequest', + '.google.cloud.gaming.v1beta.ListGameServerConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1005,7 +1009,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1beta.ListGameServerConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerConfigsRequest', + '.google.cloud.gaming.v1beta.ListGameServerConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1075,7 +1079,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1beta.ListGameServerConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerConfigsRequest', + '.google.cloud.gaming.v1beta.ListGameServerConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1134,7 +1138,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1beta.ListGameServerConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerConfigsRequest', + '.google.cloud.gaming.v1beta.ListGameServerConfigsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1191,7 +1195,7 @@ describe('v1beta.GameServerConfigsServiceClient', () => { new protos.google.cloud.gaming.v1beta.ListGameServerConfigsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerConfigsRequest', + '.google.cloud.gaming.v1beta.ListGameServerConfigsRequest', ['parent'] ); request.parent = defaultValue1; 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 index 9da27654567..7a7ca925dff 100644 --- 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 @@ -296,7 +296,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.GetGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetGameServerDeploymentRequest', + '.google.cloud.gaming.v1.GetGameServerDeploymentRequest', ['name'] ); request.name = defaultValue1; @@ -331,7 +331,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.GetGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetGameServerDeploymentRequest', + '.google.cloud.gaming.v1.GetGameServerDeploymentRequest', ['name'] ); request.name = defaultValue1; @@ -381,7 +381,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.GetGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetGameServerDeploymentRequest', + '.google.cloud.gaming.v1.GetGameServerDeploymentRequest', ['name'] ); request.name = defaultValue1; @@ -418,7 +418,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.GetGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetGameServerDeploymentRequest', + '.google.cloud.gaming.v1.GetGameServerDeploymentRequest', ['name'] ); request.name = defaultValue1; @@ -445,7 +445,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest', ['name'] ); request.name = defaultValue1; @@ -480,7 +480,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest', ['name'] ); request.name = defaultValue1; @@ -530,7 +530,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest', ['name'] ); request.name = defaultValue1; @@ -567,7 +567,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1.GetGameServerDeploymentRolloutRequest', ['name'] ); request.name = defaultValue1; @@ -595,7 +595,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ); request.rollout ??= {}; const defaultValue1 = getTypeDefaultValue( - 'PreviewGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest', ['rollout', 'name'] ); request.rollout.name = defaultValue1; @@ -633,7 +633,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ); request.rollout ??= {}; const defaultValue1 = getTypeDefaultValue( - 'PreviewGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest', ['rollout', 'name'] ); request.rollout.name = defaultValue1; @@ -684,7 +684,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ); request.rollout ??= {}; const defaultValue1 = getTypeDefaultValue( - 'PreviewGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest', ['rollout', 'name'] ); request.rollout.name = defaultValue1; @@ -722,7 +722,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ); request.rollout ??= {}; const defaultValue1 = getTypeDefaultValue( - 'PreviewGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1.PreviewGameServerDeploymentRolloutRequest', ['rollout', 'name'] ); request.rollout.name = defaultValue1; @@ -748,9 +748,10 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.FetchDeploymentStateRequest() ); - const defaultValue1 = getTypeDefaultValue('FetchDeploymentStateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.FetchDeploymentStateRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -782,9 +783,10 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.FetchDeploymentStateRequest() ); - const defaultValue1 = getTypeDefaultValue('FetchDeploymentStateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.FetchDeploymentStateRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -831,9 +833,10 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.FetchDeploymentStateRequest() ); - const defaultValue1 = getTypeDefaultValue('FetchDeploymentStateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.FetchDeploymentStateRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -864,9 +867,10 @@ describe('v1.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.FetchDeploymentStateRequest() ); - const defaultValue1 = getTypeDefaultValue('FetchDeploymentStateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.FetchDeploymentStateRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -888,7 +892,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.CreateGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerDeploymentRequest', + '.google.cloud.gaming.v1.CreateGameServerDeploymentRequest', ['parent'] ); request.parent = defaultValue1; @@ -924,7 +928,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.CreateGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerDeploymentRequest', + '.google.cloud.gaming.v1.CreateGameServerDeploymentRequest', ['parent'] ); request.parent = defaultValue1; @@ -981,7 +985,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.CreateGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerDeploymentRequest', + '.google.cloud.gaming.v1.CreateGameServerDeploymentRequest', ['parent'] ); request.parent = defaultValue1; @@ -1018,7 +1022,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.CreateGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerDeploymentRequest', + '.google.cloud.gaming.v1.CreateGameServerDeploymentRequest', ['parent'] ); request.parent = defaultValue1; @@ -1104,7 +1108,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerDeploymentRequest', + '.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest', ['name'] ); request.name = defaultValue1; @@ -1140,7 +1144,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerDeploymentRequest', + '.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest', ['name'] ); request.name = defaultValue1; @@ -1197,7 +1201,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerDeploymentRequest', + '.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest', ['name'] ); request.name = defaultValue1; @@ -1234,7 +1238,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerDeploymentRequest', + '.google.cloud.gaming.v1.DeleteGameServerDeploymentRequest', ['name'] ); request.name = defaultValue1; @@ -1321,7 +1325,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ); request.gameServerDeployment ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerDeploymentRequest', + '.google.cloud.gaming.v1.UpdateGameServerDeploymentRequest', ['gameServerDeployment', 'name'] ); request.gameServerDeployment.name = defaultValue1; @@ -1358,7 +1362,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ); request.gameServerDeployment ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerDeploymentRequest', + '.google.cloud.gaming.v1.UpdateGameServerDeploymentRequest', ['gameServerDeployment', 'name'] ); request.gameServerDeployment.name = defaultValue1; @@ -1416,7 +1420,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ); request.gameServerDeployment ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerDeploymentRequest', + '.google.cloud.gaming.v1.UpdateGameServerDeploymentRequest', ['gameServerDeployment', 'name'] ); request.gameServerDeployment.name = defaultValue1; @@ -1454,7 +1458,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ); request.gameServerDeployment ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerDeploymentRequest', + '.google.cloud.gaming.v1.UpdateGameServerDeploymentRequest', ['gameServerDeployment', 'name'] ); request.gameServerDeployment.name = defaultValue1; @@ -1541,7 +1545,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ); request.rollout ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest', ['rollout', 'name'] ); request.rollout.name = defaultValue1; @@ -1580,7 +1584,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ); request.rollout ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest', ['rollout', 'name'] ); request.rollout.name = defaultValue1; @@ -1638,7 +1642,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ); request.rollout ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest', ['rollout', 'name'] ); request.rollout.name = defaultValue1; @@ -1674,7 +1678,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { ); request.rollout ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1.UpdateGameServerDeploymentRolloutRequest', ['rollout', 'name'] ); request.rollout.name = defaultValue1; @@ -1759,7 +1763,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.ListGameServerDeploymentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerDeploymentsRequest', + '.google.cloud.gaming.v1.ListGameServerDeploymentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1802,7 +1806,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.ListGameServerDeploymentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerDeploymentsRequest', + '.google.cloud.gaming.v1.ListGameServerDeploymentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1862,7 +1866,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.ListGameServerDeploymentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerDeploymentsRequest', + '.google.cloud.gaming.v1.ListGameServerDeploymentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1899,7 +1903,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.ListGameServerDeploymentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerDeploymentsRequest', + '.google.cloud.gaming.v1.ListGameServerDeploymentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1969,7 +1973,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.ListGameServerDeploymentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerDeploymentsRequest', + '.google.cloud.gaming.v1.ListGameServerDeploymentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -2028,7 +2032,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.ListGameServerDeploymentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerDeploymentsRequest', + '.google.cloud.gaming.v1.ListGameServerDeploymentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -2085,7 +2089,7 @@ describe('v1.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1.ListGameServerDeploymentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerDeploymentsRequest', + '.google.cloud.gaming.v1.ListGameServerDeploymentsRequest', ['parent'] ); request.parent = defaultValue1; 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 index 47a849952d3..c06377604e5 100644 --- 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 @@ -296,7 +296,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetGameServerDeploymentRequest', + '.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest', ['name'] ); request.name = defaultValue1; @@ -331,7 +331,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetGameServerDeploymentRequest', + '.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest', ['name'] ); request.name = defaultValue1; @@ -381,7 +381,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetGameServerDeploymentRequest', + '.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest', ['name'] ); request.name = defaultValue1; @@ -418,7 +418,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetGameServerDeploymentRequest', + '.google.cloud.gaming.v1beta.GetGameServerDeploymentRequest', ['name'] ); request.name = defaultValue1; @@ -445,7 +445,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest', ['name'] ); request.name = defaultValue1; @@ -480,7 +480,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest', ['name'] ); request.name = defaultValue1; @@ -530,7 +530,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest', ['name'] ); request.name = defaultValue1; @@ -567,7 +567,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest() ); const defaultValue1 = getTypeDefaultValue( - 'GetGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1beta.GetGameServerDeploymentRolloutRequest', ['name'] ); request.name = defaultValue1; @@ -595,7 +595,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); request.rollout ??= {}; const defaultValue1 = getTypeDefaultValue( - 'PreviewGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest', ['rollout', 'name'] ); request.rollout.name = defaultValue1; @@ -633,7 +633,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); request.rollout ??= {}; const defaultValue1 = getTypeDefaultValue( - 'PreviewGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest', ['rollout', 'name'] ); request.rollout.name = defaultValue1; @@ -684,7 +684,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); request.rollout ??= {}; const defaultValue1 = getTypeDefaultValue( - 'PreviewGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest', ['rollout', 'name'] ); request.rollout.name = defaultValue1; @@ -722,7 +722,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); request.rollout ??= {}; const defaultValue1 = getTypeDefaultValue( - 'PreviewGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1beta.PreviewGameServerDeploymentRolloutRequest', ['rollout', 'name'] ); request.rollout.name = defaultValue1; @@ -748,9 +748,10 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.FetchDeploymentStateRequest() ); - const defaultValue1 = getTypeDefaultValue('FetchDeploymentStateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.FetchDeploymentStateRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -782,9 +783,10 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.FetchDeploymentStateRequest() ); - const defaultValue1 = getTypeDefaultValue('FetchDeploymentStateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.FetchDeploymentStateRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -831,9 +833,10 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.FetchDeploymentStateRequest() ); - const defaultValue1 = getTypeDefaultValue('FetchDeploymentStateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.FetchDeploymentStateRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -864,9 +867,10 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.FetchDeploymentStateRequest() ); - const defaultValue1 = getTypeDefaultValue('FetchDeploymentStateRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.FetchDeploymentStateRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -888,7 +892,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerDeploymentRequest', + '.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest', ['parent'] ); request.parent = defaultValue1; @@ -924,7 +928,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerDeploymentRequest', + '.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest', ['parent'] ); request.parent = defaultValue1; @@ -981,7 +985,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerDeploymentRequest', + '.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest', ['parent'] ); request.parent = defaultValue1; @@ -1018,7 +1022,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'CreateGameServerDeploymentRequest', + '.google.cloud.gaming.v1beta.CreateGameServerDeploymentRequest', ['parent'] ); request.parent = defaultValue1; @@ -1104,7 +1108,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerDeploymentRequest', + '.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest', ['name'] ); request.name = defaultValue1; @@ -1140,7 +1144,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerDeploymentRequest', + '.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest', ['name'] ); request.name = defaultValue1; @@ -1197,7 +1201,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerDeploymentRequest', + '.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest', ['name'] ); request.name = defaultValue1; @@ -1234,7 +1238,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest() ); const defaultValue1 = getTypeDefaultValue( - 'DeleteGameServerDeploymentRequest', + '.google.cloud.gaming.v1beta.DeleteGameServerDeploymentRequest', ['name'] ); request.name = defaultValue1; @@ -1321,7 +1325,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); request.gameServerDeployment ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerDeploymentRequest', + '.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest', ['gameServerDeployment', 'name'] ); request.gameServerDeployment.name = defaultValue1; @@ -1358,7 +1362,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); request.gameServerDeployment ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerDeploymentRequest', + '.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest', ['gameServerDeployment', 'name'] ); request.gameServerDeployment.name = defaultValue1; @@ -1416,7 +1420,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); request.gameServerDeployment ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerDeploymentRequest', + '.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest', ['gameServerDeployment', 'name'] ); request.gameServerDeployment.name = defaultValue1; @@ -1454,7 +1458,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); request.gameServerDeployment ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerDeploymentRequest', + '.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRequest', ['gameServerDeployment', 'name'] ); request.gameServerDeployment.name = defaultValue1; @@ -1541,7 +1545,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); request.rollout ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest', ['rollout', 'name'] ); request.rollout.name = defaultValue1; @@ -1580,7 +1584,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); request.rollout ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest', ['rollout', 'name'] ); request.rollout.name = defaultValue1; @@ -1638,7 +1642,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); request.rollout ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest', ['rollout', 'name'] ); request.rollout.name = defaultValue1; @@ -1674,7 +1678,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { ); request.rollout ??= {}; const defaultValue1 = getTypeDefaultValue( - 'UpdateGameServerDeploymentRolloutRequest', + '.google.cloud.gaming.v1beta.UpdateGameServerDeploymentRolloutRequest', ['rollout', 'name'] ); request.rollout.name = defaultValue1; @@ -1759,7 +1763,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerDeploymentsRequest', + '.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1802,7 +1806,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerDeploymentsRequest', + '.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1862,7 +1866,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerDeploymentsRequest', + '.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1899,7 +1903,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerDeploymentsRequest', + '.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1971,7 +1975,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerDeploymentsRequest', + '.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -2032,7 +2036,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerDeploymentsRequest', + '.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest', ['parent'] ); request.parent = defaultValue1; @@ -2089,7 +2093,7 @@ describe('v1beta.GameServerDeploymentsServiceClient', () => { new protos.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListGameServerDeploymentsRequest', + '.google.cloud.gaming.v1beta.ListGameServerDeploymentsRequest', ['parent'] ); request.parent = defaultValue1; diff --git a/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts b/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts index cb55aeb6585..c715b148268 100644 --- a/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1.ts @@ -269,7 +269,10 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('GetRealmRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetRealmRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -297,7 +300,10 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('GetRealmRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetRealmRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -341,7 +347,10 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('GetRealmRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetRealmRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -366,7 +375,10 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.GetRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('GetRealmRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.GetRealmRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -385,10 +397,10 @@ describe('v1.RealmsServiceClient', () => { new protos.google.cloud.gaming.v1.PreviewRealmUpdateRequest() ); request.realm ??= {}; - const defaultValue1 = getTypeDefaultValue('PreviewRealmUpdateRequest', [ - 'realm', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewRealmUpdateRequest', + ['realm', 'name'] + ); request.realm.name = defaultValue1; const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -418,10 +430,10 @@ describe('v1.RealmsServiceClient', () => { new protos.google.cloud.gaming.v1.PreviewRealmUpdateRequest() ); request.realm ??= {}; - const defaultValue1 = getTypeDefaultValue('PreviewRealmUpdateRequest', [ - 'realm', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewRealmUpdateRequest', + ['realm', 'name'] + ); request.realm.name = defaultValue1; const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -466,10 +478,10 @@ describe('v1.RealmsServiceClient', () => { new protos.google.cloud.gaming.v1.PreviewRealmUpdateRequest() ); request.realm ??= {}; - const defaultValue1 = getTypeDefaultValue('PreviewRealmUpdateRequest', [ - 'realm', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.PreviewRealmUpdateRequest', + ['realm', 'name'] + ); request.realm.name = defaultValue1; const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -498,10 +510,10 @@ describe('v1.RealmsServiceClient', () => { new protos.google.cloud.gaming.v1.PreviewRealmUpdateRequest() ); request.realm ??= {}; - const defaultValue1 = getTypeDefaultValue('PreviewRealmUpdateRequest', [ - 'realm', - 'name', - ]); + 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(); @@ -519,9 +531,10 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.CreateRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateRealmRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.CreateRealmRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -550,9 +563,10 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.CreateRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateRealmRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.CreateRealmRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -603,9 +617,10 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.CreateRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateRealmRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.CreateRealmRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -633,9 +648,10 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.CreateRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateRealmRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.CreateRealmRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -705,7 +721,10 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.DeleteRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteRealmRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.DeleteRealmRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -734,7 +753,10 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.DeleteRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteRealmRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.DeleteRealmRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -785,7 +807,10 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.DeleteRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteRealmRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.DeleteRealmRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -813,7 +838,10 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.DeleteRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteRealmRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.DeleteRealmRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -884,10 +912,10 @@ describe('v1.RealmsServiceClient', () => { new protos.google.cloud.gaming.v1.UpdateRealmRequest() ); request.realm ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateRealmRequest', [ - 'realm', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.UpdateRealmRequest', + ['realm', 'name'] + ); request.realm.name = defaultValue1; const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -917,10 +945,10 @@ describe('v1.RealmsServiceClient', () => { new protos.google.cloud.gaming.v1.UpdateRealmRequest() ); request.realm ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateRealmRequest', [ - 'realm', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.UpdateRealmRequest', + ['realm', 'name'] + ); request.realm.name = defaultValue1; const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -972,10 +1000,10 @@ describe('v1.RealmsServiceClient', () => { new protos.google.cloud.gaming.v1.UpdateRealmRequest() ); request.realm ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateRealmRequest', [ - 'realm', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.UpdateRealmRequest', + ['realm', 'name'] + ); request.realm.name = defaultValue1; const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1004,10 +1032,10 @@ describe('v1.RealmsServiceClient', () => { new protos.google.cloud.gaming.v1.UpdateRealmRequest() ); request.realm ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateRealmRequest', [ - 'realm', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.UpdateRealmRequest', + ['realm', 'name'] + ); request.realm.name = defaultValue1; const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1077,9 +1105,10 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListRealmsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListRealmsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListRealmsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1109,9 +1138,10 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListRealmsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListRealmsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListRealmsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1157,9 +1187,10 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListRealmsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListRealmsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListRealmsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1187,9 +1218,10 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListRealmsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListRealmsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListRealmsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1237,9 +1269,10 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListRealmsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListRealmsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListRealmsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1284,9 +1317,10 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListRealmsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListRealmsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListRealmsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1326,9 +1360,10 @@ describe('v1.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1.ListRealmsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListRealmsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1.ListRealmsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); diff --git a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts index 107ce9c2bb2..4896cca8eae 100644 --- a/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts +++ b/packages/google-cloud-gaming/test/gapic_realms_service_v1beta.ts @@ -269,7 +269,10 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('GetRealmRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetRealmRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -297,7 +300,10 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('GetRealmRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetRealmRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -341,7 +347,10 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('GetRealmRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetRealmRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -366,7 +375,10 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.GetRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('GetRealmRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.GetRealmRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -385,10 +397,10 @@ describe('v1beta.RealmsServiceClient', () => { new protos.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest() ); request.realm ??= {}; - const defaultValue1 = getTypeDefaultValue('PreviewRealmUpdateRequest', [ - 'realm', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest', + ['realm', 'name'] + ); request.realm.name = defaultValue1; const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -418,10 +430,10 @@ describe('v1beta.RealmsServiceClient', () => { new protos.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest() ); request.realm ??= {}; - const defaultValue1 = getTypeDefaultValue('PreviewRealmUpdateRequest', [ - 'realm', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest', + ['realm', 'name'] + ); request.realm.name = defaultValue1; const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -466,10 +478,10 @@ describe('v1beta.RealmsServiceClient', () => { new protos.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest() ); request.realm ??= {}; - const defaultValue1 = getTypeDefaultValue('PreviewRealmUpdateRequest', [ - 'realm', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest', + ['realm', 'name'] + ); request.realm.name = defaultValue1; const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -498,10 +510,10 @@ describe('v1beta.RealmsServiceClient', () => { new protos.google.cloud.gaming.v1beta.PreviewRealmUpdateRequest() ); request.realm ??= {}; - const defaultValue1 = getTypeDefaultValue('PreviewRealmUpdateRequest', [ - 'realm', - 'name', - ]); + 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(); @@ -519,9 +531,10 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.CreateRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateRealmRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.CreateRealmRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -550,9 +563,10 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.CreateRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateRealmRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.CreateRealmRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -603,9 +617,10 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.CreateRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateRealmRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.CreateRealmRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -633,9 +648,10 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.CreateRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateRealmRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.CreateRealmRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -705,7 +721,10 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.DeleteRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteRealmRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.DeleteRealmRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -734,7 +753,10 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.DeleteRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteRealmRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.DeleteRealmRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -785,7 +807,10 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.DeleteRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteRealmRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.DeleteRealmRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -813,7 +838,10 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.DeleteRealmRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteRealmRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.DeleteRealmRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -884,10 +912,10 @@ describe('v1beta.RealmsServiceClient', () => { new protos.google.cloud.gaming.v1beta.UpdateRealmRequest() ); request.realm ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateRealmRequest', [ - 'realm', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.UpdateRealmRequest', + ['realm', 'name'] + ); request.realm.name = defaultValue1; const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -917,10 +945,10 @@ describe('v1beta.RealmsServiceClient', () => { new protos.google.cloud.gaming.v1beta.UpdateRealmRequest() ); request.realm ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateRealmRequest', [ - 'realm', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.UpdateRealmRequest', + ['realm', 'name'] + ); request.realm.name = defaultValue1; const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -972,10 +1000,10 @@ describe('v1beta.RealmsServiceClient', () => { new protos.google.cloud.gaming.v1beta.UpdateRealmRequest() ); request.realm ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateRealmRequest', [ - 'realm', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.UpdateRealmRequest', + ['realm', 'name'] + ); request.realm.name = defaultValue1; const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1004,10 +1032,10 @@ describe('v1beta.RealmsServiceClient', () => { new protos.google.cloud.gaming.v1beta.UpdateRealmRequest() ); request.realm ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateRealmRequest', [ - 'realm', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.UpdateRealmRequest', + ['realm', 'name'] + ); request.realm.name = defaultValue1; const expectedHeaderRequestParams = `realm.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1077,9 +1105,10 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListRealmsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListRealmsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListRealmsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1109,9 +1138,10 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListRealmsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListRealmsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListRealmsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1157,9 +1187,10 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListRealmsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListRealmsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListRealmsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1187,9 +1218,10 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListRealmsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListRealmsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListRealmsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1240,9 +1272,10 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListRealmsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListRealmsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListRealmsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1290,9 +1323,10 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListRealmsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListRealmsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListRealmsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1332,9 +1366,10 @@ describe('v1beta.RealmsServiceClient', () => { const request = generateSampleMessage( new protos.google.cloud.gaming.v1beta.ListRealmsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListRealmsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.gaming.v1beta.ListRealmsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); From e5a3e51b43a108ecde911586010efe1057249f5b Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 22 Sep 2022 14:24:02 -0700 Subject: [PATCH 170/180] chore(main): release 3.1.2 (#314) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 3.1.2 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-gaming/CHANGELOG.md | 7 +++++++ packages/google-cloud-gaming/package.json | 2 +- .../v1/snippet_metadata.google.cloud.gaming.v1.json | 2 +- .../snippet_metadata.google.cloud.gaming.v1beta.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index d8e2606e895..9d3066c8c61 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 5fbb4d65a57..bd06ebedd88 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "3.1.1", + "version": "3.1.2", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", 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 index 7addbe0592d..e01e8e711e5 100644 --- 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 @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gaming", - "version": "3.1.1", + "version": "3.1.2", "language": "TYPESCRIPT", "apis": [ { 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 index 1855a58d180..4a97faa7c82 100644 --- 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 @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gaming", - "version": "3.1.1", + "version": "3.1.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index 05753712824..e9d4c3a6e89 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^3.1.1" + "@google-cloud/game-servers": "^3.1.2" }, "devDependencies": { "c8": "^7.2.1", From 36df4f15b2c32637b12372284627f9c9de3f5a65 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 3 Nov 2022 23:48:21 -0700 Subject: [PATCH 171/180] fix(deps): use google-gax v3.5.2 (#349) --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index bd06ebedd88..95b59584fb8 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -27,7 +27,7 @@ "precompile": "gts clean" }, "dependencies": { - "google-gax": "^3.3.0" + "google-gax": "^3.5.2" }, "devDependencies": { "@types/mocha": "^9.0.0", From dc0afc8c3865a72e891b7d4373b1872f464a8175 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 10 Nov 2022 10:24:39 +0100 Subject: [PATCH 172/180] chore(deps): update dependency @types/node to v18 (#347) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped)) | [`^16.0.0` -> `^18.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/16.18.3/18.11.9) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/compatibility-slim/16.18.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/confidence-slim/16.18.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 95b59584fb8..5b2fa3b020d 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -31,7 +31,7 @@ }, "devDependencies": { "@types/mocha": "^9.0.0", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "@types/sinon": "^10.0.0", "c8": "^7.0.0", "gts": "^3.1.0", From ed40f4fba01c76c3616769488eefc08b843a04bf Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 10 Nov 2022 10:52:37 +0000 Subject: [PATCH 173/180] fix: regenerated protos JS and TS definitions (#353) samples: pull in latest typeless bot, clean up some comments Source-Link: https://togithub.com/googleapis/synthtool/commit/0a68e568b6911b60bb6fd452eba4848b176031d8 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:5b05f26103855c3a15433141389c478d1d3fe088fb5d4e3217c4793f6b3f245e --- .../google-cloud-gaming/protos/protos.d.ts | 2 +- packages/google-cloud-gaming/protos/protos.js | 124 +++++++++++++++--- 2 files changed, 109 insertions(+), 17 deletions(-) diff --git a/packages/google-cloud-gaming/protos/protos.d.ts b/packages/google-cloud-gaming/protos/protos.d.ts index 1f7ea36b8c9..33c855a872c 100644 --- a/packages/google-cloud-gaming/protos/protos.d.ts +++ b/packages/google-cloud-gaming/protos/protos.d.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Long = require("long"); import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); /** Namespace google. */ export namespace google { diff --git a/packages/google-cloud-gaming/protos/protos.js b/packages/google-cloud-gaming/protos/protos.js index 5c7512d2135..acd1081dece 100644 --- a/packages/google-cloud-gaming/protos/protos.js +++ b/packages/google-cloud-gaming/protos/protos.js @@ -719,6 +719,12 @@ 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; @@ -762,7 +768,7 @@ 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] : message.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; @@ -4360,6 +4366,12 @@ 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; @@ -4408,7 +4420,7 @@ 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] : message.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; }; @@ -4905,6 +4917,12 @@ 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; @@ -4941,7 +4959,7 @@ 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] : message.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; }; @@ -5475,6 +5493,12 @@ 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; @@ -5520,7 +5544,7 @@ 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] : message.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; }; @@ -8344,6 +8368,12 @@ 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; @@ -8412,7 +8442,7 @@ 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] : message.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")) @@ -18916,6 +18946,12 @@ 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; @@ -18959,7 +18995,7 @@ 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] : message.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; @@ -36212,6 +36248,12 @@ 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; @@ -36236,6 +36278,10 @@ 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; @@ -36283,7 +36329,7 @@ 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] : message.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")) @@ -36291,7 +36337,7 @@ 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]] : message.style[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; }; @@ -40065,6 +40111,12 @@ 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; @@ -40079,6 +40131,12 @@ break; } switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_DOUBLE": case 1: message.type = 1; @@ -40205,9 +40263,9 @@ 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] : message.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] : message.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")) @@ -42554,6 +42612,12 @@ 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; @@ -42662,7 +42726,7 @@ 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] : message.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")) @@ -43464,6 +43528,12 @@ 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; @@ -43480,6 +43550,12 @@ 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; @@ -43518,6 +43594,10 @@ 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; @@ -43588,7 +43668,7 @@ object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.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")) @@ -43596,7 +43676,7 @@ 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] : message.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")) @@ -43609,7 +43689,7 @@ 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]] : message[".google.api.fieldBehavior"][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); @@ -44986,6 +45066,12 @@ 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; @@ -45055,7 +45141,7 @@ 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] : message.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) @@ -46810,6 +46896,12 @@ 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; @@ -46859,7 +46951,7 @@ 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] : message.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; }; From a841b9bfd7f57b67d5493fa3ebca2f4947e74510 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 10 Nov 2022 13:40:15 +0100 Subject: [PATCH 174/180] chore(deps): update dependency jsdoc to v4 (#352) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jsdoc](https://togithub.com/jsdoc/jsdoc) | [`^3.5.5` -> `^4.0.0`](https://renovatebot.com/diffs/npm/jsdoc/3.6.11/4.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/compatibility-slim/3.6.11)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/confidence-slim/3.6.11)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
jsdoc/jsdoc ### [`v4.0.0`](https://togithub.com/jsdoc/jsdoc/blob/HEAD/CHANGES.md#​400-November-2022) [Compare Source](https://togithub.com/jsdoc/jsdoc/compare/3.6.11...084218523a7d69fec14a852ce680f374f526af28) - JSDoc releases now use [semantic versioning](https://semver.org/). If JSDoc makes backwards-incompatible changes in the future, the major version will be incremented. - JSDoc no longer uses the [`taffydb`](https://taffydb.com/) package. If your JSDoc template or plugin uses the `taffydb` package, see the [instructions for replacing `taffydb` with `@jsdoc/salty`](https://togithub.com/jsdoc/jsdoc/tree/main/packages/jsdoc-salty#use-salty-in-a-jsdoc-template). - JSDoc now supports Node.js 12.0.0 and later.
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-game-servers). --- packages/google-cloud-gaming/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 5b2fa3b020d..801811ff304 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -35,7 +35,7 @@ "@types/sinon": "^10.0.0", "c8": "^7.0.0", "gts": "^3.1.0", - "jsdoc": "^3.5.5", + "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "linkinator": "^4.0.0", From a305e58be763c1eff5ab171fd0bcabc89f349f2c Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 11 Nov 2022 09:36:13 +0000 Subject: [PATCH 175/180] chore(main): release 3.1.3 (#351) :robot: I have created a release *beep* *boop* --- ## [3.1.3](https://togithub.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://togithub.com/googleapis/nodejs-game-servers/issues/349)) ([879eea3](https://togithub.com/googleapis/nodejs-game-servers/commit/879eea37422f58286d3e39e27f5c1b2f6aa4ae9c)) * Regenerated protos JS and TS definitions ([#353](https://togithub.com/googleapis/nodejs-game-servers/issues/353)) ([21535e1](https://togithub.com/googleapis/nodejs-game-servers/commit/21535e16d9dc28888514414117e463271383a971)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- packages/google-cloud-gaming/CHANGELOG.md | 8 ++++++++ packages/google-cloud-gaming/package.json | 2 +- .../v1/snippet_metadata.google.cloud.gaming.v1.json | 2 +- .../snippet_metadata.google.cloud.gaming.v1beta.json | 2 +- packages/google-cloud-gaming/samples/package.json | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-gaming/CHANGELOG.md b/packages/google-cloud-gaming/CHANGELOG.md index 9d3066c8c61..5429a5f7f5a 100644 --- a/packages/google-cloud-gaming/CHANGELOG.md +++ b/packages/google-cloud-gaming/CHANGELOG.md @@ -1,5 +1,13 @@ # 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) diff --git a/packages/google-cloud-gaming/package.json b/packages/google-cloud-gaming/package.json index 801811ff304..ddd613600ba 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/game-servers", - "version": "3.1.2", + "version": "3.1.3", "description": "Game service client for Node.js", "repository": "googleapis/nodejs-game-servers", "license": "Apache-2.0", 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 index e01e8e711e5..7f9692120f3 100644 --- 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 @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gaming", - "version": "3.1.2", + "version": "3.1.3", "language": "TYPESCRIPT", "apis": [ { 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 index 4a97faa7c82..70315131515 100644 --- 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 @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-gaming", - "version": "3.1.2", + "version": "3.1.3", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-gaming/samples/package.json b/packages/google-cloud-gaming/samples/package.json index e9d4c3a6e89..2dbc7d672ac 100644 --- a/packages/google-cloud-gaming/samples/package.json +++ b/packages/google-cloud-gaming/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/game-servers": "^3.1.2" + "@google-cloud/game-servers": "^3.1.3" }, "devDependencies": { "c8": "^7.2.1", From e75efaf456299d5b655e77a07127bdcb1ffe57cd Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Fri, 11 Nov 2022 02:08:35 -0800 Subject: [PATCH 176/180] build: add release-please config, fix owlbot-config --- .release-please-manifest.json | 1 + .../google-cloud-gaming/{.github => }/.OwlBot.yaml | 6 ++---- packages/google-cloud-gaming/.repo-metadata.json | 2 +- packages/google-cloud-gaming/owlbot.py | 4 ++-- packages/google-cloud-gaming/package.json | 13 +++++++++---- release-please-config.json | 3 ++- 6 files changed, 17 insertions(+), 12 deletions(-) rename packages/google-cloud-gaming/{.github => }/.OwlBot.yaml (81%) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c38b0a70276..32965c7d84f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -18,6 +18,7 @@ "packages/google-cloud-dataproc": "4.1.1", "packages/google-cloud-deploy": "2.2.2", "packages/google-cloud-discoveryengine": "0.2.0", + "packages/google-cloud-gaming": "3.1.3", "packages/google-cloud-gkeconnect-gateway": "2.0.5", "packages/google-cloud-gkemulticloud": "0.1.4", "packages/google-cloud-language": "5.1.2", diff --git a/packages/google-cloud-gaming/.github/.OwlBot.yaml b/packages/google-cloud-gaming/.OwlBot.yaml similarity index 81% rename from packages/google-cloud-gaming/.github/.OwlBot.yaml rename to packages/google-cloud-gaming/.OwlBot.yaml index b80a6514b88..4dfe8e32dd9 100644 --- a/packages/google-cloud-gaming/.github/.OwlBot.yaml +++ b/packages/google-cloud-gaming/.OwlBot.yaml @@ -11,16 +11,14 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -docker: - image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest deep-remove-regex: - /owl-bot-staging deep-copy-regex: - - source: /google/cloud/gaming/(v.*)/.*-nodejs/(.*) - dest: /owl-bot-staging/$1/$2 + - 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/.repo-metadata.json b/packages/google-cloud-gaming/.repo-metadata.json index b9cca93c89e..24c6b837c8e 100644 --- a/packages/google-cloud-gaming/.repo-metadata.json +++ b/packages/google-cloud-gaming/.repo-metadata.json @@ -7,7 +7,7 @@ "language": "nodejs", "api_id": "gameservices.googleapis.com", "distribution_name": "@google-cloud/game-servers", - "repo": "googleapis/nodejs-game-servers", + "repo": "googleapis/google-cloud-node", "issue_tracker": "", "name_pretty": "Google Cloud Game Servers", "default_version": "v1", diff --git a/packages/google-cloud-gaming/owlbot.py b/packages/google-cloud-gaming/owlbot.py index 0c22665a217..da779f13ebf 100644 --- a/packages/google-cloud-gaming/owlbot.py +++ b/packages/google-cloud-gaming/owlbot.py @@ -12,7 +12,7 @@ # 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 as node +import synthtool.languages.node_mono_repo as node -node.owlbot_main(staging_excludes=['package.json', 'README.md'], templates_excludes=['.github/CODEOWNERS']) +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 index ddd613600ba..43c6d42442a 100644 --- a/packages/google-cloud-gaming/package.json +++ b/packages/google-cloud-gaming/package.json @@ -2,7 +2,11 @@ "name": "@google-cloud/game-servers", "version": "3.1.3", "description": "Game service client for Node.js", - "repository": "googleapis/nodejs-game-servers", + "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": [ @@ -20,8 +24,8 @@ "lint": "gts check", "predocs-test": "npm run docs", "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", + "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" @@ -50,5 +54,6 @@ }, "engines": { "node": ">=12.0.0" - } + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-gaming" } diff --git a/release-please-config.json b/release-please-config.json index ca8fb90627b..447dbf082c5 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -19,6 +19,7 @@ "packages/google-cloud-dataproc": {}, "packages/google-cloud-deploy": {}, "packages/google-cloud-discoveryengine": {}, + "packages/google-cloud-gaming": {}, "packages/google-cloud-gkeconnect-gateway": {}, "packages/google-cloud-gkemulticloud": {}, "packages/google-cloud-language": {}, @@ -49,4 +50,4 @@ } ], "release-type": "node" -} \ No newline at end of file +} From 17ddc771e6a0170a0add6a36bf25ac714e0ab654 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Fri, 11 Nov 2022 10:31:49 +0000 Subject: [PATCH 177/180] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot?= =?UTF-8?q?=20post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- packages/google-cloud-gaming/.mocharc.js | 2 +- packages/google-cloud-gaming/.prettierrc.js | 2 +- packages/google-cloud-gaming/README.md | 94 +- .../google-cloud-gaming/samples/README.md | 832 +++++++++++++++--- packages/google-cloud-gaming/src/index.ts | 2 +- release-please-config.json | 2 +- 6 files changed, 771 insertions(+), 163 deletions(-) diff --git a/packages/google-cloud-gaming/.mocharc.js b/packages/google-cloud-gaming/.mocharc.js index 0b600509bed..cdb7b752160 100644 --- a/packages/google-cloud-gaming/.mocharc.js +++ b/packages/google-cloud-gaming/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-gaming/.prettierrc.js b/packages/google-cloud-gaming/.prettierrc.js index d1b95106f4c..d546a4ad546 100644 --- a/packages/google-cloud-gaming/.prettierrc.js +++ b/packages/google-cloud-gaming/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/packages/google-cloud-gaming/README.md b/packages/google-cloud-gaming/README.md index cb39069f4bb..89612511da6 100644 --- a/packages/google-cloud-gaming/README.md +++ b/packages/google-cloud-gaming/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Google Cloud Game Servers: Node.js Client](https://github.com/googleapis/nodejs-game-servers) +# [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) @@ -14,11 +14,11 @@ Game service client for Node.js A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-game-servers/blob/main/CHANGELOG.md). +[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/nodejs-game-servers](https://github.com/googleapis/nodejs-game-servers) +* [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]. @@ -96,35 +96,67 @@ quickstart(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-game-servers/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +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 | | --------------------------- | --------------------------------- | ------ | -| Create_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/create_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_cluster.js,samples/README.md) | -| Create_config | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/create_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_config.js,samples/README.md) | -| Create_deployment | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/create_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_deployment.js,samples/README.md) | -| Create_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/create_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/create_realm.js,samples/README.md) | -| Delete_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/delete_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_cluster.js,samples/README.md) | -| Delete_config | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/delete_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_config.js,samples/README.md) | -| Delete_deployment | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/delete_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_deployment.js,samples/README.md) | -| Delete_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/delete_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/delete_realm.js,samples/README.md) | -| Get_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/get_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_cluster.js,samples/README.md) | -| Get_config | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/get_config.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_config.js,samples/README.md) | -| Get_deployment | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/get_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_deployment.js,samples/README.md) | -| Get_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/get_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_realm.js,samples/README.md) | -| Get_rollout | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/get_rollout.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/get_rollout.js,samples/README.md) | -| List_clusters | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/list_clusters.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_clusters.js,samples/README.md) | -| List_configs | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/list_configs.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_configs.js,samples/README.md) | -| List_deployments | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/list_deployments.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_deployments.js,samples/README.md) | -| List_realms | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/list_realms.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/list_realms.js,samples/README.md) | -| Create Game Server Realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | -| Update_cluster | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_cluster.js,samples/README.md) | -| Update_deployment | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_deployment.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_deployment.js,samples/README.md) | -| Update_realm | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_realm.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_realm.js,samples/README.md) | -| Update_rollout_default | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_rollout_default.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_default.js,samples/README.md) | -| Update_rollout_override | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_rollout_override.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_override.js,samples/README.md) | -| Update_rollout_remove_default | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_rollout_remove_default.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_remove_default.js,samples/README.md) | -| Update_rollout_remove_override | [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_rollout_remove_override.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_remove_override.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/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 | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/test/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/test/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) | @@ -174,7 +206,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-game-servers/blob/main/CONTRIBUTING.md). +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`) @@ -186,7 +218,7 @@ to its templates in Apache Version 2.0 -See [LICENSE](https://github.com/googleapis/nodejs-game-servers/blob/main/LICENSE) +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/ diff --git a/packages/google-cloud-gaming/samples/README.md b/packages/google-cloud-gaming/samples/README.md index e328ce91234..c84cc5dbd3c 100644 --- a/packages/google-cloud-gaming/samples/README.md +++ b/packages/google-cloud-gaming/samples/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Google Cloud Game Servers: Node.js Samples](https://github.com/googleapis/nodejs-game-servers) +# [Google Cloud Game Servers: Node.js Samples](https://github.com/googleapis/google-cloud-node) [![Open in Cloud Shell][shell_img]][shell_link] @@ -12,36 +12,68 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) - * [Create_cluster](#create_cluster) - * [Create_config](#create_config) - * [Create_deployment](#create_deployment) - * [Create_realm](#create_realm) - * [Delete_cluster](#delete_cluster) - * [Delete_config](#delete_config) - * [Delete_deployment](#delete_deployment) - * [Delete_realm](#delete_realm) - * [Get_cluster](#get_cluster) - * [Get_config](#get_config) - * [Get_deployment](#get_deployment) - * [Get_realm](#get_realm) - * [Get_rollout](#get_rollout) - * [List_clusters](#list_clusters) - * [List_configs](#list_configs) - * [List_deployments](#list_deployments) - * [List_realms](#list_realms) + * [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) - * [Update_cluster](#update_cluster) - * [Update_deployment](#update_deployment) - * [Update_realm](#update_realm) - * [Update_rollout_default](#update_rollout_default) - * [Update_rollout_override](#update_rollout_override) - * [Update_rollout_remove_default](#update_rollout_remove_default) - * [Update_rollout_remove_override](#update_rollout_remove_override) + * [Quickstart](#quickstart) + * [Quickstart.test](#quickstart.test) ## Before you begin Before running the samples, make sure you've followed the steps outlined in -[Using the client library](https://github.com/googleapis/nodejs-game-servers#using-the-client-library). +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). `cd samples` @@ -53,16 +85,16 @@ Before running the samples, make sure you've followed the steps outlined in -### Create_cluster +### Game_server_clusters_service.create_game_server_cluster -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/create_cluster.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/create_cluster.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/create_cluster.js` +`node packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.create_game_server_cluster.js` ----- @@ -70,16 +102,16 @@ __Usage:__ -### Create_config +### Game_server_clusters_service.delete_game_server_cluster -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/create_config.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/create_config.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/create_config.js` +`node packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.delete_game_server_cluster.js` ----- @@ -87,16 +119,16 @@ __Usage:__ -### Create_deployment +### Game_server_clusters_service.get_game_server_cluster -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/create_deployment.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/create_deployment.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/create_deployment.js` +`node packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.get_game_server_cluster.js` ----- @@ -104,16 +136,16 @@ __Usage:__ -### Create_realm +### Game_server_clusters_service.list_game_server_clusters -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/create_realm.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/create_realm.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/create_realm.js` +`node packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.list_game_server_clusters.js` ----- @@ -121,16 +153,16 @@ __Usage:__ -### Delete_cluster +### Game_server_clusters_service.preview_create_game_server_cluster -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/delete_cluster.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/delete_cluster.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/delete_cluster.js` +`node packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_create_game_server_cluster.js` ----- @@ -138,16 +170,16 @@ __Usage:__ -### Delete_config +### Game_server_clusters_service.preview_delete_game_server_cluster -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/delete_config.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/delete_config.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/delete_config.js` +`node packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_delete_game_server_cluster.js` ----- @@ -155,16 +187,16 @@ __Usage:__ -### Delete_deployment +### Game_server_clusters_service.preview_update_game_server_cluster -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/delete_deployment.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/delete_deployment.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/delete_deployment.js` +`node packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.preview_update_game_server_cluster.js` ----- @@ -172,16 +204,16 @@ __Usage:__ -### Delete_realm +### Game_server_clusters_service.update_game_server_cluster -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/delete_realm.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/delete_realm.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/delete_realm.js` +`node packages/google-cloud-gaming/samples/generated/v1/game_server_clusters_service.update_game_server_cluster.js` ----- @@ -189,16 +221,16 @@ __Usage:__ -### Get_cluster +### Game_server_configs_service.create_game_server_config -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/get_cluster.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/get_cluster.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/get_cluster.js` +`node packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.create_game_server_config.js` ----- @@ -206,16 +238,16 @@ __Usage:__ -### Get_config +### Game_server_configs_service.delete_game_server_config -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/get_config.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/get_config.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/get_config.js` +`node packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.delete_game_server_config.js` ----- @@ -223,16 +255,16 @@ __Usage:__ -### Get_deployment +### Game_server_configs_service.get_game_server_config -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/get_deployment.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/get_deployment.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/get_deployment.js` +`node packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.get_game_server_config.js` ----- @@ -240,16 +272,16 @@ __Usage:__ -### Get_realm +### Game_server_configs_service.list_game_server_configs -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/get_realm.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/get_realm.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/get_realm.js` +`node packages/google-cloud-gaming/samples/generated/v1/game_server_configs_service.list_game_server_configs.js` ----- @@ -257,16 +289,16 @@ __Usage:__ -### Get_rollout +### Game_server_deployments_service.create_game_server_deployment -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/get_rollout.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/get_rollout.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/get_rollout.js` +`node packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.create_game_server_deployment.js` ----- @@ -274,16 +306,16 @@ __Usage:__ -### List_clusters +### Game_server_deployments_service.delete_game_server_deployment -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/list_clusters.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/list_clusters.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/list_clusters.js` +`node packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.delete_game_server_deployment.js` ----- @@ -291,16 +323,16 @@ __Usage:__ -### List_configs +### Game_server_deployments_service.fetch_deployment_state -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/list_configs.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/list_configs.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/list_configs.js` +`node packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.fetch_deployment_state.js` ----- @@ -308,16 +340,16 @@ __Usage:__ -### List_deployments +### Game_server_deployments_service.get_game_server_deployment -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/list_deployments.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/list_deployments.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/list_deployments.js` +`node packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.get_game_server_deployment.js` ----- @@ -325,16 +357,16 @@ __Usage:__ -### List_realms +### Game_server_deployments_service.get_game_server_deployment_rollout -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/list_realms.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/list_realms.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/list_realms.js` +`node packages/google-cloud-gaming/samples/generated/v1/game_server_deployments_service.get_game_server_deployment_rollout.js` ----- @@ -342,18 +374,373 @@ __Usage:__ -### Create Game Server Realm +### Game_server_deployments_service.list_game_server_deployments -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/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/nodejs-game-servers/blob/main/samples/quickstart.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 quickstart.js ` +`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` ----- @@ -361,16 +748,16 @@ __Usage:__ -### Update_cluster +### Game_server_deployments_service.create_game_server_deployment -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_cluster.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/update_cluster.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/update_cluster.js` +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.create_game_server_deployment.js` ----- @@ -378,16 +765,16 @@ __Usage:__ -### Update_deployment +### Game_server_deployments_service.delete_game_server_deployment -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_deployment.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/update_deployment.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/update_deployment.js` +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.delete_game_server_deployment.js` ----- @@ -395,16 +782,16 @@ __Usage:__ -### Update_realm +### Game_server_deployments_service.fetch_deployment_state -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_realm.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/update_realm.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/update_realm.js` +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.fetch_deployment_state.js` ----- @@ -412,16 +799,16 @@ __Usage:__ -### Update_rollout_default +### Game_server_deployments_service.get_game_server_deployment -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_rollout_default.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_default.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/update_rollout_default.js` +`node packages/google-cloud-gaming/samples/generated/v1beta/game_server_deployments_service.get_game_server_deployment.js` ----- @@ -429,16 +816,205 @@ __Usage:__ -### Update_rollout_override +### Game_server_deployments_service.get_game_server_deployment_rollout -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_rollout_override.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_override.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/update_rollout_override.js` +`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 ` ----- @@ -446,16 +1022,16 @@ __Usage:__ -### Update_rollout_remove_default +### Quickstart -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_rollout_remove_default.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/test/quickstart.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_remove_default.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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.js,samples/README.md) __Usage:__ -`node samples/update_rollout_remove_default.js` +`node packages/google-cloud-gaming/samples/test/quickstart.js` ----- @@ -463,16 +1039,16 @@ __Usage:__ -### Update_rollout_remove_override +### Quickstart.test -View the [source code](https://github.com/googleapis/nodejs-game-servers/blob/main/samples/update_rollout_remove_override.js). +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/nodejs-game-servers&page=editor&open_in_editor=samples/update_rollout_remove_override.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](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 samples/update_rollout_remove_override.js` +`node packages/google-cloud-gaming/samples/test/quickstart.test.js` @@ -480,5 +1056,5 @@ __Usage:__ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png -[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-game-servers&page=editor&open_in_editor=samples/README.md +[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/src/index.ts b/packages/google-cloud-gaming/src/index.ts index 05c94cbb4be..15ebde47822 100644 --- a/packages/google-cloud-gaming/src/index.ts +++ b/packages/google-cloud-gaming/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/release-please-config.json b/release-please-config.json index 447dbf082c5..321981e7766 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -50,4 +50,4 @@ } ], "release-type": "node" -} +} \ No newline at end of file From e7d979878063e91244a94cc80ffcdb0731a4b517 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Fri, 11 Nov 2022 16:26:46 -0800 Subject: [PATCH 178/180] samples: delete extra test --- .../samples/test/quickstart.js | 53 ------------------- .../samples/test/quickstart.test.js | 42 +++++++-------- 2 files changed, 20 insertions(+), 75 deletions(-) delete mode 100644 packages/google-cloud-gaming/samples/test/quickstart.js diff --git a/packages/google-cloud-gaming/samples/test/quickstart.js b/packages/google-cloud-gaming/samples/test/quickstart.js deleted file mode 100644 index e9faf4f0756..00000000000 --- a/packages/google-cloud-gaming/samples/test/quickstart.js +++ /dev/null @@ -1,53 +0,0 @@ -// 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/samples/test/quickstart.test.js b/packages/google-cloud-gaming/samples/test/quickstart.test.js index 8d370fa7d5b..e9faf4f0756 100644 --- a/packages/google-cloud-gaming/samples/test/quickstart.test.js +++ b/packages/google-cloud-gaming/samples/test/quickstart.test.js @@ -11,45 +11,43 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +// +// ** This file 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 cleanup = require('./clean.js'); -const {describe, it, before, after} = require('mocha'); -const {RealmsServiceClient} = require('@google-cloud/game-servers'); - 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'}); -const LOCATION = 'us-central1'; - -describe('Game Servers Quickstart Test', () => { - const client = new RealmsServiceClient(); - let realmId; +describe('Quickstart', () => { + let projectId; + let client; + const location = 'us-central1'; + const realmId = `realm-${uuid.v4().split('-')[0]}`; before(async () => { - await cleanup(); + client = new RealmsServiceClient(); + projectId = await client.getProjectId(); }); - it('should create a realm', async () => { - const projectId = await client.getProjectId(); - realmId = `test-${uuid.v4()}`; - - const quickstart_output = execSync( - `node quickstart.js ${projectId} ${LOCATION} ${realmId}` + it('should run quickstart', async () => { + const stdout = execSync( + `node quickstart.js ${projectId} ${location} ${realmId}` ); - assert.match(quickstart_output, /Realm time zone:/); + assert.include(stdout, 'Realm created:'); }); after(async () => { - const projectId = await client.getProjectId(); - const request = { - name: `projects/${projectId}/locations/${LOCATION}/realms/${realmId}`, - }; - const [operation] = await client.deleteRealm(request); + const [operation] = await client.deleteRealm({ + name: client.realmPath(projectId, location, realmId), + }); await operation.promise(); }); }); From b3f4de11979ab42fe6f9d3050cdd705e7c2d5103 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Sat, 12 Nov 2022 00:55:48 +0000 Subject: [PATCH 179/180] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot?= =?UTF-8?q?=20post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- packages/google-cloud-gaming/README.md | 1 - packages/google-cloud-gaming/samples/README.md | 18 ------------------ 2 files changed, 19 deletions(-) diff --git a/packages/google-cloud-gaming/README.md b/packages/google-cloud-gaming/README.md index 89612511da6..bb919327535 100644 --- a/packages/google-cloud-gaming/README.md +++ b/packages/google-cloud-gaming/README.md @@ -155,7 +155,6 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | 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 | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/test/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/test/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) | diff --git a/packages/google-cloud-gaming/samples/README.md b/packages/google-cloud-gaming/samples/README.md index c84cc5dbd3c..682bb9f5cb6 100644 --- a/packages/google-cloud-gaming/samples/README.md +++ b/packages/google-cloud-gaming/samples/README.md @@ -67,7 +67,6 @@ * [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](#quickstart) * [Quickstart.test](#quickstart.test) ## Before you begin @@ -1022,23 +1021,6 @@ __Usage:__ -### Quickstart - -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/test/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/test/quickstart.js,samples/README.md) - -__Usage:__ - - -`node packages/google-cloud-gaming/samples/test/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). From 850d22cec8ab87fe563c3cc78ea7f86ed8a224bc Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Sat, 12 Nov 2022 00:55:52 +0000 Subject: [PATCH 180/180] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot?= =?UTF-8?q?=20post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- packages/google-cloud-gaming/README.md | 1 - packages/google-cloud-gaming/samples/README.md | 18 ------------------ 2 files changed, 19 deletions(-) diff --git a/packages/google-cloud-gaming/README.md b/packages/google-cloud-gaming/README.md index 89612511da6..bb919327535 100644 --- a/packages/google-cloud-gaming/README.md +++ b/packages/google-cloud-gaming/README.md @@ -155,7 +155,6 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | 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 | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/test/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/test/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) | diff --git a/packages/google-cloud-gaming/samples/README.md b/packages/google-cloud-gaming/samples/README.md index c84cc5dbd3c..682bb9f5cb6 100644 --- a/packages/google-cloud-gaming/samples/README.md +++ b/packages/google-cloud-gaming/samples/README.md @@ -67,7 +67,6 @@ * [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](#quickstart) * [Quickstart.test](#quickstart.test) ## Before you begin @@ -1022,23 +1021,6 @@ __Usage:__ -### Quickstart - -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-gaming/samples/test/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/test/quickstart.js,samples/README.md) - -__Usage:__ - - -`node packages/google-cloud-gaming/samples/test/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).